SaaSHub helps you find the best software and product alternatives Learn more →
Windows-desktop-switcher Alternatives
Similar projects and alternatives to windows-desktop-switcher
-
win-10-virtual-desktop-enhancer
Discontinued An application that enhances the Windows 10 multiple desktops feature by adding additional keyboard shortcuts and support for multiple wallpapers.
-
AutoHotkey-Virtual-Desktops
This is a library plus a DLL that allows one to control Windows 10 Virtual Desktops using AutoHotkey.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
VirtualDesktopAccessor
DLL for accessing Windows 11/10 Virtual Desktop features from e.g. AutoHotkey (by Ciantic)
windows-desktop-switcher reviews and mentions
-
Switch between Virtual Desktops with Keyboard while using Remote Desktop
If you wanna use autohotkey, I personally use this script but heavily modify it to use my own keybinds: https://github.com/pmb6tz/windows-desktop-switcher
-
I'm trying to convert this virtual desktop switcher script to v2, it's the only thing holding be back to v1 right now
#SingleInstance Force ; The script will Reload if launched while already running KeyHistory(0) ; Ensures user privacy when debugging is not needed SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory SendMode("Input") ; Recommended for new scripts due to its superior speed and reliability ; Globals DesktopCount := 2 ; Windows starts with 2 desktops at boot CurrentDesktop := 1 ; Desktop count is 1-indexed (Microsoft numbers them this way) LastOpenedDesktop := 1 ; DLL hVirtualDesktopAccessor := DllCall("LoadLibrary", "Str", A_ScriptDir . "\VirtualDesktopAccessor.dll", "Ptr") global IsWindowOnDesktopNumberProc := DllCall("GetProcAddress", "Ptr", hVirtualDesktopAccessor, "AStr", "IsWindowOnDesktopNumber", "Ptr") global MoveWindowToDesktopNumberProc := DllCall("GetProcAddress", "Ptr", hVirtualDesktopAccessor, "AStr", "MoveWindowToDesktopNumber", "Ptr") ; Main SetKeyDelay(75) mapDesktopsFromRegistry() OutputDebug("[loading] desktops: " DesktopCount " current: " CurrentDesktop) ;#Include %A_ScriptDir%\user_config.ahk return ; ; This function examines the registry to build an accurate list of the current virtual desktops and which one we're currently on. ; List of desktops appears to be in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops ; On Windows 11 the current desktop UUID appears to be in the same location ; On previous versions in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SessionInfo\1\VirtualDesktops ; mapDesktopsFromRegistry() { global CurrentDesktop, DesktopCount ; Get the current desktop UUID. Length should be 32 always, but there's no guarantee this couldn't change in a later Windows release so we check. IdLength := 32 SessionId := getSessionId() if (SessionId) { CurrentDesktopId := RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops", "CurrentVirtualDesktop") if ErrorLevel { CurrentDesktopId := RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SessionInfo\" SessionId "\VirtualDesktops", "CurrentVirtualDesktop") } if (CurrentDesktopId) { IdLength := StrLen(CurrentDesktopId) } } ; Get a list of the UUIDs for all virtual desktops on the system DesktopList := RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops", "VirtualDesktopIDs") if (DesktopList) { DesktopListLength := StrLen(DesktopList) ; Figure out how many virtual desktops there are DesktopCount := floor(DesktopListLength / IdLength) } else { DesktopCount := 1 } ; Parse the REG_DATA string that stores the array of UUID's for virtual desktops in the registry. i := 0 while (CurrentDesktopId and i < DesktopCount) { StartPos := (i * IdLength) + 1 DesktopIter := SubStr(DesktopList, (StartPos)<1 ? (StartPos)-1 : (StartPos), IdLength) OutputDebug("The iterator is pointing at " DesktopIter " and count is " i ".") ; Break out if we find a match in the list. If we didn't find anything, keep the ; old guess and pray we're still correct :-D. if (DesktopIter = CurrentDesktopId) { CurrentDesktop := i + 1 OutputDebug("Current desktop number is " CurrentDesktop " with an ID of " DesktopIter ".") break } i++ } } ; ; This functions finds out ID of current session. ; getSessionId() { ProcessId := DllCall("GetCurrentProcessId", "UInt") if ErrorLevel { OutputDebug("Error getting current process id: " ErrorLevel) return } OutputDebug("Current Process Id: " ProcessId) DllCall("ProcessIdToSessionId", "UInt", ProcessId, "UInt*", &SessionId) if ErrorLevel { OutputDebug("Error getting session id: " ErrorLevel) return } OutputDebug("Current Session Id: " SessionId) return SessionId } _switchDesktopToTarget(targetDesktop) { ; Globals variables should have been updated via updateGlobalVariables() prior to entering this function global CurrentDesktop, DesktopCount, LastOpenedDesktop ; Don't attempt to switch to an invalid desktop if (targetDesktop > DesktopCount || targetDesktop < 1 || targetDesktop == CurrentDesktop) { OutputDebug("[invalid] target: " targetDesktop " current: " CurrentDesktop) return } LastOpenedDesktop := CurrentDesktop ; Fixes the issue of active windows in intermediate desktops capturing the switch shortcut and therefore delaying or stopping the switching sequence. This also fixes the flashing window button after switching in the taskbar. More info: https://github.com/pmb6tz/windows-desktop-switcher/pull/19 WinActivate("ahk_class Shell_TrayWnd") ; Go right until we reach the desktop we want while(CurrentDesktop < targetDesktop) { Send("{LWin down}{LCtrl down}{Right down}{LWin up}{LCtrl up}{Right up}") CurrentDesktop++ OutputDebug("[right] target: " targetDesktop " current: " CurrentDesktop) } ; Go left until we reach the desktop we want while(CurrentDesktop > targetDesktop) { Send("{LWin down}{LCtrl down}{Left down}{Lwin up}{LCtrl up}{Left up}") CurrentDesktop-- OutputDebug("[left] target: " targetDesktop " current: " CurrentDesktop) } ; Makes the WinActivate fix less intrusive Sleep(50) focusTheForemostWindow(targetDesktop) } updateGlobalVariables() { ; Re-generate the list of desktops and where we fit in that. We do this because ; the user may have switched desktops via some other means than the script. mapDesktopsFromRegistry() } switchDesktopByNumber(targetDesktop) { global CurrentDesktop, DesktopCount updateGlobalVariables() _switchDesktopToTarget(targetDesktop) } switchDesktopToLastOpened() { global CurrentDesktop, DesktopCount, LastOpenedDesktop updateGlobalVariables() _switchDesktopToTarget(LastOpenedDesktop) } switchDesktopToRight() { global CurrentDesktop, DesktopCount updateGlobalVariables() _switchDesktopToTarget(CurrentDesktop == DesktopCount ? 1 : CurrentDesktop + 1) } switchDesktopToLeft() { global CurrentDesktop, DesktopCount updateGlobalVariables() _switchDesktopToTarget(CurrentDesktop == 1 ? DesktopCount : CurrentDesktop - 1) } focusTheForemostWindow(targetDesktop) { foremostWindowId := getForemostWindowIdOnDesktop(targetDesktop) if isWindowNonMinimized(foremostWindowId) { WinActivate("ahk_id " foremostWindowId) } } isWindowNonMinimized(windowId) { MMX := WinGetMinMax("ahk_id " windowId) return MMX != -1 } getForemostWindowIdOnDesktop(n) { n := n - 1 ; Desktops start at 0, while in script it's 1 ; winIDList contains a list of windows IDs ordered from the top to the bottom for each desktop. owinIDList := WinGetlist(,,,) awinIDList := Array() winIDList := owinIDList.Length For v in owinIDList { awinIDList.Push(v) } Loop awinIDList.Length { windowID := awinIDList[A_Index] windowIsOnDesktop := DllCall(IsWindowOnDesktopNumberProc, "UInt", windowID, "UInt", n) ; Select the first (and foremost) window which is in the specified desktop. if (windowIsOnDesktop == 1) { return windowID } } } MoveCurrentWindowToDesktop(desktopNumber) { activeHwnd := WinGetID("A") DllCall(MoveWindowToDesktopNumberProc, "UInt", activeHwnd, "UInt", desktopNumber - 1) switchDesktopByNumber(desktopNumber) } MoveCurrentWindowToRightDesktop() { global CurrentDesktop, DesktopCount updateGlobalVariables() activeHwnd := WinGetID("A") DllCall(MoveWindowToDesktopNumberProc, "UInt", activeHwnd, "UInt", (CurrentDesktop == DesktopCount ? 1 : CurrentDesktop + 1) - 1) _switchDesktopToTarget(CurrentDesktop == DesktopCount ? 1 : CurrentDesktop + 1) } MoveCurrentWindowToLeftDesktop() { global CurrentDesktop, DesktopCount updateGlobalVariables() activeHwnd := WinGetID("A") DllCall(MoveWindowToDesktopNumberProc, "UInt", activeHwnd, "UInt", (CurrentDesktop == 1 ? DesktopCount : CurrentDesktop - 1) - 1) _switchDesktopToTarget(CurrentDesktop == 1 ? DesktopCount : CurrentDesktop - 1) } ; ; This function creates a new virtual desktop and switches to it ; createVirtualDesktop() { global CurrentDesktop, DesktopCount Send("#^d") DesktopCount++ CurrentDesktop := DesktopCount OutputDebug("[create] desktops: " DesktopCount " current: " CurrentDesktop) } ; ; This function deletes the current virtual desktop ; deleteVirtualDesktop() { global CurrentDesktop, DesktopCount, LastOpenedDesktop Send("#^{F4}") if (LastOpenedDesktop >= CurrentDesktop) { LastOpenedDesktop-- } DesktopCount-- CurrentDesktop-- OutputDebug("[delete] desktops: " DesktopCount " current: " CurrentDesktop) } ; Switcher Options ; ----------------------------------------------- ^!1::switchDesktopByNumber(1) ^!2::switchDesktopByNumber(2) ^!3::switchDesktopByNumber(3) ^!4::switchDesktopByNumber(4) ^!5::switchDesktopByNumber(5) ^!6::switchDesktopByNumber(6) ^!7::switchDesktopByNumber(7) ^!8::switchDesktopByNumber(8) ^!9::switchDesktopByNumber(9) ^!Numpad1::switchDesktopByNumber(1) ^!Numpad2::switchDesktopByNumber(2) ^!Numpad3::switchDesktopByNumber(3) ^!Numpad4::switchDesktopByNumber(4) ^!Numpad5::switchDesktopByNumber(5) ^!Numpad6::switchDesktopByNumber(6) ^!Numpad7::switchDesktopByNumber(7) ^!Numpad8::switchDesktopByNumber(8) ^!Numpad9::switchDesktopByNumber(9) ^!n::switchDesktopToRight() ^!p::switchDesktopToLeft() ^!s::switchDesktopToRight() ^!a::switchDesktopToLeft() ^!tab::switchDesktopToLastOpened() ^!c::createVirtualDesktop() ^!d::deleteVirtualDesktop() ^#Ins::MoveCurrentWindowToDesktop(1) ^#PgUp::MoveCurrentWindowToDesktop(2) ^#Home::MoveCurrentWindowToDesktop(3) ^#End::MoveCurrentWindowToDesktop(4) ^#PgDn::MoveCurrentWindowToDesktop(5) ^#F6::MoveCurrentWindowToDesktop(6) ^#F7::MoveCurrentWindowToDesktop(7) ^#F8::MoveCurrentWindowToDesktop(8) ^#F9::MoveCurrentWindowToDesktop(9) ^#Numpad1::MoveCurrentWindowToDesktop(1) ^#Numpad2::MoveCurrentWindowToDesktop(2) ^#Numpad3::MoveCurrentWindowToDesktop(3) ^#Numpad4::MoveCurrentWindowToDesktop(4) ^#Numpad5::MoveCurrentWindowToDesktop(5) ^#Numpad6::MoveCurrentWindowToDesktop(6) ^#Numpad7::MoveCurrentWindowToDesktop(7) ^#Numpad8::MoveCurrentWindowToDesktop(8) ^#Numpad9::MoveCurrentWindowToDesktop(9) ^#Right::MoveCurrentWindowToRightDesktop() ^#Left::MoveCurrentWindowToLeftDesktop() ; === INSTRUCTIONS === ; Additional alternative shortcut for moving current window to left or right desktop (ctrl+shift+Win+left/right) ; === END OF INSTRUCTIONS === ; ^#+Right::MoveCurrentWindowToRightDesktop() ; ^#+Left::MoveCurrentWindowToLeftDesktop()
-
Trying to get my calculator button to start the calc or focus it if an instance is already running
But I guess I need to do some research into how to do that, or how to convert this desktop switcher script into v2.
-
i'm using a script which switches virtual desktop, but I dont wan't taskbar to display?
#SingleInstance Force ; The script will Reload if launched while already running #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases #KeyHistory 0 ; Ensures user privacy when debugging is not needed SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory SendMode Input ; Recommended for new scripts due to its superior speed and reliability ; Globals DesktopCount := 2 ; Windows starts with 2 desktops at boot CurrentDesktop := 1 ; Desktop count is 1-indexed (Microsoft numbers them this way) LastOpenedDesktop := 1 ; DLL hVirtualDesktopAccessor := DllCall("LoadLibrary", "Str", A_ScriptDir . "\VirtualDesktopAccessor.dll", "Ptr") global IsWindowOnDesktopNumberProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "IsWindowOnDesktopNumber", "Ptr") global MoveWindowToDesktopNumberProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "MoveWindowToDesktopNumber", "Ptr") ; Main SetKeyDelay, 75 mapDesktopsFromRegistry() OutputDebug, [loading] desktops: %DesktopCount% current: %CurrentDesktop% #Include %A_ScriptDir%\user_config.ahk return ; ; This function examines the registry to build an accurate list of the current virtual desktops and which one we're currently on. ; Current desktop UUID appears to be in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SessionInfo\1\VirtualDesktops ; List of desktops appears to be in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops ; mapDesktopsFromRegistry() { global CurrentDesktop, DesktopCount ; Get the current desktop UUID. Length should be 32 always, but there's no guarantee this couldn't change in a later Windows release so we check. IdLength := 32 SessionId := getSessionId() if (SessionId) { RegRead, CurrentDesktopId, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SessionInfo\%SessionId%\VirtualDesktops, CurrentVirtualDesktop if (CurrentDesktopId) { IdLength := StrLen(CurrentDesktopId) } } ; Get a list of the UUIDs for all virtual desktops on the system RegRead, DesktopList, HKEY_CURRENT_USER, SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops, VirtualDesktopIDs if (DesktopList) { DesktopListLength := StrLen(DesktopList) ; Figure out how many virtual desktops there are DesktopCount := floor(DesktopListLength / IdLength) } else { DesktopCount := 1 } ; Parse the REG_DATA string that stores the array of UUID's for virtual desktops in the registry. i := 0 while (CurrentDesktopId and i < DesktopCount) { StartPos := (i * IdLength) + 1 DesktopIter := SubStr(DesktopList, StartPos, IdLength) OutputDebug, The iterator is pointing at %DesktopIter% and count is %i%. ; Break out if we find a match in the list. If we didn't find anything, keep the ; old guess and pray we're still correct :-D. if (DesktopIter = CurrentDesktopId) { CurrentDesktop := i + 1 OutputDebug, Current desktop number is %CurrentDesktop% with an ID of %DesktopIter%. break } i++ } } ; ; This functions finds out ID of current session. ; getSessionId() { ProcessId := DllCall("GetCurrentProcessId", "UInt") if ErrorLevel { OutputDebug, Error getting current process id: %ErrorLevel% return } OutputDebug, Current Process Id: %ProcessId% DllCall("ProcessIdToSessionId", "UInt", ProcessId, "UInt*", SessionId) if ErrorLevel { OutputDebug, Error getting session id: %ErrorLevel% return } OutputDebug, Current Session Id: %SessionId% return SessionId } _switchDesktopToTarget(targetDesktop) { ; Globals variables should have been updated via updateGlobalVariables() prior to entering this function global CurrentDesktop, DesktopCount, LastOpenedDesktop ; Don't attempt to switch to an invalid desktop if (targetDesktop > DesktopCount || targetDesktop < 1 || targetDesktop == CurrentDesktop) { OutputDebug, [invalid] target: %targetDesktop% current: %CurrentDesktop% return } LastOpenedDesktop := CurrentDesktop ; Fixes the issue of active windows in intermediate desktops capturing the switch shortcut and therefore delaying or stopping the switching sequence. This also fixes the flashing window button after switching in the taskbar. More info: https://github.com/pmb6tz/windows-desktop-switcher/pull/19 WinActivate, ahk_class Shell_TrayWnd ; Go right until we reach the desktop we want while(CurrentDesktop < targetDesktop) { Send {LWin down}{LCtrl down}{Right down}{LWin up}{LCtrl up}{Right up} CurrentDesktop++ OutputDebug, [right] target: %targetDesktop% current: %CurrentDesktop% } ; Go left until we reach the desktop we want while(CurrentDesktop > targetDesktop) { Send {LWin down}{LCtrl down}{Left down}{Lwin up}{LCtrl up}{Left up} CurrentDesktop-- OutputDebug, [left] target: %targetDesktop% current: %CurrentDesktop% } ; Makes the WinActivate fix less intrusive Sleep, 50 focusTheForemostWindow(targetDesktop) } updateGlobalVariables() { ; Re-generate the list of desktops and where we fit in that. We do this because ; the user may have switched desktops via some other means than the script. mapDesktopsFromRegistry() } switchDesktopByNumber(targetDesktop) { global CurrentDesktop, DesktopCount updateGlobalVariables() _switchDesktopToTarget(targetDesktop) } switchDesktopToLastOpened() { global CurrentDesktop, DesktopCount, LastOpenedDesktop updateGlobalVariables() _switchDesktopToTarget(LastOpenedDesktop) } switchDesktopToRight() { global CurrentDesktop, DesktopCount updateGlobalVariables() _switchDesktopToTarget(CurrentDesktop == DesktopCount ? 1 : CurrentDesktop + 1) } switchDesktopToLeft() { global CurrentDesktop, DesktopCount updateGlobalVariables() _switchDesktopToTarget(CurrentDesktop == 1 ? DesktopCount : CurrentDesktop - 1) } focusTheForemostWindow(targetDesktop) { foremostWindowId := getForemostWindowIdOnDesktop(targetDesktop) if isWindowNonMinimized(foremostWindowId) { WinActivate, ahk_id %foremostWindowId% } } isWindowNonMinimized(windowId) { WinGet MMX, MinMax, ahk_id %windowId% return MMX != -1 } getForemostWindowIdOnDesktop(n) { n := n - 1 ; Desktops start at 0, while in script it's 1 ; winIDList contains a list of windows IDs ordered from the top to the bottom for each desktop. WinGet winIDList, list Loop % winIDList { windowID := % winIDList%A_Index% windowIsOnDesktop := DllCall(IsWindowOnDesktopNumberProc, UInt, windowID, UInt, n) ; Select the first (and foremost) window which is in the specified desktop. if (windowIsOnDesktop == 1) { return windowID } } } MoveCurrentWindowToDesktop(desktopNumber) { WinGet, activeHwnd, ID, A DllCall(MoveWindowToDesktopNumberProc, UInt, activeHwnd, UInt, desktopNumber - 1) switchDesktopByNumber(desktopNumber) } ; ; This function creates a new virtual desktop and switches to it ; createVirtualDesktop() { global CurrentDesktop, DesktopCount Send, #^d DesktopCount++ CurrentDesktop := DesktopCount OutputDebug, [create] desktops: %DesktopCount% current: %CurrentDesktop% } ; ; This function deletes the current virtual desktop ; deleteVirtualDesktop() { global CurrentDesktop, DesktopCount, LastOpenedDesktop Send, #^{F4} if (LastOpenedDesktop >= CurrentDesktop) { LastOpenedDesktop-- } DesktopCount-- CurrentDesktop-- OutputDebug, [delete] desktops: %DesktopCount% current: %CurrentDesktop% }
-
Is there a way to jump to a specific virtual desktop?
There is actually one and I'm using it for months. It works on windows 10 and windows 11. You just need to download autohotkey. Head on to this github link: https://github.com/pmb6tz/windows-desktop-switcher.
-
Is it possible to have an automatic split screen divide on a single screen?
You can try desktop switcher which made my virtual desktop experience efficient. It lets you quickly jump from desktop 1 to desktop 5 with just keyboard shortcut. https://github.com/pmb6tz/windows-desktop-switcher
-
Virtual Desktop Switcher works with Windows 11
I just updated to windows 11 yesterday. Most of my programs and autohotkey scripts works except the windows desktop switcher. Moving app windows to another desktop doesn't work. I searched around the github and found that some people also experience this problem. Then I found this comment. I just downloaded the file and replace it to the parent file of the AHK Script and it works!
-
Be more efficient using virtual desktops with this autohotkey script
windows-desktop-switcher
-
Add taskbar desktop switcher hover style and animation to taskbar apps
I found this cool project on github which let you switch different virtual desktop quickly. https://github.com/pmb6tz/windows-desktop-switcher
-
Window does not auto-focus to foreground upon changing virtual desktops
I use this amazing script to assign a Virtual Desktop number to a key command so that I can quickly switch to Desktop 2 using Alt+2, for example. However, I'm having a problem where, after pressing the key command to switch Desktops, the only window on that desktop is in the BACKGROUND and requires alt+tab or clicking on the window to bring it to the foreground.
-
A note from our sponsor - SaaSHub
www.saashub.com | 2 May 2024
Stats
pmb6tz/windows-desktop-switcher is an open source project licensed under MIT License which is an OSI approved license.
The primary programming language of windows-desktop-switcher is AutoHotkey.
Sponsored