项目作者: andreazangheri

项目描述 :
GitHub Desktop Theme Dark Fusion
高级语言: CSS
项目地址: git://github.com/andreazangheri/github-dark-fusion.git
创建时间: 2018-10-18T10:02:46Z
项目社区:https://github.com/andreazangheri/github-dark-fusion

开源协议:MIT License

下载


GitHub Desktop Dark Fusion Theme

Theme
Tested platform
GitHub issues
GitHub file size
GitHub

Warning!

This theme will override your current selected theme.

At the moment this theme has been tested only on macOS 10.14

Install

  1. Open Github Desktop
  2. Open the devtools with View > Toggle developer tools (or Ctrl+Shift+I)
  3. Paste in the following into the Console and hit Enter:
    ```js
    const fs = require(‘fs’);
    const path = require(‘path’);
    const res = process.resourcesPath;

let html_file_path;
if (fs.existsSync(path.join(res, ‘app/index.html’))) {
html_file_path = path.join(res, ‘app/index.html’);
} else if (fs.existsSync(path.join(res, ‘app/dist/index.html’))) {
html_file_path = path.join(res, ‘app/dist/index.html’);
} else {
throw new Error(Couldn't find index.html);
}

let html = fs.readFileSync(html_file_path, “utf8”);

const link_to_inject = ‘ fusion@v0.5-alpha/desktop--dark-fusion.css" rel="stylesheet">‘;
html = html
.replace(/]+(cdn|custom-theme)[^>]+>/, ‘’) // remove existing custom stylesheet if there is one
.replace(‘‘, \n${link_to_inject}</head>); // add stylesheet

try {
fs.writeFileSync(html_file_path, html, ‘utf8’);
} catch(error) {
if (html_file_path.startsWith(‘/tmp’)) {
console.error(The theme cannot be applied to the AppImage since 'index.html' is saved in a temporary directory.)
} else if (error.code == ‘EACCES’) {
console.error(You need to have write access to '${html_file_path}' for the theme to be applied.)
}
throw error;
}

// clear the cache so the stylesheet can update (could alternatively cache-bust with a URL parameter)
const {remote} = require(‘electron’);
const win = remote.getCurrentWindow();
win.webContents.session.clearCache(() => {
if (confirm(‘Ready to refresh? :)’)) {
location.reload();
}
});
```

GitHub Desktop will refresh and the theme should be applied.

You’ll need to reapply the stylesheet when GitHub Desktop updates.