Skip to content

Instantly share code, notes, and snippets.

@binarynoise
Last active August 9, 2026 17:48
Show Gist options
  • Select an option

  • Save binarynoise/492f243cdcb8902f85509fb47629802d to your computer and use it in GitHub Desktop.

Select an option

Save binarynoise/492f243cdcb8902f85509fb47629802d to your computer and use it in GitHub Desktop.
Kitty Theme Listener
#!/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

Automatically make kitty toggle between light and dark themes to follow the theme you set. Just put it into autostart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment