Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/internal/matugen/matugen.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ var templateRegistry = []TemplateDef{
{ID: "fcitx5", Commands: []string{"fcitx5"}, ConfigDirs: []string{"fcitx5"}, ConfigFile: "fcitx5.toml"},
{ID: "firefox", Commands: []string{"firefox"}, ConfigFile: "firefox.toml"},
{ID: "pywalfox", Commands: []string{"pywalfox"}, ConfigFile: "pywalfox.toml"},
{ID: "spicetify", Commands: []string{"spicetify"}, ConfigFile: "spicetify.toml"},
{ID: "zenbrowser", Commands: []string{"zen", "zen-browser", "zen-beta", "zen-twilight"}, Flatpaks: []string{"app.zen_browser.zen"}, ConfigFile: "zenbrowser.toml"},
{ID: "vesktop", Commands: []string{"vesktop"}, Flatpaks: []string{"dev.vencord.Vesktop"}, ConfigDirs: []string{"vesktop"}, ConfigFile: "vesktop.toml", FlatpakConfigPath: "dev.vencord.Vesktop/config"},
{ID: "vencord", Commands: []string{"discord", "Discord", "discord-canary", "DiscordCanary"}, Flatpaks: []string{"com.discordapp.Discord", "com.discordapp.DiscordCanary"}, ConfigDirs: []string{"Vencord"}, ConfigFile: "vencord.toml"},
Expand Down
1 change: 1 addition & 0 deletions quickshell/Common/SettingsData.qml
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ Singleton {
property bool matugenTemplateQtengine: true
property bool matugenTemplateFirefox: true
property bool matugenTemplatePywalfox: true
property bool matugenTemplateSpicetify: true
property bool matugenTemplateZenBrowser: true
property bool matugenTemplateVesktop: true
property bool matugenTemplateVencord: true
Expand Down
4 changes: 3 additions & 1 deletion quickshell/Common/Theme.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ Singleton {
if (typeof SettingsData !== "undefined") {
const skipTemplates = [];
if (!SettingsData.runDmsMatugenTemplates) {
skipTemplates.push("gtk", "nvim", "niri", "qt5ct", "qt6ct", "qtengine", "fcitx5", "firefox", "pywalfox", "zenbrowser", "vesktop", "vencord", "equibop", "ghostty", "kitty", "foot", "alacritty", "wezterm", "dgop", "kcolorscheme", "vscode", "emacs", "zed");
skipTemplates.push("gtk", "nvim", "niri", "qt5ct", "qt6ct", "qtengine", "fcitx5", "firefox", "pywalfox", "spicetify", "zenbrowser", "vesktop", "vencord", "equibop", "ghostty", "kitty", "foot", "alacritty", "wezterm", "dgop", "kcolorscheme", "vscode", "emacs", "zed");
} else {
if (!SettingsData.matugenTemplateGtk)
skipTemplates.push("gtk");
Expand All @@ -1547,6 +1547,8 @@ Singleton {
skipTemplates.push("firefox");
if (!SettingsData.matugenTemplatePywalfox)
skipTemplates.push("pywalfox");
if (!SettingsData.matugenTemplateSpicetify)
skipTemplates.push("spicetify");
if (!SettingsData.matugenTemplateZenBrowser)
skipTemplates.push("zenbrowser");
if (!SettingsData.matugenTemplateVesktop)
Expand Down
1 change: 1 addition & 0 deletions quickshell/Common/settings/SettingsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ var SPEC = {
matugenTemplateQtengine: { def: true },
matugenTemplateFirefox: { def: true },
matugenTemplatePywalfox: { def: true },
matugenTemplateSpicetify: { def: true },
matugenTemplateZenBrowser: { def: true },
matugenTemplateVesktop: { def: true },
matugenTemplateVencord: { def: true },
Expand Down
33 changes: 33 additions & 0 deletions quickshell/Modules/Settings/ThemeColorsTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,23 @@ Item {
return Theme.warning;
}

function restoreSpicetifyTheme() {
const statePath = SettingsData._configDir + "/DankMaterialShell/spicetify-theme";
const script = `if command -v spicetify >/dev/null 2>&1 && [ -e "${statePath}" ]; then
currentTheme=$(spicetify config current_theme)
if [ "$currentTheme" = DMS ]; then
theme=$(sed -n '1p' "${statePath}")
scheme=$(sed -n '2p' "${statePath}")
if spicetify config current_theme "$theme" color_scheme "$scheme" >/dev/null && spicetify -q apply --no-restart; then
rm -f "${statePath}"
fi
else
rm -f "${statePath}"
fi
fi`;
Proc.runCommand("restore-spicetify-theme", ["sh", "-c", script], () => {});
}

function openSurfaceBorderColorPicker() {
PopoutService.colorPickerModal.selectedColor = SettingsData.blurBorderCustomColor ?? "#ffffff";
PopoutService.colorPickerModal.pickerTitle = I18n.tr("Surface Border Color");
Expand Down Expand Up @@ -2690,6 +2707,22 @@ Item {
onToggled: checked => SettingsData.set("matugenTemplatePywalfox", checked)
}

SettingsToggleRow {
tab: "theme"
tags: ["matugen", "spicetify", "spotify", "template"]
settingKey: "matugenTemplateSpicetify"
text: "Spicetify"
description: getTemplateDescription("spicetify", I18n.tr("Restores the previous Spotify theme when disabled; reload Spotify after theme changes", "spicetify matugen template description"))
descriptionColor: getTemplateDescriptionColor("spicetify")
visible: SettingsData.runDmsMatugenTemplates
checked: SettingsData.matugenTemplateSpicetify
onToggled: checked => {
if (!checked)
restoreSpicetifyTheme();
SettingsData.set("matugenTemplateSpicetify", checked);
}
}

SettingsToggleRow {
tab: "theme"
tags: ["matugen", "zenbrowser", "template"]
Expand Down
4 changes: 4 additions & 0 deletions quickshell/matugen/configs/spicetify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[templates.dmspicetify]
input_path = 'SHELL_DIR/matugen/templates/spicetify.ini'
output_path = 'CONFIG_DIR/spicetify/Themes/DMS/color.ini'
post_hook = '''sh -c "if command -v spicetify >/dev/null 2>&1; then state='CONFIG_DIR/DankMaterialShell/spicetify-theme'; current_theme=\"$(spicetify config current_theme)\"; if [ \"$current_theme\" != DMS ] && [ ! -e \"$state\" ]; then mkdir -p \"$(dirname \"$state\")\"; printf '%s\\n%s\\n' \"$current_theme\" \"$(spicetify config color_scheme)\" > \"$state\"; fi; spicetify config current_theme DMS color_scheme dms >/dev/null && spicetify -q apply --no-restart; fi"'''
28 changes: 28 additions & 0 deletions quickshell/matugen/templates/spicetify.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[dms]
text = {{colors.on_surface.default.hex_stripped}}
subtext = {{colors.on_surface_variant.default.hex_stripped}}
main = {{colors.surface.default.hex_stripped}}
main-elevated = {{colors.surface_container.default.hex_stripped}}
main-transition = {{colors.surface_container_lowest.default.hex_stripped}}
highlight = {{colors.surface_container_high.default.hex_stripped}}
highlight-elevated = {{colors.surface_container_highest.default.hex_stripped}}
sidebar = {{colors.surface_container.default.hex_stripped}}
player = {{colors.surface_container.default.hex_stripped}}
card = {{colors.surface_container_high.default.hex_stripped}}
shadow = {{colors.shadow.default.hex_stripped}}
selected-row = {{colors.primary.default.hex_stripped}}
button = {{colors.primary.default.hex_stripped}}
button-active = {{colors.primary.default.hex_stripped}}
button-secondary = {{colors.on_surface_variant.default.hex_stripped}}
button-disabled = {{colors.outline_variant.default.hex_stripped}}
tab-active = {{colors.primary.default.hex_stripped}}
notification = {{colors.tertiary.default.hex_stripped}}
notification-error = {{colors.error_container.default.hex_stripped}}
misc = {{colors.secondary.default.hex_stripped}}
play-button = {{colors.secondary.default.hex_stripped}}
play-button-active = {{colors.secondary.default.hex_stripped}}
progress-fg = {{colors.primary.default.hex_stripped}}
progress-bg = {{colors.surface_container.default.hex_stripped}}
heart = {{colors.error.default.hex_stripped}}
pagelink-active = {{colors.on_tertiary_container.default.hex_stripped}}
radio-btn-active = {{colors.on_tertiary_container.default.hex_stripped}}
25 changes: 25 additions & 0 deletions quickshell/translations/settings_search_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4645,6 +4645,31 @@
"icon": "layers",
"description": "Material inspired shadows and elevation on modals, popouts, and dialogs"
},
{
"section": "matugenTemplateSpicetify",
"label": "Spicetify",
"tabIndex": 10,
"category": "Theme & Colors",
"keywords": [
"after",
"appearance",
"changes",
"colors",
"colour",
"look",
"matugen",
"previous",
"reload",
"restores",
"scheme",
"spicetify",
"spotify",
"style",
"template",
"theme"
],
"description": "Restores the previous Spotify theme when disabled; reload Spotify after theme changes"
},
{
"section": "blurBorderColor",
"label": "Surface Border Color",
Expand Down
Loading