Extend wallpaper theming to Zen, VSCodium, and GNOME accents
- Zen browser: generates userChrome.css with palette colors - VSCodium: merges workbench.colorCustomizations into settings.json - GNOME: maps palette hue to closest accent color preset - Add jq to GNOME packages for JSON merging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1ca92e96ba
commit
8359853fc9
5 changed files with 96 additions and 0 deletions
|
|
@ -48,6 +48,14 @@
|
|||
input_path = "${inputs.self}/templates/gtk4-colors.css"
|
||||
output_path = "${config.home.homeDirectory}/.config/gtk-4.0/colors.css"
|
||||
|
||||
[templates.zen]
|
||||
input_path = "${inputs.self}/templates/zen-userChrome.css"
|
||||
output_path = "${config.home.homeDirectory}/.zen/fraudek5.Default Profile/chrome/userChrome.css"
|
||||
|
||||
[templates.vscodium]
|
||||
input_path = "${inputs.self}/templates/vscodium-colors.json"
|
||||
output_path = "${config.home.homeDirectory}/.local/share/matugen/vscodium-colors.json"
|
||||
|
||||
[templates.recolor-folders]
|
||||
input_path = "${inputs.self}/templates/recolor-folders.sh"
|
||||
output_path = "${config.home.homeDirectory}/.local/share/matugen/recolor-folders.sh"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
papirus-icon-theme
|
||||
adw-gtk3
|
||||
matugen
|
||||
jq
|
||||
];
|
||||
|
||||
# Set cursor theme
|
||||
|
|
|
|||
|
|
@ -87,3 +87,52 @@ done
|
|||
|
||||
# Update icon cache
|
||||
gtk-update-icon-cache -f "$ICON_DIR" 2>/dev/null || true
|
||||
|
||||
# Map wallpaper palette to closest GNOME accent color
|
||||
# Primary color RGB: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}}
|
||||
R={{colors.primary.default.red}}
|
||||
G={{colors.primary.default.green}}
|
||||
B={{colors.primary.default.blue}}
|
||||
|
||||
# Simple hue-based mapping to GNOME accent presets
|
||||
if [ "$R" -gt "$G" ] && [ "$R" -gt "$B" ]; then
|
||||
if [ "$B" -gt "$((G + 30))" ]; then
|
||||
ACCENT="purple"
|
||||
elif [ "$G" -gt "$((R / 2))" ]; then
|
||||
ACCENT="orange"
|
||||
else
|
||||
if [ "$B" -gt "$((R / 3))" ]; then
|
||||
ACCENT="pink"
|
||||
else
|
||||
ACCENT="red"
|
||||
fi
|
||||
fi
|
||||
elif [ "$G" -gt "$R" ] && [ "$G" -gt "$B" ]; then
|
||||
if [ "$B" -gt "$((R + 20))" ]; then
|
||||
ACCENT="teal"
|
||||
else
|
||||
ACCENT="green"
|
||||
fi
|
||||
elif [ "$B" -gt "$R" ] && [ "$B" -gt "$G" ]; then
|
||||
if [ "$R" -gt "$((B / 2))" ]; then
|
||||
ACCENT="purple"
|
||||
else
|
||||
ACCENT="blue"
|
||||
fi
|
||||
else
|
||||
ACCENT="slate"
|
||||
fi
|
||||
|
||||
gsettings set org.gnome.desktop.interface accent-color "$ACCENT"
|
||||
|
||||
# Merge VSCodium color customizations into settings.json
|
||||
VSCODE_SETTINGS="$HOME/.config/VSCodium/User/settings.json"
|
||||
VSCODE_COLORS="$HOME/.local/share/matugen/vscodium-colors.json"
|
||||
if [ -f "$VSCODE_SETTINGS" ] && [ -f "$VSCODE_COLORS" ]; then
|
||||
COLORS=$(cat "$VSCODE_COLORS")
|
||||
# Remove existing workbench.colorCustomizations and merge new ones
|
||||
TMP=$(mktemp)
|
||||
if command -v jq &>/dev/null; then
|
||||
jq --argjson colors "$COLORS" '. * $colors' "$VSCODE_SETTINGS" > "$TMP" && mv "$TMP" "$VSCODE_SETTINGS"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
27
templates/vscodium-colors.json
Normal file
27
templates/vscodium-colors.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"workbench.colorCustomizations": {
|
||||
"titleBar.activeBackground": "{{colors.surface_container.default.hex}}",
|
||||
"titleBar.activeForeground": "{{colors.on_surface.default.hex}}",
|
||||
"titleBar.inactiveBackground": "{{colors.surface_container_low.default.hex}}",
|
||||
"activityBar.background": "{{colors.surface_container.default.hex}}",
|
||||
"activityBar.foreground": "{{colors.on_surface.default.hex}}",
|
||||
"sideBar.background": "{{colors.surface_container_low.default.hex}}",
|
||||
"sideBar.foreground": "{{colors.on_surface.default.hex}}",
|
||||
"editor.background": "{{colors.surface.default.hex}}",
|
||||
"editor.foreground": "{{colors.on_surface.default.hex}}",
|
||||
"statusBar.background": "{{colors.surface_container.default.hex}}",
|
||||
"statusBar.foreground": "{{colors.on_surface.default.hex}}",
|
||||
"tab.activeBackground": "{{colors.surface.default.hex}}",
|
||||
"tab.inactiveBackground": "{{colors.surface_container.default.hex}}",
|
||||
"tab.activeForeground": "{{colors.on_surface.default.hex}}",
|
||||
"focusBorder": "{{colors.primary.default.hex}}",
|
||||
"button.background": "{{colors.primary.default.hex}}",
|
||||
"button.foreground": "{{colors.on_primary.default.hex}}",
|
||||
"list.activeSelectionBackground": "{{colors.primary_container.default.hex}}",
|
||||
"list.activeSelectionForeground": "{{colors.on_primary_container.default.hex}}",
|
||||
"list.hoverBackground": "{{colors.surface_container_high.default.hex}}",
|
||||
"terminal.background": "{{colors.surface.default.hex}}",
|
||||
"terminal.foreground": "{{colors.on_surface.default.hex}}",
|
||||
"panel.background": "{{colors.surface_container_low.default.hex}}"
|
||||
}
|
||||
}
|
||||
11
templates/zen-userChrome.css
Normal file
11
templates/zen-userChrome.css
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* Wallpaper-based colors generated by matugen */
|
||||
:root {
|
||||
--zen-primary-color: {{colors.primary.default.hex}} !important;
|
||||
--zen-colors-primary: {{colors.primary.default.hex}} !important;
|
||||
--zen-colors-secondary: {{colors.secondary.default.hex}} !important;
|
||||
--zen-colors-tertiary: {{colors.tertiary.default.hex}} !important;
|
||||
--zen-colors-border: {{colors.outline_variant.default.hex}} !important;
|
||||
--toolbar-bgcolor: {{colors.surface.default.hex}} !important;
|
||||
--lwt-accent-color: {{colors.surface_container.default.hex}} !important;
|
||||
--lwt-text-color: {{colors.on_surface.default.hex}} !important;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue