diff --git a/hosts/daedalus/default.nix b/hosts/daedalus/default.nix index 074d5bc5..67b67469 100644 --- a/hosts/daedalus/default.nix +++ b/hosts/daedalus/default.nix @@ -100,32 +100,32 @@ in google-cloud-sdk ]; - home.activation = { - aliasApplications = - let - apps = pkgs.buildEnv { - name = "home-manager-applications"; - paths = config.home.packages; - pathsToLink = "/Applications"; - }; - in - lib.hm.dag.entryAfter [ "writeBoundary" ] '' - # Install MacOS applications to the user environment. - HM_APPS="$HOME/Applications/Home Manager Apps" + # home.activation = { + # aliasApplications = + # let + # apps = pkgs.buildEnv { + # name = "home-manager-applications"; + # paths = config.home.packages; + # pathsToLink = "/Applications"; + # }; + # in + # lib.hm.dag.entryAfter [ "writeBoundary" ] '' + # # Install MacOS applications to the user environment. + # HM_APPS="$HOME/Applications/Home Manager Apps" - # Reset current state - [ -e "$HM_APPS" ] && $DRY_RUN_CMD rm -r "$HM_APPS" - $DRY_RUN_CMD mkdir -p "$HM_APPS" + # # Reset current state + # [ -e "$HM_APPS" ] && $DRY_RUN_CMD rm -r "$HM_APPS" + # $DRY_RUN_CMD mkdir -p "$HM_APPS" - # .app dirs need to be actual directories for Finder to detect them as Apps. - # The files inside them can be symlinks though. - $DRY_RUN_CMD cp --recursive --symbolic-link --no-preserve=mode -H ${apps}/Applications/* "$HM_APPS" || true # can fail if no apps exist - # Modes need to be stripped because otherwise the dirs wouldn't have +w, - # preventing us from deleting them again - # In the env of Apps we build, the .apps are symlinks. We pass all of them as - # arguments to cp and make it dereference those using -H - ''; - }; + # # .app dirs need to be actual directories for Finder to detect them as Apps. + # # The files inside them can be symlinks though. + # $DRY_RUN_CMD cp --recursive --symbolic-link --no-preserve=mode -H ${apps}/Applications/* "$HM_APPS" || true # can fail if no apps exist + # # Modes need to be stripped because otherwise the dirs wouldn't have +w, + # # preventing us from deleting them again + # # In the env of Apps we build, the .apps are symlinks. We pass all of them as + # # arguments to cp and make it dereference those using -H + # ''; + # }; }; diff --git a/hosts/daedalus/hammerspoon.lua b/hosts/daedalus/hammerspoon.lua index 3a48bf83..aa668c64 100644 --- a/hosts/daedalus/hammerspoon.lua +++ b/hosts/daedalus/hammerspoon.lua @@ -475,22 +475,33 @@ hs.hotkey.bind(modifiers.window, "f", facileCaptpure) ---------------------------------------------------------------------------------------------------- local notmuchTaskRunning = false -local function refreshNotmuchMenubar() +local function refreshNotmuchMenubar(currentlyRunning) hs.task.new("@notmuchMails@", function(exitCode, stdout, stderr) + if currentlyRunning then + stdout = "R: " .. stdout + end print(stdout) notmuchMenubar:setTitle(hs.styledtext.new(stdout)) end):start() end -notmuchMenubar = hs.menubar.new() -notmuchMenubar:setClickCallback(function() hs.task.new("@myEmacs@/bin/emacsclient", nil, function() return false end, - { "-a", "", "--eval", "(=notmuch)" }):start() -end) -notmuchTimer = hs.timer.doEvery(300, function() +local function notmuchTimerFunction() if not notmuchTaskRunning then + refreshNotmuchMenubar(true) notmuchTaskRunning = true hs.task.new("/etc/profiles/per-user/ragon/bin/zsh", - function() notmuchTaskRunning = false; refreshNotmuchMenubar() end, + function() notmuchTaskRunning = false; refreshNotmuchMenubar(false) end, function() return false end, { "-c", "syncmail" }):start() end +end + +notmuchMenubar = hs.menubar.new() +notmuchMenubar:setClickCallback(function(options) + if options.shift then + notmuchTimerFunction() + else + hs.task.new("@myEmacs@/bin/emacsclient", nil, function() return false end, + { "-c", "-a", "", "--eval", "(=notmuch)" }):start() + end end) +notmuchTimer = hs.timer.doEvery(300, notmuchTimerFunction)