Skip to content

Commit e62ee35

Browse files
committed
Rename cssFiles option to themes and add menu entry
1 parent ef6fb40 commit e62ee35

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ function onClosed() {
8585
function loadPlugins(win) {
8686
injectCSS(win.webContents, path.join(__dirname, "youtube-music.css"));
8787
// Load user CSS
88-
const cssFiles = config.get("options.cssFiles");
89-
if (Array.isArray(cssFiles)) {
90-
cssFiles.forEach((cssFile) => {
88+
const themes = config.get("options.themes");
89+
if (Array.isArray(themes)) {
90+
themes.forEach((cssFile) => {
9191
fileExists(
9292
cssFile,
9393
() => {

menu.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,34 @@ const mainMenuTemplate = (win) => {
100100
config.set("options.ForceShowLikeButtons", item.checked);
101101
},
102102
},
103+
{
104+
label: "Theme",
105+
submenu: [
106+
{
107+
label: "No theme",
108+
type: "radio",
109+
checked: !config.get("options.themes"), // todo rename "themes"
110+
click: () => {
111+
config.set("options.themes", []);
112+
},
113+
},
114+
{ type: "separator" },
115+
{
116+
label: "Import custom CSS file",
117+
type: "radio",
118+
checked: false,
119+
click: async () => {
120+
const { filePaths } = await dialog.showOpenDialog({
121+
filters: [{ name: "CSS Files", extensions: ["css"] }],
122+
properties: ["openFile", "multiSelections"],
123+
});
124+
if (filePaths) {
125+
config.set("options.themes", filePaths);
126+
}
127+
},
128+
},
129+
],
130+
},
103131
],
104132
},
105133
{

readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ If you get an error "is damaged and can’t be opened." when launching the app,
9797

9898
> If using `Hide Menu` option - you can show the menu with the `alt` key (or `escape` if using the in-app-menu plugin)
9999
100+
## Themes
101+
102+
You can load CSS files to change the look of the application (Options > Visual Tweaks > Themes).
103+
104+
Some predefined themes are available in https://github.com/OceanicSquirrel/themes-for-ytmdesktop-player.
105+
100106
## Dev
101107

102108
```sh

0 commit comments

Comments
 (0)