Skip to content

Instantly share code, notes, and snippets.

@nordineb
Forked from StanAngeloff/mintty.ahk
Created September 26, 2013 08:33
Show Gist options
  • Save nordineb/6711427 to your computer and use it in GitHub Desktop.
Save nordineb/6711427 to your computer and use it in GitHub Desktop.
; 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