Last active
September 26, 2017 18:27
-
-
Save joshthewhite/ae4851945cdca5d9c57c75823e1ccc5f to your computer and use it in GitHub Desktop.
AutoHotKey Run/Show/Hide Cygwin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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