Skip to content

Commit db0bc01

Browse files
committed
WIP: light/dark moved to settings
1 parent 7ded763 commit db0bc01

File tree

5 files changed

+18
-120
lines changed

5 files changed

+18
-120
lines changed

README.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,14 @@ curl -fsSL https://raw.githubusercontent.com/JulienMaille/spicetify-dynamic-them
3333
```
3434
spicetify config extensions default-dynamic.js extensions Vibrant.min.js
3535
spicetify config current_theme DefaultDynamic
36-
spicetify config color_scheme base
36+
spicetify config color_scheme Dark-Base
3737
spicetify config inject_css 1 replace_colors 1
3838
spicetify apply
3939
```
4040
41-
## Follow system dark/light theme
42-
> [!IMPORTANT]
43-
> From Spotify v1.2.17, dark mode is forced. You will need to patch Spotify binary:
44-
45-
#### Windows (PowerShell)
46-
47-
```powershell
48-
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/JulienMaille/spicetify-dynamic-theme/master/patch-dark-mode.ps1" | Invoke-Expression
49-
```
50-
51-
#### Linux/MacOS (Bash)
52-
53-
```bash
54-
curl -fsSL "https://raw.githubusercontent.com/JulienMaille/spicetify-dynamic-theme/master/patch-dark-mode.sh" | sh
55-
```
41+
## Settings
42+
- **Theme**: You can choose between `dark` and `light` theme in the Spicetify settings menu.
43+
- **Animation**: You can toggle the animation on or off by changing the color scheme in the Spicetify settings menu.
5644
5745
## Uninstall
5846

color.ini

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
[Base]
1+
[Dark-Base]
22
animation = 010101
3-
[NoAnimation]
3+
dark = 010101
4+
[Light-Base]
5+
animation = 010101
6+
dark = 000000
7+
[Dark-NoAnimation]
8+
animation = 000000
9+
dark = 010101
10+
[Light-NoAnimation]
411
animation = 000000
12+
dark = 000000

default-dynamic.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ function setLightness(hex, lightness) {
106106

107107
let textColor = "#1db954";
108108
let textColorBg = getComputedStyle(document.documentElement).getPropertyValue("--spice-main");
109+
let settingsDark = getComputedStyle(document.documentElement).getPropertyValue("--spice-dark");
109110

110111
function setRootColor(name, colHex) {
111112
let root = document.documentElement;
@@ -134,13 +135,8 @@ function toggleDark(setDark) {
134135
updateColors(textColor);
135136
}
136137

137-
/* Init with current system light/dark mode */
138-
let systemDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
139-
toggleDark(systemDark);
140-
141-
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
142-
toggleDark(e.matches);
143-
});
138+
/* Init with light/dark mode from settings */
139+
toggleDark(settingsDark);
144140

145141
waitForElement([".main-actionButtons"], (queries) => {
146142
// Add activator on top bar
@@ -353,7 +349,7 @@ songchange();
353349
.catch((err) => {
354350
// Do something for an error here
355351
});
356-
Spicetify.showNotification("Applied system " + (systemDark ? "dark" : "light") + " theme.");
352+
Spicetify.showNotification("Applied " + (settingsDark ? "dark" : "light") + " theme.");
357353
})();
358354

359355
document.documentElement.style.setProperty("--warning_message", " ");

patch-dark-mode.ps1

Lines changed: 0 additions & 44 deletions
This file was deleted.

patch-dark-mode.sh

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)