-
Notifications
You must be signed in to change notification settings - Fork 71
/
chrome.fnl
32 lines (28 loc) · 854 Bytes
/
chrome.fnl
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
(require-macros :lib.macros)
;; setting conflicting Cmd+L (jump to address bar) keybinding to Cmd+Shift+L
(fn open-location
[]
"
Activate the Chrome > File > Open Location... action which moves focus to the
address\\search bar.
Returns nil
"
(when-let [app (: (hs.window.focusedWindow) :application)]
(: app :selectMenuItem ["File" "Open Location…"])))
(fn prev-tab
[]
"
Send the key stroke cmd+shift+[ to move to the previous tab.
This shortcut is shared by a lot of apps in addition to Chrome!.
"
(hs.eventtap.keyStroke [:cmd :shift] "["))
(fn next-tab
[]
"
Send the key stroke cmd+shift+] to move to the next tab.
This shortcut is shared by a lot of apps in addition to Chrome!.
"
(hs.eventtap.keyStroke [:cmd :shift] "]"))
{:open-location open-location
:prev-tab prev-tab
:next-tab next-tab}