-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapps.ahk
More file actions
234 lines (189 loc) · 6.61 KB
/
apps.ahk
File metadata and controls
234 lines (189 loc) · 6.61 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
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;E.G. BEGIN
;!(ALT)<Key>::
; if WinExist("<WinTitle String>")
; WinActivate Uses the last found window.
; else
; Run <program>
; return (so it don't get borked and run all of them)
;Shamelessly yoinked from https://autohotkey.com/board/topic/88790-cycle-through-windows-of-the-same-class-as-the-current-window/
#PgDn:: ; Next Window of same class, Win+PgDn (# is a modifier for either LWin or RWin)
WinGetClass, CurrentActive, A
WinGet, Instances, Count, ahk_class %CurrentActive%
If Instances > 1
WinSet, Bottom,, A
WinActivate, ahk_class %CurrentActive%
return
;Shamelessly yoinked from https://autohotkey.com/board/topic/88790-cycle-through-windows-of-the-same-class-as-the-current-window/
#PgUp:: ; Previous Window of same class, Win+PgDn (# is a modifier for either LWin or RWin)
WinGetClass, CurrentActive, A
WinGet, Instances, Count, ahk_class %CurrentActive%
If Instances > 1
WinActivateBottom, ahk_class %CurrentActive%
return
!U::
if WinExist("ahk_exe ubuntu.exe")
WinActivate ; Uses the last found window.
else{
;;This bs method is required to launch with environment variable access of Run.exe and not AHK
Run "C:\Users\benny\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\Run.lnk"
WinWait "Run", "ahk_class #32770", "ahk_exe Explorer.EXE"
Send "ubuntu"
Send {Enter}
}
return
+!I::
!I::
if WinExist("ahk_exe pwsh.exe") && !GetKeyState("Shift")
WinActivate ; Uses the last found window.
else{
;;This bs method is required to launch with environment variable access of Run.exe and not AHK
Run "C:\Users\benny\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\Run.lnk"
WinWait "Run", "ahk_class #32770", "ahk_exe Explorer.EXE"
Send pwsh
Send {Enter}
}
return
!C::
if WinExist("ahk_exe chrome.exe")
WinActivate ; Uses the last found window.
else
Run "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk"
return
!F::
if WinExist("ahk_class MozillaWindowClass")
WinActivate ; Uses the last found window.
else
Run Firefox
return
!N::
if WinExist("ahk_class Notepad++")
WinActivate ; Uses the last found window.
else
Run Notepad++
return
!D::
if WinExist("ahk_exe Discord.exe")
WinActivate ; Uses the last found window.
else
Run "C:\Users\benny\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk"
return
!X::
if WinExist("ahk_exe xampp-control.exe")
WinActivate ; Uses the last found window.
else
Run "C:\xampp\xampp-control.exe"
return
!S::
if WinExist("ahk_exe Spotify.exe")
WinActivate ; Uses the last found window.
else
Run "C:\Users\benny\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Spotify.lnk"
return
!E::
if WinExist("ahk_class SWT_Window0")
WinActivate ; Uses the last found window.
else
Run "C:\Users\benny\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Eclipse\Eclipse Java 2019-06.lnk"
return
!G::
if WinExist("ahk_exe GitHubDesktop.exe")
WinActivate ; Uses the last found window.
else
Run "C:\Users\benny\Documents\Macros\GitHub Desktop.lnk"
return
+!W::
!W::
if WinExist("ahk_class CabinetWClass") && !GetKeyState("Shift")
WinActivate ; Uses the last found window.
else
Run explorer
return
!P::
if WinExist("ahk_exe Postman.exe")
WinActivate ; Uses the last found window.
else
Run "C:\Users\benny\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Postman\Postman.lnk"
return
!Z::
run cmd.exe
WinWait C:\WINDOWS\SYSTEM32\cmd.exe ; Waiting for system to catch up
if WinExist("ahk_exe cmd.exe"){
} ; Ensures this cmd is the most recently found window
WinActivate ; Opens most recently found window (found by WinExist)
Send {Text}cd C:\Users\benny\my-app `r`n ng build my-app `r`n exit `r`n
return
+!Z::
run cmd.exe
WinWait C:\WINDOWS\SYSTEM32\cmd.exe ; Waiting for system to catch up
if WinExist("ahk_exe cmd.exe"){
} ; Ensures this cmd is the most recently found window
WinActivate ; Opens most recently found window (found by WinExist)
Send {Text}cd C:\Users\benny\my-app `r`n ng build my-app `r`n
return
!R::
run cmd.exe
WinWait C:\WINDOWS\SYSTEM32\cmd.exe ; Waiting for system to catch up
if WinExist("ahk_exe cmd.exe"){
} ; Ensures this cmd is the most recently found window
WinActivate ; Opens most recently found window (found by WinExist)
Send {Text}cd C:\xampp\htdocs `r`n npx babel-cli react --ignore node_modules --out-dir compiled --copy-files --presets react `r`n exit `r`n
return
+!R::
run cmd.exe
WinWait C:\WINDOWS\SYSTEM32\cmd.exe ; Waiting for system to catch up
if WinExist("ahk_exe cmd.exe"){
} ; Ensures this cmd is the most recently found window
WinActivate ; Opens most recently found window (found by WinExist)
Send {Text}cd C:\xampp\htdocs `r`n npx babel-cli react --ignore node_modules --out-dir compiled --copy-files --presets react `r`n
return
!T::
if WinExist("ahk_exe WindowsTerminal.exe")
WinActivate ; Uses the last found window.
else {
;;This bs method is required to launch with environment variable access of Run.exe and not AHK
Run "C:\Users\benny\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\Run.lnk"
WinWait "Run", "ahk_class #32770", "ahk_exe Explorer.EXE"
Send "wt"
Send {Enter}
}
return
!O::
if WinExist("ahk_exe WINWORD.EXE") || WinExist("ahk_exe EXCEL.EXE") || WinExist("ahk_exe POWERPNT.EXE")
WinActivate ; Uses the last found window.
else
Run "C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE"
return
!V::
if WinExist("ahk_exe devenv.exe")
WinActivate ; Uses the last found window.
else{
Run "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2019.lnk"
}
return
!M::
Send ^+{Esc} ; Control+Shift+Esc, This starts task manager or focuses it if running.
return
!A::
Send document.getElementsByTagName("video")[0].playbackRate =
return
+!A::
Send document.getElementsByTagName("video")[0].playbackRate = 2.5{Enter}
return
;Web shortcuts, pretty simple, there is corresponding batch file for each
!L::
Run "C:\Users\benny\Documents\Macros\localhost.bat"
return
!Y::
Run "C:\Users\benny\Documents\Macros\youtube.bat"
return
!J::
if WinExist("ahk_exe pycharm64.exe")
WinActivate
else {
Run "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\JetBrains\PyCharm 2024.1.4.lnk"
}
return