Coder Social home page Coder Social logo

windows10desktopmanager's Introduction

Windows 10 Virtual Desktop Manager

An autohotkey desktop manager


Description

If you have moved to Windows 10 already then you have to make use of the new Virtual desktop environment! Unfortunately Windows is lacking a few keyboard shortcuts such as jumping to a specific desktop and moving programs to another desktop. This script is designed to fill that hole by providing an easy way customisable hotkeys for all your virtual desktop managing needs.

Requirements

The script requires both a 32 and 64 bit version of the Autohotkey executable to reliably send windows to other desktops. Download the latest installer from the official Autohotkey website https://autohotkey.com/. The DLL's that are used to move windows to other desktops come from this project https://github.com/jpginc/MoveToDesktop

Setup

Clone this Repo and run windows10.ahk. Inside windows10.ahk is a default setup that you can use or edit. The JPGIncDesktopManagerClass has the following functions to setup hotkeys. Each of the following functions take a string representing a hotkey (see https://autohotkey.com/docs/Hotkeys.htm for more information about hotkeys).

  • setGoToNextDesktop(hotkey)
  • setGoToPreviousDesktop(hotkey)
  • setMoveWindowToNextDesktop(hotkey)
  • setMoveWindowToPreviousDesktop(hotkey)
  • setCloseDesktop(hotkey)
  • setNewDesktop(hotkey)

The following functions take a hotkey that will be combined with numbers 0 - 9 for quickly switching to a virtual desktop. As such the hotkey cannot be a custom hotkey (https://autohotkey.com/docs/Hotkeys.htm#Features)

  • setGoToDesktop(hotkey)
  • setMoveWindowToDesktop(hotkey)

These two functions accept either a function name, a label name, a class name with a "call" function on the class. It can also be a func object (https://autohotkey.com/docs/objects/Func.htm).

  • afterGoToDesktop(name)
  • afterMoveWindowToDesktop(name)

You can also set the window manager to switch to the desktop after moving a window to it. By default you won't follow moving a window to another desktop.

  • followToDesktopAfterMovingWindow(bool default is false)

windows10desktopmanager's People

Contributors

bits-of-static avatar jpginc avatar jpgincgithub avatar jpgincus avatar kronik907 avatar tyde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows10desktopmanager's Issues

move window to desktop doesn't work on command shell

Windows 10 Home 64 bit

When current window is a command shell (cmd.exe) move window to next/previous desktop and move window to desktop # do not work. Command shell does not move, desktop does not switch. Works correctly on all other application windows.

Move to next/previous desktop and move to desktop # work correctly with all windows, including cmd.exe.

I see the autohotkey icon appear briefly in the task bar, so I suspect the key strokes are being picked up. Maybe an issue with getting the window handle?

Follow to desktop not working

I'm using windows10DesktopManager on my old laptop with the following modified lines in windows10.ahk:

globalDesktopManager.setGoToDesktop("<^<#")	; LCtrl+LWin+[1-9]	- Go to desktop number [1-9] 
    .setMoveWindowToDesktop("<^<!")    		; LCtrl+LAlt+[1-9]	- Move active window & go to desktop number [1-9] 
    .setMoveWindowToNextDesktop("<^<!right")	; LCtrl+LAlt+Right	- Move active window to next desktop 
    .setMoveWindowToPreviousDesktop("<^<!left")	; LCtrl+LAlt+Left	- Move active window to previous desktop
    .setCloseDesktop("<^<#<+x")			; LCtrl+LWin+LShift+X	- Close current desktop
	.setNewDesktop("<^<#<+n")		; LCtrl+LWin+LShift+N	- Create new desktop
    .followToDesktopAfterMovingWindow(true)

This uses Ctrl + Alt + [Left/Right] to move windows to previous/next desktop and it follows the window when it moves.

However, for some reason, when I tried to use this same set up on my new laptop, it won't follow the window when the window moves.

Both laptops are running 64bit Windows 10 and both have windows10.ahk modified in the same way. As far as I'm aware everything else is the same.

I tried forcing windowMover.ahk to follow on move by changing:
followToNewDesktop := false to followToNewDesktop := true
and
follow := false to follow := true
wherever they appear, but that didn't help so I reverted back to the original.

Extra info: I've also tried using different combos of keys. E.g.

  • the original "Capslock & s",
  • "LCtrl & LShift & Left", also written as "<^<+left",
  • "LCtrl & LShift & LAlt & Left" also written as "<^<+<!left",
    None of these work either.
    And, in the original script, you had semi-colon, tilde, space ;~ in front of .followToDesktopAfterMovingWindow(true)... I know semi-colon is used to comment lines out but I'm not sure what the tilde does so, when I uncommented the line, I tried running the script with tilde included and with it removed. Neither version worked.

Can you suggest what might be wrong with my set up and/or how to fix it?

Thanks

add tests somehow

I keep breaking things, i might not break them if there were tests...

Windows 7 support

does it work with windows 7? do we will have a lot of trouble to make it work in windows 7?

win+tab view not working correctly

The desktops view (win+tab) doesn't behave as expected, for instance after switching desktops, if there is at least 1 window on the destination desktop, the desktop view is closed (probably because of some alt+tab being triggered).

Can't Use Ctrl + Win + Shift Modifier Keys

Maybe I'm understanding the hotkeys wrong, but I believe the below should allow me to do a Ctrl+Win+Shift + right/left to move the windows either right or left.

.setMoveWindowToNextDesktop("^+# & >")
.setMoveWindowToPreviousDesktop("^+# & <")

Unfortunately I get an error saying "^+#" is not a valid key name.

How to add this script in the autostart programs?

I tried compiling the script but the dlls and other ahk scripts don't get into the final binary, also tried dumping the whole thing in the start up folder but the closest I got was after only having the windows10.ahk in the startup folder and move other files into the %appdata% root and import them dynamically with %A_AppData%/... but this only had a problem with this line because during the actual boot/startup the dll/dllCaller.ahk is somehow not read from the same directory instead it tries to get the reference/import from some folder in system32 folder.

run, AutoHotkeyU32.exe "injection dll/dllCaller.ahk" "%myPID%" "32", , useerrorlevel, 32BitPID

switching desktops shows glitches

When switching between virtual desktops a few gliches appear, I guess related to the fact that the script goes throught the task switcher window to switch desktop.
The implementation here https://github.com/pmb6tz/windows-desktop-switcher uses a different approach where it just iterates over desktops, the amount of glitches is reduced to a few frames that can show the content of desktops in between the starting one and the target one. Maybe you can consider using that one instead?

retain focus on windows

It would be great if there was an option to remember the active window before switching at every desktop, so it would be focused once switched back.
I assume a simple alt+tab won't work, since it produces unexpected behaviour at rapid switching. You would probably need to store some window UUIDs, assuming that's doable.

Explorer windows still tend to get incorrect focus

Not a major issue, nonetheless pretty annoying in the daily workflow - if there are many explorer windows and the user switches screens a few times it often happens that the wrong one gets focus (especially on "my computer").

Is there no way to remember window handles and set focus accordingly (alt+tab is also quite visible and ugly)?

Make source code available for injection DLL

My reservation about using this project is not knowing what the "injection DLL" does. It is odd that the AutoHotkey scripts are available as open source but not the source for this DLL.

It would be great it you could share the source for this DLL.

Detect Virtual Desktop location of a given WinTitle

Hello, first of all, thanks for your script. I would like to ask if it could be possible with your library to detect the index of the Virtual Desktop hosting a certain window identified through WinTitle (for example, by providing its ahk_id, or ahk_exe, etc.).

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.