-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhammerspoon.lua
More file actions
60 lines (50 loc) · 1.86 KB
/
Copy pathhammerspoon.lua
File metadata and controls
60 lines (50 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
local shortcuts = require('hammerspoon.shortcuts')
local notifications = require('hammerspoon.notifications')
local chrome = require('hammerspoon.chrome')
-- special tasks needed after switching to certain apps
-- go to tab with Jira or open a new one
function after_jira()
chrome.switch_tab("SDP.boards.11163")
end
-- go to tab with Jira or open a new one
function after_tab()
hs.eventtap.keyStroke({"cmd", "shift"}, "a") -- to open tab selection
end
-- keyboard keys to be used in mission control and the program/window to open
-- the name of the app should be the names found in Applications folder
key_params = {
["b"] = "Google Chrome";
["p"] = {["app"] = "Google Chrome", ["after"]=after_jira};
["."] = {["app"] = "Google Chrome", ["modifiers"] = {"cmd"}, ["after"]=after_tab};
["c"] = "Google Calendar";
["f"] = "Firefox";
["g"] = "Gmail";
["s"] = "Slack";
["t"] = "Obsidian";
["x"] = "KeepassXC";
["z"] = "zoom.us";
["m"] = "Spotify";
["space"] = "iTerm"
}
shortcuts.assign_app_shortcuts({"cmd", "alt"}, key_params)
-- Window Management
hs.hotkey.bind({"cmd", "alt"}, "h", nil, function()
hs.window.focusedWindow():focusWindowWest()
end)
hs.hotkey.bind({"cmd", "alt"}, "j", nil, function()
hs.window.focusedWindow():focusWindowSouth()
end)
hs.hotkey.bind({"cmd", "alt"}, "k", nil, function()
hs.window.focusedWindow():focusWindowNorth()
end)
hs.hotkey.bind({"cmd", "alt"}, "l", nil, function()
hs.window.focusedWindow():focusWindowEast()
end)
-- Notifications
-- open -g "hammerspoon://show_notification?title=Pay Attenttion&text=I just finished this long proccess"
-- the title and text are optional parameters
hs.urlevent.bind("show_notification",
function(eventName, params)
notifications.send_notification(params["title"], params["text"])
end
)