From 0a6536a8c21801dc059003afa4ef804bca26a98d Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 16 Jun 2025 15:11:09 +0200 Subject: changed ahk --- AutoHotkey/hotkeys.ahk | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/AutoHotkey/hotkeys.ahk b/AutoHotkey/hotkeys.ahk index 662d610..6ef62b2 100644 --- a/AutoHotkey/hotkeys.ahk +++ b/AutoHotkey/hotkeys.ahk @@ -32,6 +32,31 @@ DetectHiddenWindows true } } +;WSL +#w:: +{ + ; Check if WSL is running + if WinExist("ahk_class ConsoleWindowClass ahk_exe wsl.exe" ) + { + ; If WSL is already in the foreground, minimize it + if WinActive("ahk_class ConsoleWindowClass ahk_exe wsl.exe" ) + { + WinMinimize("ahk_class ConsoleWindowClass ahk_exe wsl.exe") + } + else + { + ; If WSL is running but not in the foreground, bring it to the foreground + WinActivate("ahk_class ConsoleWindowClass ahk_exe wsl.exe") + } + } + else + { + ; If WSL is not running, launch it + Run(UserPath . "wsl.exe") + if WinWait("ahk_class ConsoleWindowClass ahk_exe wsl.exe", , 5) + WinActivate("ahk_class ConsoleWindowClass ahk_exe wsl.exe") + } +} ;Emacs #n:: { @@ -200,9 +225,4 @@ DetectHiddenWindows true WinActivate("Claude") } } - else - { - ; If AI is not running, launch it - Run("Claude.exe") - } } -- cgit v1.2.3