Skip to content
This repository has been archived by the owner on Dec 23, 2018. It is now read-only.

Commit

Permalink
Merge pull request #25 from sdias/window-and-app-pinning
Browse files Browse the repository at this point in the history
Added window pinning, reworked some keyboard shortcuts settings, improved validation, etc.
  • Loading branch information
sdias authored Feb 25, 2017
2 parents 9384b83 + 62367fb commit 04c6c4a
Show file tree
Hide file tree
Showing 3 changed files with 254 additions and 110 deletions.
83 changes: 71 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Windows 10 Virtual Desktop Enhancer
This application enhances the Windows 10 virtual desktops feature. It makes available the following new features:

- Extra customizable keyboard shortcuts to switch or move a window to a different desktop.
- Customizable keyboard shortcuts to pin a window/all windows for an app to all desktops.
- Custom wallpaper per virtual desktop (either a picture or a solid color).
- Current desktop indicator in the tray area.
- Custom desktop names.
Expand Down Expand Up @@ -118,32 +119,55 @@ It draws tooltips at the center of the screen, in a white, bold and small font,

### Keyboard Shortcuts

There are several actions available that can be bound to keyboard shortcuts. These are:
This app allows you to configure your own keyboard shortcuts to perform various actions.

The following actions are executed in the context of a virtual desktop:
* Switching to another desktop
* Moving the current window to another desktop
* Moving the current window to another desktop and then switch to that desktop
* Affect the next 10 desktops instead, for any of the actions above
* Do any of the actions above, but relative to the next 10 desktops instead (more details below)

For each of these actions, you can set modifier keys (a combination of one or more keys, out of the `Ctrl`, `Shift`, `Alt` and `Win` keys) and identifier keys (keys to identify the context of the action).
For example: if you want to set up a keyboard shortcut to be able to switch to the next desktop, you need to set up the modifier keys for "switch to another desktop" (for example, `Ctrl + Win`), and also set up the identifier key for "next desktop" (for example, `Right Arrow`).

The following actions are not executed in the context of a virtual desktop:
* Open the desktop manager
* Pin the currently visible window, which makes it visible in all of the virtual desktops
* Unpin the currently visible window
* Pin the current visible app, which makes all of the windows of that app visible in all of the virtual desktops
* Unpin the currently visible app
* Toggle pin on the currently visible window
* Toggle pin on the currently visible app

For each of these actions, you can set a combination of zero or more modifiers (as before), as well a regular key.
For example: if you want to set up a keyboard shortcut to be able to pin the current window, you just need to set up that combination (for example, `Win + Ctrl + Q`).

These are the available keyboard shortcut settings:

| Section | Name | Description |
| - | - | - |
| KeyboardShortcutsModifiers | SwitchDesktop | Switch to a desktop. |
| KeyboardShortcutsModifiers | MoveWindowToDesktop | Move the current window to another desktop. |
| KeyboardShortcutsModifiers | MoveWindowAndSwitchToDesktop | Move the current window to another desktop, and switch to it. |
| KeyboardShortcutsModifiers | NextTenDesktops | If doing any of the actions above and targetting a specific desktop (ex: Switch to desktop no. 3) it instead targets the desktop that comes 10 desktops after that one (ex: Switch to desktop no. 13 instead of no. 3). Note that this modifier is works together with the modifiers above. |
| KeyboardShortcutsIdentifiers | PreviousDesktop | Do the action for the previous desktop. |
| KeyboardShortcutsIdentifiers | NextDesktop | Do the action for the next desktop. |
| Section | Name | Description |
| - | - | - |
| KeyboardShortcutsModifiers | SwitchDesktop | Switch to a desktop. |
| KeyboardShortcutsModifiers | MoveWindowToDesktop | Move the current window to another desktop. |
| KeyboardShortcutsModifiers | MoveWindowAndSwitchToDesktop | Move the current window to another desktop, and switch to it. |
| KeyboardShortcutsModifiers | NextTenDesktops | If doing any of the actions above and targetting a specific desktop (ex: Switch to desktop no. 3) it instead targets the desktop that comes 10 desktops after that one (ex: Switch to desktop no. 13 instead of no. 3). Note that this modifier is works together with the modifiers above. |
| KeyboardShortcutsIdentifiers | PreviousDesktop | Do the action for the previous desktop. |
| KeyboardShortcutsIdentifiers | NextDesktop | Do the action for the next desktop. |
| KeyboardShortcutsCombinations | OpenDesktopManager | Open the desktop manager. |
| KeyboardShortcutsCombinations | TogglePinWindow | Toggle pin on the current window. |
| KeyboardShortcutsCombinations | TogglePinApp | Toggle pin on all of the windows of the currently opened app. |
| KeyboardShortcutsCombinations | PinWindow | Pin the current window. |
| KeyboardShortcutsCombinations | PinApp | Pin all of the windows of the currently opened app. |
| KeyboardShortcutsCombinations | UnpinWindow | Unpin the current window. |
| KeyboardShortcutsCombinations | UnpinApp | Unpin all of the windows of the currently opened app. |

In addition to the configurable identifier keys, the number keys above the letters on your keyboard also act as identifier keys, and each targets a specific desktop (from Desktop 1 to 10, unless the "NextTenDesktops" modifier is pressed, which will make them target Desktop 11 to 20 instead).

Each modifier keys' setting can be a combination of the `Ctrl`, `Shift`, `Alt`, `Win` keys, separated by commas. For each key, you can use the left or right variant of the keys specifically, by adding `L` or `R` before the name of the key (ex: `LCtrl`), otherwise both can be used. See below for examples.

Each identifier keys' setting can be single key of your keyboard. [They can be set to any value in this page (except modifiers)](https://www.autohotkey.com/docs/KeyList.htm). See below for examples.

Each combination keys' setting can follows the same rules as the modifier keys' settings, but in addition to that you need to add a single non-modifier key to the end, in the same format as described for the identifier keys' settings. See below for examples.

Also note that if the setting is set to empty or not set at all, the feature will be disabled.

Here are some examples with different configs:
Expand All @@ -161,6 +185,16 @@ NextTenDesktops=
[KeyboardShortcutsIdentifiers]
PreviousDesktop=Left
NextDesktop=Right

[KeyboardShortcutsCombinations]
TogglePinWindow=LAlt, Shift, Ctrl, Q
TogglePinApp=LAlt, Shift, Ctrl, A
PinWindow=
PinApp=
UnpinWindow=
UnpinApp=
; "SC029" is the key below your "Esc" key
OpenDesktopManager=LAlt, SC029
</pre>

The following shortcuts are available:
Expand All @@ -173,10 +207,16 @@ The following shortcuts are available:
| Move the current window to next/previous desktop | Left Alt + Shift + Ctrl + (Left/Right Arrow) |
| Move the current window to desktop by number and switch to it | Left Alt + Shift + (0-9) |
| Move the current window to next/previous desktop and switch to it | Left Alt + Shift + (Left/Right Arrow) |
| Open Desktop Manager | Left Alt + (key under Esc) |
| Switch to desktop by number (desktops 11-20) | Disabled |
| Move the current window to desktop by number (desktops 11-20) | Disabled |
| Move the current window to desktop by number and switch to it (desktops 11-20) | Disabled |
| Pin/unpin (toggle) current <u>window</u> | Left Alt + Shift + Ctrl + Q |
| Pin/unpin (toggle) current <u>app</u> | Left Alt + Shift + Ctrl + A |
| Pin current window to all desktops | Disabled |
| Pin current app to all desktops | Disabled |
| Unpin current window from all desktops | Disabled |
| Unpin current app from all desktops | Disabled |
| Open Desktop Manager | Left Alt + (key under Esc) |

#### Behavior with custom config

Expand All @@ -191,6 +231,15 @@ NextTenDesktops=LShift
[KeyboardShortcutsIdentifiers]
PreviousDesktop=PgUp
NextDesktop=PgDn

[KeyboardShortcutsCombinations]
TogglePinWindow=
TogglePinApp=
PinWindow=
PinApp=
UnpinWindow=
UnpinApp=
OpenDesktopManager=
</pre>

The following shortcuts are available:
Expand All @@ -207,6 +256,13 @@ The following shortcuts are available:
| Switch to desktop by number (desktops 11-20) | Left Win + Left Shift + (0-9) |
| Move the current window to desktop by number (desktops 11-20) | Disabled |
| Move the current window to desktop by number and switch to it (desktops 11-20) | Left Win + Alt + Left Shift + (0-9) |
| Pin/unpin (toggle) current <u>window</u> | Disabled |
| Pin/unpin (toggle) current <u>app</u> | Disabled |
| Pin current window to all desktops | Disabled |
| Pin current app to all desktops | Disabled |
| Unpin current window from all desktops | Disabled |
| Unpin current app from all desktops | Disabled |
| Open Desktop Manager | Disabled |

### Mouse Shortcuts

Expand All @@ -229,6 +285,7 @@ To create custom packs, simply create one icon per desktop and name them appropr

You can set what is the default desktop using the "[General] DefaultDesktop" setting.
You can set if you want to be able to switch desktops by scrolling over the taskbar using the "[General] TaskbarScrollSwitching" setting (1 for yes, 0 for no).
If your keyboard shortcuts configuration conflicts with the default Windows shortcuts (`Win + Ctrl + Left Arrow` and `Win + Ctrl + Right Arrow`), you can specify if you want to switch between desktops instantly or if you want the default Windows transition to be used, by setting the "[General] UseNativePrevNextDesktopSwitchingIfConflicting setting (1 for yes, 0 for no).

### Settings Migration Guide

Expand Down Expand Up @@ -279,4 +336,6 @@ Thanks to the artists that created the packed wallpapers, whom I lost track of.

Thanks to rob3110 on reddit for the extra white icon theme.

Thanks to several people on reddit.com/r/windows10 and in the project's github page for their suggestions.
Thanks to several people on reddit.com/r/windows10 and in the project's github page for their suggestions.

Thanks to mlabaj (Martin Labaj) for his code for the window pinning functionality.
11 changes: 11 additions & 0 deletions settings.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[General]
DefaultDesktop=1
TaskbarScrollSwitching=1
UseNativePrevNextDesktopSwitchingIfConflicting=0

[KeyboardShortcutsModifiers]
SwitchDesktop=LAlt
Expand All @@ -12,6 +13,16 @@ NextTenDesktops=
PreviousDesktop=Left
NextDesktop=Right

[KeyboardShortcutsCombinations]
TogglePinWindow=LAlt, Shift, Ctrl, Q
TogglePinApp=LAlt, Shift, Ctrl, A
PinWindow=
PinApp=
UnpinWindow=
UnpinApp=
; "SC029" is the key below your "Esc" key
OpenDesktopManager=LAlt, SC029

[Tooltips]
Enabled=1
Centered=1
Expand Down
Loading

0 comments on commit 04c6c4a

Please sign in to comment.