scheme: set gtk light/dark mode when dynamic

This commit is contained in:
2 * r + 2 * t
2025-01-29 18:48:14 +11:00
parent 5118c8da96
commit 02f5c18d32
+9 -1
View File
@@ -17,7 +17,15 @@ set -l layer_names text subtext1 subtext0 overlay2 overlay1 overlay0 surface2 su
test -f "$argv[1]" && set -l img "$argv[1]" || set -l img $CACHE/wallpaper/current
set -l img ($src/resizeimg.py $img)
$src/islight.py $img && set -l light_vals 40,6,8,10,45,50,55,60,65,70,75,80,85,90 || set -l light_vals 70,90,75,65,40,35,30,25,20,15,10,8,6
if $src/islight.py $img
set light_vals 40,6,8,10,45,50,55,60,65,70,75,80,85,90
set colour_scheme light
else
set light_vals 70,90,75,65,40,35,30,25,20,15,10,8,6
set colour_scheme dark
end
test "$(cat $CACHE/scheme/current.txt)" = dynamic && gsettings set org.gnome.desktop.interface color-scheme \'prefer-$colour_scheme\'
set -l colours_raw (okolors (realpath $img) -k 15 -w 0 -l $light_vals)
set -l colours (string split ' ' $colours_raw[2])[2..]