-
-
Save nordineb/6711427 to your computer and use it in GitHub Desktop.
This file contains 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
; AutoHotkey script, download from: | |
; http://www.autohotkey.com/ | |
; NOTE: Save this file with Windows line endings i.e. \r\n | |
; | |
cmd_line := "C:\bin\cygwin\bin\mintty.exe /bin/zsh --login" | |
wnd_class := "ahk_class mintty" | |
#c:: | |
DetectHiddenWindows, on | |
Maximize() | |
{ | |
global | |
WinShow | |
WinActivate | |
WinGetPos, X, Y, Width, Height | |
SysGet, FullScreenWidth, 78 | |
SysGet, FullScreenHeight, 79 | |
If (X <> 0) or (Y <> 0) or (Width <> FullScreenWidth) or (Height <> FullScreenHeight) | |
{ | |
Send !{Enter} | |
} | |
} | |
If WinExist(wnd_class) | |
{ | |
IfWinActive | |
{ | |
WinMinimize | |
WinHide | |
} | |
Else | |
{ | |
Maximize() | |
} | |
} | |
Else | |
{ | |
Run % cmd_line, , Hide | |
WinWait % wnd_class, , 5 | |
If ErrorLevel | |
{ | |
MsgBox, WinWait timed out. Please try pressing Win+C again. | |
} | |
Else | |
{ | |
Maximize() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment