summary refs log tree commit diff stats
path: root/user/settings
diff options
context:
space:
mode:
authorAlan Pearce2023-09-07 19:21:19 +0200
committerAlan Pearce2023-09-07 19:21:19 +0200
commitb9379384512f40491236c6187dbc72bc8a23d513 (patch)
tree7a496ff5d1ea01381fd3732b835829e3c4b38336 /user/settings
parent32977f82f79baa6b632ca710f2f87d62bc28c46e (diff)
downloadnixfiles-b9379384512f40491236c6187dbc72bc8a23d513.tar.lz
nixfiles-b9379384512f40491236c6187dbc72bc8a23d513.tar.zst
nixfiles-b9379384512f40491236c6187dbc72bc8a23d513.zip
darwin: auto-toggle dark/light mode in kitty
Diffstat (limited to 'user/settings')
-rw-r--r--user/settings/darwin.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/user/settings/darwin.nix b/user/settings/darwin.nix
index f8665ac5..7037ddf9 100644
--- a/user/settings/darwin.nix
+++ b/user/settings/darwin.nix
@@ -77,6 +77,7 @@
                       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 @@
                         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
                   ''
               )
           )