Files
.dotfiles/hammerspoon/.hammerspoon/init.lua
T
Tri Vo Khac 6d5b84db51 feat(hammerspoon): show app name on focus and command key
Extract window highlighting into a dedicated module and centralize shared
configuration. Add a configurable app name toast triggered by focus changes
and Command key presses.
2026-07-15 13:19:49 +07:00

30 lines
791 B
Lua

-- Reload: Hammerspoon menu -> Reload Config
local config = require("config")
local AppNameToast = require("modules.app_name_toast")
local WindowHighlight = require("modules.window_highlight")
local appNameToast = AppNameToast.new(config.appNameToast)
local windowHighlight = WindowHighlight.new(config.windowHighlight, {
onWindowFocused = function()
if config.appNameToast.showOnFocus then
appNameToast:show()
end
end,
})
appNameToast:setShouldShow(function()
return not windowHighlight:isMissionControlActive()
end)
appNameToast:start()
windowHighlight:start()
-- Keep module state and watchers alive until the next reload.
_G.hammerspoonModules = {
appNameToast = appNameToast,
windowHighlight = windowHighlight,
}
hs.alert.show("Hammerspoon config loaded")