Skip to content

Instantly share code, notes, and snippets.

@enlavin
Created February 13, 2021 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enlavin/c2386b4015337e49fe20c15bd19e4e3b to your computer and use it in GitHub Desktop.
Save enlavin/c2386b4015337e49fe20c15bd19e4e3b to your computer and use it in GitHub Desktop.
AHK chords
F13::
ActivateProcess("slack.exe")
return
F14::
ActivateProcess("telegram.exe")
return
F15::
ActivateProcess("devenv.exe")
return
F16::
ActivateProcess("spotify.exe")
return
PrintScreen::
Input, InputKey, L1 M T1.5
if (InputKey = "Timeout") {
return
}
if (InputKey = "s") {
ActivateProcess("slack.exe")
return
}
if (InputKey = "t") {
ActivateProcess("telegram.exe")
return
}
if (InputKey = "v") {
ActivateProcess("gvim.exe")
return
}
if (InputKey = "f") {
ActivateProcess("firefox.exe")
return
}
if (InputKey = "m") {
ActivateProcess("teams.exe")
return
}
if (InputKey = "c") {
ActivateProcess("code.exe")
return
}
if (InputKey = "d") {
ActivateProcess("devenv.exe")
return
}
if (InputKey = ".") {
ActivateProcess("spotify.exe")
return
}
return
ActivateProcess(name) {
DetectHiddenWindows, Off
Process, Exist, %name%
pid = %ErrorLevel%
IfWinNotExist, ahk_pid %pid%
{
TrayIcon_Button(name)
}
Else
{
;IfWinActive, ahk_pid %pid%
;{
; WinClose, ahk_pid %pid%
;}
;Else
;{
WinActivate, ahk_pid %pid%
;}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment