forked from agzam/spacehammer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapps.fnl
36 lines (30 loc) · 1.04 KB
/
apps.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
33
34
35
36
(local windows (require :windows))
(local multimedia (require :multimedia))
(local slack (require :slack))
(fn add-state [modal]
(modal.add-state
:apps
{:from :*
:init (fn [self fsm]
(set self.hotkeyModal (hs.hotkey.modal.new))
(modal.display-modal-text
"e\t emacs\ng \t chrome\n f\t Firefox\n i\t iTerm\n s\t slack\n b\t brave")
(modal.bind
self
[:cmd] :space
(fn [] (: fsm :toMain)))
(slack.bind self.hotkeyModal fsm)
(each [key app (pairs
{:i "iTerm2"
:g "Google Chrome"
:b "Brave"
:e "Emacs"
:f "Firefox"
:m multimedia.music-app})]
(modal.bind
self nil key
(fn []
(: fsm :toIdle)
(windows.activate-app app))))
(: self.hotkeyModal :enter))}))
{:add-state add-state}