Skip to content

Instantly share code, notes, and snippets.

@joshthewhite
Last active September 26, 2017 18:27
Show Gist options
  • Save joshthewhite/ae4851945cdca5d9c57c75823e1ccc5f to your computer and use it in GitHub Desktop.
Save joshthewhite/ae4851945cdca5d9c57c75823e1ccc5f to your computer and use it in GitHub Desktop.
AutoHotKey Run/Show/Hide Cygwin
EnvGet, userProfile, USERPROFILE
SetNumLockState, AlwaysOn
SetCapsLockState, AlwaysOff
SetWorkingDir, c:\
ToggleWinHideRun(WindowTitle, RunCommand, MaximizeOnRun)
{
SetTitleMatchMode,2
IfWinActive, %WindowTitle%
{
WinHide
}
Else
{
DetectHiddenWindows, On
IfWinExist, %WindowTitle%
{
WinShow
WinActivate
}
Else
{
Run %RunCommand%
If (MaximizeOnRun)
{
WinWait, %WindowTitle%
WinMaximize
}
}
DetectHiddenWindows, Off
}
Return
}
CapsLock:: ToggleWinHideRun("ahk_exe mintty.exe", "C:\tools\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico", True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment