Skip to content

Instantly share code, notes, and snippets.

@danielbene
Last active August 23, 2022 15:37
Show Gist options
  • Save danielbene/4c27e02868f8bf7fbe4bf750f75d9a21 to your computer and use it in GitHub Desktop.
Save danielbene/4c27e02868f8bf7fbe4bf750f75d9a21 to your computer and use it in GitHub Desktop.
AHK implementation of Pop_OS hotkeys (with extras)
#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%
#F::
Run, Explorer
return
#S::
ComplexRunner("Code.exe", "C:\path\to\Code.exe")
return
#T::
ComplexRunner("ConEmu64.exe", "c:\path\to\Cmder.exe")
return
#M::
MinMaxCurrent()
return
#Q::
WinClose, A
return
; --------------------------------------------------------------------------------------------- ;
; PowerToys RUN launcher support
; Double tap win key to open launcher
~LWin::
{
KeyWait, LWin
KeyWait, LWin, D T.3
If (!ErrorLevel) {
Sleep, 200
Send, !{Space}
}
return
}
; --------------------------------------------------------------------------------------------- ;
ComplexRunner(ahkexe, path) {
IfWinNotExist, ahk_exe %ahkexe%
Run, %path%
else {
IfWinActive, ahk_exe %ahkexe%
MinMaxCurrent()
else
WinActivate, ahk_exe %ahkexe%
}
return
}
MinMaxCurrent() {
WinGet MX, MinMax, A
if (MX==1)
WinRestore, A
else
WinMaximize, A
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment