Skip to content

Instantly share code, notes, and snippets.

@hizkifw
Created June 18, 2024 03:54
Show Gist options
  • Save hizkifw/72dd47cd5b5d15d870e2a4c9ffa28edc to your computer and use it in GitHub Desktop.
Save hizkifw/72dd47cd5b5d15d870e2a4c9ffa28edc to your computer and use it in GitHub Desktop.
AutoHotKey script for virtual desktop management
; Set the name or path of the executable
; https://github.com/MScholtes/VirtualDesktop
Global virtualDesktopExe := "VirtualDesktop11.exe"
SwitchDesktop(desktopNum) {
Run, %virtualDesktopExe% /Switch:%desktopNum%,, Hide
}
MoveWindowToDesktop(desktopNum) {
Run, %virtualDesktopExe% /GetDesktop:%desktopNum% /MoveActiveWindow,, Hide
}
; Keyboard shortcuts for switching desktops (Alt+0..9)
!1::SwitchDesktop(0)
!2::SwitchDesktop(1)
!3::SwitchDesktop(2)
!4::SwitchDesktop(3)
!5::SwitchDesktop(4)
!6::SwitchDesktop(5)
!7::SwitchDesktop(6)
!8::SwitchDesktop(7)
!9::SwitchDesktop(8)
!0::SwitchDesktop(9)
; Keyboard shortcuts for moving active window to desktops (ALt+Shift+0..9)
!+1::MoveWindowToDesktop(0)
!+2::MoveWindowToDesktop(1)
!+3::MoveWindowToDesktop(2)
!+4::MoveWindowToDesktop(3)
!+5::MoveWindowToDesktop(4)
!+6::MoveWindowToDesktop(5)
!+7::MoveWindowToDesktop(6)
!+8::MoveWindowToDesktop(7)
!+9::MoveWindowToDesktop(8)
!+0::MoveWindowToDesktop(9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment