summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/gtk.template40
-rwxr-xr-xmain.fish5
-rwxr-xr-xscheme/apply-scheme.fish22
3 files changed, 62 insertions, 5 deletions
diff --git a/data/gtk.template b/data/gtk.template
new file mode 100644
index 0000000..1206f1d
--- /dev/null
+++ b/data/gtk.template
@@ -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 */
diff --git a/main.fish b/main.fish
index 382d2ea..81543b1 100755
--- a/main.fish
+++ b/main.fish
@@ -33,7 +33,10 @@ end
if test "$argv[1]" = scheme
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
end
diff --git a/scheme/apply-scheme.fish b/scheme/apply-scheme.fish
index e9d11d9..aff4275 100755
--- a/scheme/apply-scheme.fish
+++ b/scheme/apply-scheme.fish
@@ -31,27 +31,35 @@ function gen-ini -a program
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
set -l src (dirname (status filename))
set -l colours ($src/gen-scheme.fish $argv[1])
-if test -d $CONFIG/hypr/scheme
+if test -d $CONFIG/hypr
log 'Generating hypr scheme'
gen-hypr $colours > $CONFIG/hypr/scheme/dynamic.conf
end
-if test -d $CONFIG/shell/scss/scheme
+if test -d $CONFIG/shell
log 'Generating shell scheme'
gen-scss $colours > $CONFIG/shell/scss/scheme/_dynamic.scss
end
-if test -d $CONFIG/safeeyes/scheme
+if test -d $CONFIG/safeeyes
log 'Generating SafeEyes scheme'
gen-scss $colours > $CONFIG/safeeyes/scheme/_dynamic.scss
end
-if test -d $CONFIG/discord/dynamic && test -d $CONFIG/discord/themes
+if test -d $CONFIG/discord
log 'Generating discord scheme'
gen-scss $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
end
+if test -d $CONFIG/gtk
+ log 'Generating GTK+ schemes'
+ gen-gtk $colours
+ $CONFIG/gtk/update-scheme.fish
+end
+
# Reload programs if dynamic scheme
if test -f $CACHE/scheme/current.txt -a "$(cat $CACHE/scheme/current.txt)" = 'dynamic'
caelestia scheme dynamic