Automatically make kitty toggle between light and dark themes to follow the theme you set. Just put it into autostart.
Last active
August 9, 2026 17:48
-
-
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 | |
| #set -x | |
| kitty_cmd=(kitty +kitten themes --cache-age -1 --reload-in all) | |
| changeTheme() { | |
| case "$1" in | |
| *dark* | *Dark* ) | |
| "${kitty_cmd[@]}" Tango Dark | |
| echo "-> dark" | |
| ;; | |
| * ) | |
| "${kitty_cmd[@]}" Tango Light | |
| echo "-> light" | |
| ;; | |
| esac | |
| } | |
| changeTheme "$(gsettings get org.x.apps.portal color-scheme)" | |
| IFS=$'\n' | |
| gsettings monitor org.x.apps.portal color-scheme | | |
| 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