-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigurations.py
296 lines (253 loc) · 5.81 KB
/
configurations.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
## Example configurations for Linux Ubuntu ##
import usb_hid
import time
import random
from abstract_classes import AbstractConfiguration, AbstractMacro
from empty_classes import EmptyConfiguration, EmptyMacro
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
keyboard = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(keyboard)
## CONFIGURATIONS ##
class Terminal(AbstractConfiguration):
def getName():
return 'Terminal'
def getColor():
return (0, 255, 0)
def getMacros():
return [
Ls,
Pwd,
Home
]
class Obsidian(AbstractConfiguration):
def getName():
return 'Obsidian'
def getColor():
return (51, 51, 255)
def getMacros():
return [
AddNewLog,
AddNewDailyPlan,
AddQuestionsDailyPlan
]
class PhpStorm(AbstractConfiguration):
def getName():
return 'PHPStorm'
def getColor():
return (232, 49, 123)
def getMacros():
return [
OpenInTerminal,
Rename,
SelectOpenedFile,
EmptyMacro,
EmptyMacro,
EmptyMacro,
EmptyMacro,
ListenForDebug,
StepOver,
StepInto,
StepOut,
NextBreakpoint
]
class Zoom(AbstractConfiguration):
def getName():
return 'Zoom'
def getColor():
return (80, 140, 246)
def getMacros():
return [
ToggleMicrophoneZoom,
EmptyMacro,
ToggleVideoZoom,
EmptyMacro,
ToggleScreenShareZoom,
EmptyMacro,
EmptyMacro,
EmptyMacro,
LeaveMeetingZoom
]
class NumPad(AbstractConfiguration):
def getName():
return 'Numeric pad'
def getColor():
return (205, 255, 0)
def getMacros():
return [
Num0,
Num1,
Num2,
Num3,
Num4,
Num5,
Num6,
Num7,
Num8,
Num9
]
## COMMANDS ##
class OpenInTerminal(AbstractMacro):
def getMacroName():
return 'Open in terminal'
def getMacro():
keyboard.send(Keycode.ALT, Keycode.T)
class Rename(AbstractMacro):
def getMacroName():
return 'Rename'
def getMacro():
keyboard.send(Keycode.SHIFT, Keycode.F6)
class ListenForDebug(AbstractMacro):
def getMacroName():
return 'Listen for debug'
def getMacro():
keyboard.send(Keycode.ALT, Keycode.D)
class StepOver(AbstractMacro):
def getMacroName():
return 'Step over'
def getMacro():
keyboard.send(Keycode.F8)
class StepInto(AbstractMacro):
def getMacroName():
return 'Step into'
def getMacro():
keyboard.send(Keycode.F7)
class StepOut(AbstractMacro):
def getMacroName():
return 'Step out'
def getMacro():
keyboard.send(Keycode.SHIFT, Keycode.F8)
class NextBreakpoint(AbstractMacro):
def getMacroName():
return 'Next breakpoint'
def getMacro():
keyboard.send(Keycode.F9)
class SelectOpenedFile(AbstractMacro):
def getMacroName():
return 'Select Opened File'
def getMacro():
keyboard.send(Keycode.SHIFT, Keycode.F1)
class Ls(AbstractMacro):
def getMacroName():
return 'll'
def getMacro():
layout.write("ll")
keyboard.send(Keycode.ENTER)
class Pwd(AbstractMacro):
def getMacroName():
return 'pwd'
def getMacro():
layout.write("pwd")
keyboard.send(Keycode.ENTER)
class Home(AbstractMacro):
def getMacroName():
return 'Home'
def getMacro():
layout.write("cd $HOME")
keyboard.send(Keycode.ENTER)
class AddNewLog(AbstractMacro):
def getMacroName():
return 'New Log'
def getMacro():
keyboard.send(Keycode.CONTROL, Keycode.P)
layout.write("Insert template")
time.sleep(0.1)
keyboard.send(Keycode.ENTER)
layout.write("New log")
time.sleep(0.1)
keyboard.send(Keycode.ENTER)
class AddNewDailyPlan(AbstractMacro):
def getMacroName():
return 'New daily plan'
def getMacro():
keyboard.send(Keycode.CONTROL, Keycode.P)
layout.write("Insert template")
time.sleep(0.1)
keyboard.send(Keycode.ENTER)
layout.write("New daily plan")
time.sleep(0.1)
keyboard.send(Keycode.ENTER)
class AddQuestionsDailyPlan(AbstractMacro):
def getMacroName():
return 'Add questions for next daily'
def getMacro():
keyboard.send(Keycode.CONTROL, Keycode.P)
layout.write("Insert template")
time.sleep(0.1)
keyboard.send(Keycode.ENTER)
layout.write("Questions for next daily")
time.sleep(0.1)
keyboard.send(Keycode.ENTER)
class ToggleMicrophoneZoom(AbstractMacro):
def getMacroName():
return "Toggle microphone"
def getMacro():
keyboard.send(Keycode.ALT, Keycode.A)
class ToggleVideoZoom(AbstractMacro):
def getMacroName():
return "Toggle video"
def getMacro():
keyboard.send(Keycode.ALT, Keycode.V)
class ToggleScreenShareZoom(AbstractMacro):
def getMacroName():
return "Toggle screen share"
def getMacro():
keyboard.send(Keycode.ALT, Keycode.S)
class LeaveMeetingZoom(AbstractMacro):
def getMacroName():
return "Close call"
def getMacro():
keyboard.send(Keycode.CONTROL, Keycode.SHIFT, Keycode.E)
class Num0(AbstractMacro):
def getMacroName():
return "Number 0"
def getMacro():
layout.write("0")
class Num1(AbstractMacro):
def getMacroName():
return "Number 1"
def getMacro():
layout.write("1")
class Num2(AbstractMacro):
def getMacroName():
return "Number 2"
def getMacro():
layout.write("2")
class Num3(AbstractMacro):
def getMacroName():
return "Number 3"
def getMacro():
layout.write("3")
class Num4(AbstractMacro):
def getMacroName():
return "Number 4"
def getMacro():
layout.write("4")
class Num5(AbstractMacro):
def getMacroName():
return "Number 5"
def getMacro():
layout.write("5")
class Num6(AbstractMacro):
def getMacroName():
return "Number 6"
def getMacro():
layout.write("6")
class Num7(AbstractMacro):
def getMacroName():
return "Number 7"
def getMacro():
layout.write("7")
class Num8(AbstractMacro):
def getMacroName():
return "Number 8"
def getMacro():
layout.write("8")
class Num9(AbstractMacro):
def getMacroName():
return "Number 9"
def getMacro():
layout.write("9")
# Map your configurations inside this array
configurations_map = [ NumPad, Zoom, Obsidian, EmptyConfiguration, Terminal, PhpStorm ]