scheme: gtk theming

Via adw-gtk3 theme
This commit is contained in:
2 * r + 2 * t
2025-01-26 21:22:12 +11:00
parent fa2822f636
commit 125860de28
3 changed files with 62 additions and 5 deletions
+40
View File
@@ -0,0 +1,40 @@
@define-color window_bg_color $base; /* The main background color used on GtkWindow */
@define-color window_fg_color $text; /* The main foreground text color */
@define-color view_bg_color $surface0; /* A secondary background color used in icon views, text fields, etc */
@define-color view_fg_color $text; /* Secondary foreground text color */
@define-color accent_bg_color $overlay1; /* Color to indicate that a widget is important, interactive, or currently active */
@define-color accent_fg_color $text; /* Color for text over widgets using accent_bg_color */
@define-color accent_color $overlay1; /* Mostly used for text labels. Can be the same as accent_bg_color */
@define-color headerbar_bg_color $base; /* The headerbar background */
@define-color headerbar_fg_color $text; /* The headerbar foreground text color */
@define-color headerbar_backdrop_color $base; /* The headerbar backdrop state background */
@define-color headerbar_border_color $surface1; /* Currently not used in adw-gtk3 */
@define-color headerbar_shade_color $surface1; /* The bottom border of the headerbar */
@define-color card_bg_color $base; /* The background color of lists */
@define-color card_fg_color $text; /* The text color on libhandy lists */
@define-color card_shade_color $surface1; /* List borders */
@define-color popover_bg_color $surface0; /* The background color of popovers and menus */
@define-color popover_fg_color $text; /* The text color on popovers */
@define-color dialog_bg_color $base; /* The background color of message dialogs */
@define-color dialog_fg_color $text; /* The foreground color of message dialogs */
@define-color sidebar_bg_color $base; /* Sidebar background color */
@define-color sidebar_fg_color $text; /* Sidebar foreground color */
@define-color sidebar_backdrop_color $base; /* Sidebar backdrop background color */
@define-color sidebar_shade_color $surface1; /* Sidebar shade color */
@define-color warning_bg_color $surface1; /* Background for widgets and elements that show a warning */
@define-color warning_fg_color $yellow; /* Foreground for widgets and elements that show a warning */
@define-color warning_color $surface1; /* Warning text label */
@define-color error_bg_color $surface1; /* Background for widgets and elements that show an error */
@define-color error_fg_color $red; /* Foreground for widgets and elements that show an error */
@define-color error_color $surface1; /* Error text label */
@define-color success_bg_color $surface1; /* Background for widgets and elements that show a successful action */
@define-color success_fg_color $green; /* Foreground for widgets and elements that show a successful action */
@define-color success_color $surface1; /* Success text label */
@define-color destructive_bg_color $surface1; /* The destructive color indicates a dangerous action, such as deleting a file */
@define-color destructive_fg_color $red; /* Destructive foreground color */
@define-color destructive_color $surface1; /* Destructive text label */
/* Custom colors (GTK3 only) */
@define-color panel_bg_color $base; /* Background for XFCE4 panel */
@define-color panel_fg_color $text; /* Foreground for XFCE4 panel */
+4 -1
View File
@@ -33,7 +33,10 @@ end
if test "$argv[1]" = scheme if test "$argv[1]" = scheme
set -l valid_schemes dynamic mocha macchiato frappe latte set -l valid_schemes dynamic mocha macchiato frappe latte
contains "$argv[2]" $valid_schemes && echo -n $argv[2] > $CACHE/scheme/current.txt || error "Invalid scheme: $argv[2]" if contains "$argv[2]" $valid_schemes
echo -n $argv[2] > $CACHE/scheme/current.txt || error "Invalid scheme: $argv[2]"
test -f $CONFIG/gtk/update-scheme.fish && $CONFIG/gtk/update-scheme.fish
end
exit exit
end end
+18 -4
View File
@@ -31,27 +31,35 @@ function gen-ini -a program
end end
end end
function gen-gtk
cp (dirname (status filename))/../data/gtk.template $CONFIG/gtk/schemes/dynamic.css
for colour in $argv
set -l split (string split ' ' $colour)
sed -i "s/\$$split[1]/#$split[2]/g" $CONFIG/gtk/schemes/dynamic.css
end
end
. (dirname (status filename))/../util.fish . (dirname (status filename))/../util.fish
set -l src (dirname (status filename)) set -l src (dirname (status filename))
set -l colours ($src/gen-scheme.fish $argv[1]) set -l colours ($src/gen-scheme.fish $argv[1])
if test -d $CONFIG/hypr/scheme if test -d $CONFIG/hypr
log 'Generating hypr scheme' log 'Generating hypr scheme'
gen-hypr $colours > $CONFIG/hypr/scheme/dynamic.conf gen-hypr $colours > $CONFIG/hypr/scheme/dynamic.conf
end end
if test -d $CONFIG/shell/scss/scheme if test -d $CONFIG/shell
log 'Generating shell scheme' log 'Generating shell scheme'
gen-scss $colours > $CONFIG/shell/scss/scheme/_dynamic.scss gen-scss $colours > $CONFIG/shell/scss/scheme/_dynamic.scss
end end
if test -d $CONFIG/safeeyes/scheme if test -d $CONFIG/safeeyes
log 'Generating SafeEyes scheme' log 'Generating SafeEyes scheme'
gen-scss $colours > $CONFIG/safeeyes/scheme/_dynamic.scss gen-scss $colours > $CONFIG/safeeyes/scheme/_dynamic.scss
end end
if test -d $CONFIG/discord/dynamic && test -d $CONFIG/discord/themes if test -d $CONFIG/discord
log 'Generating discord scheme' log 'Generating discord scheme'
gen-scss $colours > $CONFIG/discord/dynamic/_variables.scss gen-scss $colours > $CONFIG/discord/dynamic/_variables.scss
gen-scss-palette $colours >> $CONFIG/discord/dynamic/_variables.scss gen-scss-palette $colours >> $CONFIG/discord/dynamic/_variables.scss
@@ -68,6 +76,12 @@ if test -d $CONFIG/../fuzzel/schemes
gen-ini fuzzel $colours gen-ini fuzzel $colours
end end
if test -d $CONFIG/gtk
log 'Generating GTK+ schemes'
gen-gtk $colours
$CONFIG/gtk/update-scheme.fish
end
# Reload programs if dynamic scheme # Reload programs if dynamic scheme
if test -f $CACHE/scheme/current.txt -a "$(cat $CACHE/scheme/current.txt)" = 'dynamic' if test -f $CACHE/scheme/current.txt -a "$(cat $CACHE/scheme/current.txt)" = 'dynamic'
caelestia scheme dynamic caelestia scheme dynamic