notmuch indicator tuning
This commit is contained in:
parent
42ddb294ef
commit
89fdc7570e
2 changed files with 42 additions and 31 deletions
|
|
@ -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
|
||||
# '';
|
||||
# };
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue