Created
November 4, 2022 07:51
-
-
Save n1crack/1325aa400bc3b2159da30774080235e2 to your computer and use it in GitHub Desktop.
AutoHotkey Show/Hide Terminal App with Alt+Space
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
EnvGet, LocalAppData, LocalAppData | |
!space::ToggleTerminal() | |
ToggleTerminal() | |
{ | |
WinMatcher := "ahk_class CASCADIA_HOSTING_WINDOW_CLASS" | |
if WinExist(WinMatcher) | |
; Window Exists | |
{ | |
; Check if its minimize | |
if (!WinActive(WinMatcher)) | |
{ | |
WinActivate ahk_class CASCADIA_HOSTING_WINDOW_CLASS | |
} | |
else | |
{ | |
; Script sees it without detecting hidden windows, so.. | |
WinMinimize ahk_class CASCADIA_HOSTING_WINDOW_CLASS | |
} | |
} | |
else | |
{ | |
Run "wt.exe" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment