Last active
May 19, 2022 22:12
-
-
Save ddaletski/bdcd3a43a981857d9b7e3d509e54de21 to your computer and use it in GitHub Desktop.
Autohotkey script for drop-down windows terminal (on Win+`)
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
#NoEnv | |
#SingleInstance force | |
SendMode Input | |
DetectHiddenWindows, on | |
SetWinDelay, 0 | |
#`:: | |
ToggleTerminal() | |
Return | |
ToggleTerminal() { | |
matcher := "ahk_class CASCADIA_HOSTING_WINDOW_CLASS" | |
if WinExist(matcher) { | |
if !WinActive(matcher) { | |
; Hide it first to alow raising it later on a different workspace | |
HideTerminal() | |
ShowTerminal() | |
} else if WinExist(matcher) { | |
HideTerminal() | |
} | |
} else { | |
OpenNewTerminal() | |
} | |
} | |
OpenNewTerminal() { | |
Run, wt.exe | |
ShowTerminal() | |
} | |
ShowTerminal() { | |
WinShow ahk_class CASCADIA_HOSTING_WINDOW_CLASS | |
WinActivate ahk_class CASCADIA_HOSTING_WINDOW_CLASS | |
} | |
HideTerminal() { | |
WinMinimize ahk_class CASCADIA_HOSTING_WINDOW_CLASS | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment