diff options
Diffstat (limited to 'user')
-rw-r--r-- | user/settings/darwin.nix | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/user/settings/darwin.nix b/user/settings/darwin.nix index c79fb155..6571e6d8 100644 --- a/user/settings/darwin.nix +++ b/user/settings/darwin.nix @@ -65,29 +65,29 @@ pkgs.writeShellScript "toggle-dark-light-mode" ( - '' - wait4path /nix - if defaults read -g AppleInterfaceStyle &>/dev/null ; then - MODE="dark" - else - MODE="light" - fi - emacsclient="${config.programs.emacs.finalPackage}/bin/emacsclient" - emacsSwitchTheme () { - if pgrep -q Emacs; then - if [[ $MODE == "dark" ]]; then - $emacsclient \ - --eval "(stimmung-themes-load-dark)" \ - --eval "(modify-all-frames-parameters '((ns-appearance '$MODE)))" - elif [[ $MODE == "light" ]]; then - $emacsclient \ - --eval "(stimmung-themes-load-light)" \ - --eval "(modify-all-frames-parameters '((ns-appearance '$MODE)))" - fi + '' + wait4path /nix + if defaults read -g AppleInterfaceStyle &>/dev/null ; then + MODE="dark" + else + MODE="light" fi - } - emacsSwitchTheme - '' + emacsclient="${config.programs.emacs.finalPackage}/bin/emacsclient" + emacsSwitchTheme () { + if pgrep -q Emacs; then + if [[ $MODE == "dark" ]]; then + $emacsclient \ + --eval "(stimmung-themes-load-dark)" \ + --eval "(modify-all-frames-parameters '((ns-appearance '$MODE)))" + elif [[ $MODE == "light" ]]; then + $emacsclient \ + --eval "(stimmung-themes-load-light)" \ + --eval "(modify-all-frames-parameters '((ns-appearance '$MODE)))" + fi + fi + } + emacsSwitchTheme + '' ) ) ) |