full_command_line := DllCall("GetCommandLine", "str") if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)")) { try { if A_IsCompiled Run *RunAs "%A_ScriptFullPath%" /restart else Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%" } ExitApp }
CTRL_ESC_TIMEOUT := 200
GroupAdd, TargetApps, ahk_exe Code.exe GroupAdd, TargetApps, ahk_exe Obsidian.exe GroupAdd, TargetApps, ahk_exe chrome.exe GroupAdd, TargetApps, ahk_exe alacritty.exe GroupAdd, TargetApps, ahk_exe idea64.exe GroupAdd, TargetApps, ahk_exe WindowsTerminal.exe GroupAdd, TargetApps, ahk_exe zen.exe GroupAdd, TargetApps, ahk_exe PowerToys.PowerLauncher.exe Return
#IfWinActive ahk_group TargetApps
~LControl:: pressedTime := A_TickCount
KeyWait, LControl
if ((A_TickCount - pressedTime < CTRL_ESC_TIMEOUT) && (A_PriorKey = "LControl")) { SendInput {Blind}{Escape} }
Return #IfWinActive
^Space:: Run, C:\Tools\im-select\im-select.exe locale, , Hide Return
#IfWinActive ahk_exe WindowsTerminal.exe #c:: SendInput, ^+c Return
#v:: SendInput, ^+v Return
#t:: SendInput, ^+t Return
#w:: SendInput, ^+w Return
#1:: SendInput, ^!1 return
#2:: SendInput, ^!2 return
#3:: SendInput, ^!3 return
#4:: SendInput, ^!4 return
#5:: SendInput, ^!5 return
#6:: SendInput, ^!6 return
#7:: SendInput, ^!7 return
#8:: SendInput, ^!8 return
#9:: SendInput, ^!9 return #IfWinActive
#c:: SendInput, ^c Return
#v:: SendInput, ^v Return
#a:: SendInput, ^a Return
#z:: SendInput, ^z Return
#w:: SendInput, !{F4} Return
#m:: WinMinimize, A Return
#h::SendInput, {Left} Return #j::SendInput, {Down} Return #k::SendInput, {Up} Return
$#l::SendInput, {Right} Return
$#Tab:: SendInput {Blind}{LAlt Down}{Tab} KeyWait, LWin SendInput {LAlt Up} Return
GroupAdd, TargetApps, ahk_exe Code.exe GroupAdd, TargetApps, ahk_exe Obsidian.exe GroupAdd, TargetApps, ahk_exe chrome.exe
GroupAdd, TerminalApps, ahk_exe WindowsTerminal.exe GroupAdd, TerminalApps, ahk_exe alacritty.exe GroupAdd, TerminalApps, ahk_exe cmd.exe GroupAdd, TerminalApps, ahk_exe powershell.exe GroupAdd, TerminalApps, ahk_exe pwsh.exe GroupAdd, TerminalApps, ahk_exe conhost.exe GroupAdd, TerminalApps, ahk_exe mintty.exe GroupAdd, TerminalApps, ahk_exe putty.exe
Return
#IfWinActive ahk_exe zen.exe #t::SendInput, ^t #f::SendInput, ^f #IfWinActive
|