Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
e3b43313a9 |
135
macOS.ahk
135
macOS.ahk
@ -4,48 +4,20 @@ SendMode Input
|
||||
SetWorkingDir %A_ScriptDir%
|
||||
SetTitleMatchMode 2
|
||||
|
||||
GroupAdd, Browser, Firefox
|
||||
GroupAdd, Browser, Edge
|
||||
GroupAdd, Browser, Chrome
|
||||
|
||||
GroupAdd, WebCatalog, Personal
|
||||
GroupAdd, WebCatalog, Apple
|
||||
GroupAdd, WebCatalog, Work
|
||||
GroupAdd, WebCatalog, Ferdium
|
||||
|
||||
; ---------------------------------- Global ----------------------------------
|
||||
#Space:: ; toggle Windows Terminal quake mode
|
||||
send #``
|
||||
return
|
||||
|
||||
!`:: ; switch between windows of same app
|
||||
WinGetClass, OldClass, A
|
||||
WinGet, ActiveProcessName, ProcessName, A
|
||||
WinGet, WinClassCount, Count, ahk_exe %ActiveProcessName%
|
||||
IF WinClassCount = 1
|
||||
Return
|
||||
loop, 2 {
|
||||
WinSet, Bottom,, A
|
||||
WinActivate, ahk_exe %ActiveProcessName%
|
||||
WinGetClass, NewClass, A
|
||||
if (OldClass <> "CabinetWClass" or NewClass = "CabinetWClass")
|
||||
break
|
||||
}
|
||||
|
||||
; ---------------------------------- Editing ---------------------------------
|
||||
!x:: ; cut
|
||||
send ^x
|
||||
return
|
||||
|
||||
!c:: ; copy
|
||||
if WinActive("ahk_exe WindowsTerminal.exe") || WinActive("ahk_exe wezterm-gui.exe")
|
||||
if WinActive("ahk_exe WindowsTerminal.exe")
|
||||
send ^+c
|
||||
else
|
||||
send ^c
|
||||
return
|
||||
|
||||
!v:: ; paste
|
||||
if WinActive("ahk_exe WindowsTerminal.exe") || WinActive("ahk_exe wezterm-gui.exe")
|
||||
if WinActive("ahk_exe WindowsTerminal.exe")
|
||||
send ^+v
|
||||
else
|
||||
send ^v
|
||||
@ -64,34 +36,30 @@ send ^a
|
||||
return
|
||||
|
||||
$!r:: ; reload
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^r
|
||||
else if WinActive("ahk_exe explorer.exe")
|
||||
send {F5}
|
||||
else
|
||||
send !r
|
||||
return
|
||||
|
||||
; -------------------------------- Navigation --------------------------------
|
||||
|
||||
$![:: ; back from Alt+[
|
||||
$<^>![:: ; from AltGr+[
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog") || WinActive("ahk_exe explorer.exe")
|
||||
$![:: ; back
|
||||
if WinActive("Firefox")
|
||||
send !{Left}
|
||||
else
|
||||
send ![
|
||||
return
|
||||
|
||||
$!]:: ; forward from Atl+]
|
||||
$<^>!]:: ; from AltGr+]
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog") || WinActive("ahk_exe explorer.exe")
|
||||
$!]:: ; forward
|
||||
if WinActive("Firefox")
|
||||
send !{Right}
|
||||
else
|
||||
send !]
|
||||
return
|
||||
|
||||
$!+r:: ; reload (override cache)
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^+r
|
||||
else
|
||||
send !+r
|
||||
@ -99,42 +67,42 @@ return
|
||||
|
||||
; ------------------------------- Current Page -------------------------------
|
||||
$!Down:: ; go to bottom of page
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^{Down}
|
||||
else
|
||||
send !{Down}
|
||||
return
|
||||
|
||||
$!Up:: ; go to top of page
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^{Up}
|
||||
else
|
||||
send !{Up}
|
||||
return
|
||||
|
||||
$!p:: ; print
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^p
|
||||
else
|
||||
send !p
|
||||
return
|
||||
|
||||
$!=:: ; zoom in
|
||||
if WinActive("ahk_group Browser")
|
||||
$!+=:: ; zoom in
|
||||
if WinActive("Firefox")
|
||||
send ^+=
|
||||
else
|
||||
send !+=
|
||||
return
|
||||
|
||||
$!-:: ; zoom out
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^-
|
||||
else
|
||||
send !-
|
||||
return
|
||||
|
||||
$!0:: ; zoom reset
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^0
|
||||
else
|
||||
send !0
|
||||
@ -142,14 +110,14 @@ return
|
||||
|
||||
; ---------------------------------- Search ----------------------------------
|
||||
$!f:: ; find
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^f
|
||||
else
|
||||
send !f
|
||||
return
|
||||
|
||||
$!l:: ; focus address bar
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^l
|
||||
else
|
||||
send !l
|
||||
@ -157,145 +125,143 @@ return
|
||||
|
||||
; ------------------------------ Windows & Tabs ------------------------------
|
||||
$!w:: ; close tab
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_exe explorer.exe")
|
||||
if WinActive("Firefox")
|
||||
send ^w
|
||||
else if WinActive("ahk_exe wezterm-gui.exe")
|
||||
send ^+w
|
||||
else
|
||||
send !w
|
||||
return
|
||||
|
||||
!<#w:: ; close window - the fuck is this?
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^+w
|
||||
; TODO: else
|
||||
return
|
||||
|
||||
!q:: ; quit
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^+q
|
||||
else
|
||||
send !{F4}
|
||||
return
|
||||
|
||||
$!+[:: ; go one tab left
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_exe wezterm-gui.exe")
|
||||
if WinActive("Firefox")
|
||||
send ^{PgUp}
|
||||
else if WinActive("ahk_exe explorer.exe")
|
||||
else if WinActive("ahk_exe WindowsTerminal.exe")
|
||||
send ^+{Tab}
|
||||
else
|
||||
send !+[
|
||||
return
|
||||
|
||||
$!+]:: ; go one tab right
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_exe wezterm-gui.exe")
|
||||
if WinActive("Firefox")
|
||||
send ^{PgDn}
|
||||
else if WinActive("ahk_exe explorer.exe")
|
||||
else if WinActive("ahk_exe WindowsTerminal.exe")
|
||||
send ^{Tab}
|
||||
else
|
||||
send !+]
|
||||
return
|
||||
|
||||
$^!+[:: ; move one tab left
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_exe wezterm-gui.exe")
|
||||
if WinActive("Firefox")
|
||||
send ^+{PgUp}
|
||||
else
|
||||
send ^!+[
|
||||
return
|
||||
|
||||
$^!+]:: ; move one tab right
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_exe wezterm-gui.exe")
|
||||
if WinActive("Firefox")
|
||||
send ^+{PgDn}
|
||||
else
|
||||
send ^!+]
|
||||
return
|
||||
|
||||
$!t:: ; new tab
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_exe explorer.exe")
|
||||
if WinActive("Firefox")
|
||||
send ^t
|
||||
else
|
||||
send !t
|
||||
return
|
||||
|
||||
$!n:: ; new window
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^n
|
||||
else
|
||||
send !n
|
||||
return
|
||||
|
||||
$!+n:: ; new private window
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^+p
|
||||
else
|
||||
send !+n
|
||||
return
|
||||
|
||||
$!+t:: ; undo closed tab
|
||||
if WinActive("ahk_group Browser")
|
||||
if WinActive("Firefox")
|
||||
send ^+t
|
||||
else
|
||||
send !+t
|
||||
return
|
||||
|
||||
$!1:: ; select tab 1
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^1
|
||||
else
|
||||
send !1
|
||||
return
|
||||
|
||||
$!2:: ; select tab 2
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^2
|
||||
else
|
||||
send !2
|
||||
return
|
||||
|
||||
$!3:: ; select tab 3
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^3
|
||||
else
|
||||
send !3
|
||||
return
|
||||
|
||||
$!4:: ; select tab 4
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^4
|
||||
else
|
||||
send !4
|
||||
return
|
||||
|
||||
$!5:: ; select tab 5
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^5
|
||||
else
|
||||
send !5
|
||||
return
|
||||
|
||||
$!6:: ; select tab 6
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^6
|
||||
else
|
||||
send !6
|
||||
return
|
||||
|
||||
$!7:: ; select tab 7
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^7
|
||||
else
|
||||
send !7
|
||||
return
|
||||
|
||||
$!8:: ; select tab 8
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^8
|
||||
else
|
||||
send !8
|
||||
return
|
||||
|
||||
$!9:: ; select tab 9
|
||||
if WinActive("ahk_group Browser") || WinActive("ahk_group WebCatalog")
|
||||
if WinActive("Firefox") || WinActive("Ferdi")
|
||||
send ^9
|
||||
else
|
||||
send !9
|
||||
@ -308,26 +274,3 @@ return
|
||||
; TODO: Firefox Miscellaneous
|
||||
; TODO: Firefox Media shortcuts
|
||||
; TODO: Firefox Selection of Multiple Tabs
|
||||
|
||||
; -------------------------------- Media Keys --------------------------------
|
||||
|
||||
AppsKey & F7::Send {Media_Prev}
|
||||
AppsKey & F8::Send {Media_Play_Pause}
|
||||
AppsKey & F9::Send {Media_Next}
|
||||
AppsKey & F10::Send {Volume_Mute}
|
||||
AppsKey & F11::Send {Volume_Down}
|
||||
AppsKey & F12::Send {Volume_Up}
|
||||
AppsKey::Send, {AppsKey}
|
||||
|
||||
; -------------------------------- 1Password ---------------------------------
|
||||
|
||||
!+Space:: ; quick access
|
||||
send ^+{Space}
|
||||
return
|
||||
|
||||
!+c:: ; copy password
|
||||
if WinActive("ahk_exe 1Password.exe")
|
||||
send ^+c
|
||||
else
|
||||
send !+c
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user