From b9379384512f40491236c6187dbc72bc8a23d513 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 7 Sep 2023 19:21:19 +0200 Subject: darwin: auto-toggle dark/light mode in kitty --- user/settings/darwin.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'user/settings') 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 '' ) ) -- cgit 1.4.1