all repos — nixfiles @ afc5b101c15faa2e2759e8c11fbdf5c17d0008d8

System and user configuration, managed by nix and home-manager

darwin: fix auto-dark-light-mode not changing emacs theme

Alan Pearce
commit

afc5b101c15faa2e2759e8c11fbdf5c17d0008d8

parent

f83da46fdc6558f072b6cbadc58eb8e1e8775a79

1 file changed, 10 insertions(+), 2 deletions(-)

changed files
M user/settings/darwin.nixuser/settings/darwin.nix
@@ -82,6 +82,10 @@ dark-light-mode = {
enable = true; config = { WatchPaths = [ "${config.home.homeDirectory}/Library/Preferences/.GlobalPreferences.plist" ]; + StandardOutputPath = "/dev/null"; + StandardErrorPath = "/dev/null"; + RunAtLoad = true; + KeepAlive = false; ProgramArguments = [ "/bin/sh" (
@@ -90,17 +94,21 @@ (
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 "(modus-themes-load-theme (cadr modus-themes-to-toggle))" + $emacsclient --eval "(modus-themes-load-theme (cadr modus-themes-to-toggle))" \ + --eval "(modify-all-frames-parameters '((ns-appearance '$MODE)))" elif [[ $MODE == "light" ]]; then - emacsclient --eval "(modus-themes-load-theme (car modus-themes-to-toggle))" + $emacsclient --eval "(modus-themes-load-theme (car modus-themes-to-toggle))" \ + --eval "(modify-all-frames-parameters '((ns-appearance '$MODE)))" fi fi }