darwin: auto-toggle dark/light mode in kitty
Alan Pearce alan@alanpearce.eu
Thu, 07 Sep 2023 19:21:19 +0200
1 files changed, 12 insertions(+), 1 deletions(-)
jump to
M user/settings/darwin.nix → user/settings/darwin.nix
@@ -77,6 +77,7 @@ else MODE="light" fi emacsclient="${config.programs.emacs.finalPackage}/bin/emacsclient" + kitty="${pkgs.kitty}/bin/kitty +kitten themes --reload-in=all --cache-age=-1" emacsSwitchTheme () { if pgrep -q Emacs; then if [[ $MODE == "dark" ]]; then @@ -90,7 +91,17 @@ --eval "(modify-all-frames-parameters '((ns-appearance '$MODE)))" fi fi } - emacsSwitchTheme $@ + kittySwitchTheme () { + if pgrep -q kitty; then + if [[ $MODE == "dark" ]]; then + $kitty 'Alabaster Dark' + elif [[ $MODE == "light" ]]; then + $kitty 'Alabaster' + fi + fi + } + emacsSwitchTheme + kittySwitchTheme '' ) )