-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathslack.py
76 lines (65 loc) · 2.37 KB
/
slack.py
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from talon.voice import Context, Key
ctx = Context('slack', bundle='com.tinyspeck.slackmacgap')
keymap = {
# Channel
'channel': Key('cmd-k'),
'channel last': Key('alt-up'),
'[channel] unread last': Key('alt-shift-up'),
'channel next': Key('alt-down'),
'[channel] unread next': Key('alt-shift-down'),
'[channel] info': Key('cmd-shift-i'),
# Navigation
'move focus': Key('ctrl-`'),
'next section': Key('f6'),
'previous section': Key('shift-f6'),
'page up': Key('pageup'),
'page down': Key('pagedown'),
'(open | collapse) right pane': Key('cmd-.'),
'direct messages': Key('cmd-shift-k'),
'threads': Key('cmd-shift-t'),
'(history [next] | back | backward)': Key('cmd-['),
'(back to the future | ford | forward)': Key('cmd-]'),
'next element': Key('tab'),
'previous element': Key('shift-tab'),
'(my stuff | activity)': Key('cmd-shift-m'),
'directory': Key('cmd-shift-e'),
'(starred [items] | stars)': Key('cmd-shift-s'),
'unread [messages]': Key('cmd-j'),
'top': Key('cmd-up'),
'bottom': Key('cmd-down'),
'(go | undo | toggle) full': Key('ctrl-cmd-f'),
# Messaging
'grab left': Key('shift-up'),
'grab right': Key('shift-down'),
'add line': Key('shift-enter'),
'(slaw | slapper)': [Key('cmd-right'), Key('shift-enter')],
'(react | reaction)': Key('cmd-shift-\\'),
'user': Key('@'),
'tag channel': Key('#'),
'([insert] command | commandify)': Key('cmd-shift-c'),
'[insert] code': ['``````', Key('left left left'), Key('shift-enter'), Key('shift-enter'), Key('up')],
'(bullet | bulleted) list': Key('cmd-shift-8'),
'(number | numbered) list': Key('cmd-shift-7'),
'(quotes | quotation)': Key('cmd-shift->'),
'bold': Key('cmd-b'),
'(italic | italicize)': Key('cmd-i'),
'(strike | strikethrough)': Key('cmd-shift-x'),
'mark all read': Key('shift-esc'),
'mark channel read': Key('esc'),
'clear': [Key('cmd-a'), Key('backspace')],
# Files and Snippets
'upload': Key('cmd-u'),
'snippet': Key('cmd-shift-enter'),
# Calls
'([toggle] mute | unmute)': Key('m'),
'[toggle] video': Key('v'),
'invite': Key('a'),
# Emojis
'thumbs up': ':+1:',
'smiley': ':slightly_smiling_face:',
'laugh out loud': ':joy:',
'shruggie': '/shrug ',
# Miscellaneous
'shortcuts': Key('cmd-/'),
}
ctx.keymap(keymap)