Skip to content

Instantly share code, notes, and snippets.

@pwang2
Last active October 31, 2022 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwang2/1298e99da93ad857d77e737cd0f03716 to your computer and use it in GitHub Desktop.
Save pwang2/1298e99da93ad857d77e737cd0f03716 to your computer and use it in GitHub Desktop.
Autohotkey settings to help switch between windows and mac easier
CapsLock::Esc
return
MButton::
Send ^w
return
+!r::
Reload
TrayTip "Reload", "Success"
return
;-------------------------------------------
!w::
Send ^w
return
!q::
Send {ALT DOWN}{F4}{ALT UP}
return
;--------------------------------------------
!Up::
CenterActiveWindow()
return
!Left::
Send #{Left}
return
!Right::
Send #{Right}
return
!c::
Send ^c
return
!v::
Send ^v
return
;-------------------------------------------
!+s::
Run, https://global.summitweb.williamblair.com
return
;-------------------------------------------
!+e::
Run, https://imem.williamblair.com
return
;-------------------------------------------
!+a::
Run, https://portal.azure.com
return
#+e::
Run, powershell.exe -WindowStyle hidden "New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 1 -Type Dword -Force; New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 1 -Type Dword -Force"
return
#+d::
Run, powershell.exe -WindowStyle hidden "New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0 -Type Dword -Force; New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force"
return
;-------------------------------------------
!+g::
Run, https://dev.azure.com/wbim/EMDebtAndEquity
return
;--------------------------------------------
!j::
ShortBind("ahk_exe chrome.exe", "C:\Program Files\Google\Chrome\Application\chrome.exe")
return
;-----------------------------------
!k::
WinMinimizeAll
ShortBind("ahk_exe WindowsTerminal.exe", "C:\Users\pw618\scoop\apps\windows-terminal\current\wt.exe")
return
;-----------------------------------
!o::
ShortBind("ahk_exe OUTLOOK.exe", "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE")
return
;-----------------------------------
!p::
ShortBind("ahk_exe Teams.exe", "C:\Users\PW618\AppData\Local\Microsoft\Teams\current\Teams.exe")
return
;--------------------------------------------
CenterActiveWindow(hideTitle = false) {
; get the actual work area. That is, screen size w/o the taskbar.
SysGet, WA_, MonitorWorkArea
A_ScreenWidthWA := WA_Right - WA_Left
A_ScreenHeightWA := WA_Bottom - WA_Top
WinRestore A
WinGetTitle, windowName, A
WinGetClass, windowClass, A
topMargin := hideTitle ? -2 : 48
windowHeight := WA_Bottom - topMargin
windowWidth := A_ScreenWidthWA > 2000 ? A_ScreenWidthWA * 0.75 : windowWidth
WinMove, %windowName%, , (A_ScreenWidthWA - windowWidth) / 2, topMargin, windowWidth, windowHeight
}
ShortBind(ahk_exe, start_path, fullscreen=false) {
if !WinExist(ahk_exe) {
Run, %start_path%
TrayTip Starting, Starting %ahk_exe%
}
WinActivate, %ahk_exe%
if(fullscreen) {
WinGetPos,,,W,H,A
if (W < A_ScreenWidthWA || H < A_ScreenHeightWA) {
Send !{Enter}
}
} else {
CenterActiveWindow()
}
}
;GistID: 1298e99da93ad857d77e737cd0f03716
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment