-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan Steinke
committed
May 29, 2024
1 parent
6800f51
commit 460a7ba
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- focus apps | ||
local apps = { | ||
{ "k", "Kitty" }, | ||
{ "s", "Safari" }, | ||
} | ||
for _, item in ipairs(apps) do | ||
local shortcut = item[1] | ||
local name = item[2] | ||
hs.hotkey.bind({ "cmd", "ctrl", "alt" }, shortcut, name, function() | ||
hs.application.launchOrFocus(name) | ||
end) | ||
end | ||
|
||
-- Reload the Hammerspoon configuration | ||
local reloadConfig = function(files) | ||
local doReload = false | ||
for _, file in pairs(files) do | ||
if file:sub(-4) == ".lua" then | ||
doReload = true | ||
end | ||
end | ||
if doReload then | ||
hs.reload() | ||
end | ||
end | ||
|
||
ConfigReloadWatcher = hs.pathwatcher.new(hs.configdir, reloadConfig):start() | ||
hs.alert.show("Config loaded") |