Automatically make kitty toggle between light and dark themes to follow the theme you set. Just put it into autostart.
Last active
September 7, 2024 15:56
-
-
Save binarynoise/492f243cdcb8902f85509fb47629802d to your computer and use it in GitHub Desktop.
Kitty Theme Listener
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
IFS=$'\n' | |
changeTheme() { | |
case "$1" in | |
*dark*) | |
kitty +kitten themes --reload-in all Tango Dark | |
;; | |
*light* | *default*) | |
kitty +kitten themes --reload-in all Tango Light | |
;; | |
esac | |
} | |
changeTheme "$(dconf read /org/x/apps/portal/color-scheme)" | |
dconf watch /org/x/apps/portal/color-scheme | | |
grep --line-buffered -ve '/org/x/apps/portal/color-scheme' -e '^\s*$' | | |
while read -r line; do | |
changeTheme "$line" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment