all repos — dot @ b3108c1548240674a000795d5340293d1adf4122

Shell, editor and terminal configuration, and the tools that go with them

hammerspoon: load ~/.config/hammerspoon/local.lua where a machine has one

The shell has ~/.localprofile and ssh and git their config-local; Hammerspoon
had nothing, so a machine wanting one different hotkey had to edit the file
every machine shares. Only init.lua is linked, so the directory around it is
already the machine's own -- a sibling file there is in no repo.

Loaded last, so it can override anything above, and through pcall: a mistake
in a local file must not take the rest of the config down. Reload with
ctrl-shift-alt-h as usual.
Igor Soarez igor@soarez.org
Mon, 21 Sep 2026 15:51:53 +0300
commit

b3108c1548240674a000795d5340293d1adf4122

parent

d312cb2acca4cff77c82ea4467585e0a2814c47c

1 files changed, 20 insertions(+), 0 deletions(-)

jump to
M config/hammerspoon/init.lua → config/hammerspoon/init.lua

@@ -584,3 +584,23 @@ -- hotkey('5', csa, demo_dump('/tmp/screencast5.txt'))

-- hotkey('6', csa, demo_dump('/tmp/screencast6.txt')) -- hotkey('7', csa, demo_dump('/tmp/screencast7.txt')) -- hotkey('8', csa, demo_dump('/tmp/screencast8.txt')) + +-- Machine-local Hammerspoon config, where a machine has any: +-- ~/.config/hammerspoon/local.lua, a real file beside the init.lua link and in +-- no repo, like ~/.localprofile for the shell. Only init.lua is linked, so that +-- directory is the machine's own and anything else in it stays there. +-- +-- Last, so it can override the hotkeys and settings above, and in a pcall: a +-- mistake in it must not take the rest of this config down with it. Reload with +-- ctrl-shift-alt-h, the same as any other change here. +local local_config = os.getenv("HOME") .. "/.config/hammerspoon/local.lua" +if hs.fs.attributes(local_config) then + local ok, err = pcall(dofile, local_config) + if not ok then + print("local.lua: " .. tostring(err)) + hs.notify.new({ + title = "Hammerspoon", + informativeText = "local.lua failed: " .. tostring(err), + }):send() + end +end