This repository has been archived by the owner on Dec 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Committed the initial version of the app.
- Loading branch information
Showing
20 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Windows 10 Virtual Desktop Assistant | ||
=== | ||
|
||
This application will enhance the Windows 10 multiple desktops feature. | ||
By default you can switch to the next/previous desktops by pressing [Windows + Ctrl + (Left or Right Arrow)]. | ||
This will allow you to switch to each specific desktop on demand with new keyboard shortcuts. | ||
It will also allow you have a custom wallpaper per desktop. | ||
|
||
## Installation | ||
|
||
For "Virtual Desktop Assistant" to work, you first need to install "Visual C++ Redistributable for Visual Studio 2015". | ||
It should be available [here](https://www.microsoft.com/en-us/download/details.aspx?id=48145). | ||
|
||
To run this app, just run the "virtual-desktop-assistant.exe" program or install AutoHotkey and run the "virtual-desktop-assistant.ahk" script file. | ||
|
||
## Usage | ||
|
||
### Keyboard Shortcuts | ||
|
||
While running, the following keyboard shortcuts are available: | ||
- [Left Alt + (key under Esc)] | ||
|
||
Goes to the desktop management screen. | ||
This is additionally available (by default) by pressing [Windows + Tab]. | ||
You can move windows between desktops by dragging them while inside this screen. | ||
|
||
- [Left Alt + (1-9)] | ||
|
||
Switch to the desktop for the respective key (ex: [LAlt + 3] goes to Desktop 3). | ||
|
||
Note that to add a new desktop you can press the "+ New Desktop" button on the desktop management screen. | ||
A maximum of 9 desktops are supported. | ||
|
||
### Tray Icon | ||
|
||
A new tray icon will be available. It indicates the number of the current desktop (1-9). | ||
If you click on it the desktop management screen will be displayed. | ||
|
||
The icons will have white text over black background. An inverted color scheme is provided but will require minor tweaks to the script. | ||
|
||
### Custom Wallpapers Per Desktop | ||
|
||
To configure the wallpapers, edit the "settings.ini" file and set the paths of the wallpaper image files for the desktops you want. | ||
|
||
A few are included by default. The paths can be relative (ex: "./wallpapers/1.jpg") or absolute (ex: "C:\wallpapers\1.jpg"). | ||
|
||
If you set the path to empty (ex: "1=" instead of "1=./wallpapers/1.jpg") the wallpaper won't change when you switch to that desktop. | ||
|
||
## Credits | ||
|
||
Credits to Ciantic (Jari Pennanen) for his library, which can be found [here](https://github.com/Ciantic/VirtualDesktopAccessor). | ||
Credits to the creator of the ReadINI AHK library, found [here](https://autohotkey.com/board/topic/33506-read-ini-file-in-one-go/). |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
; https://autohotkey.com/board/topic/33506-read-ini-file-in-one-go/ | ||
|
||
ReadIni( filename = 0 ) | ||
; Read a whole .ini file and creates variables like this: | ||
; %Section%%Key% = %value% | ||
{ | ||
Local s, c, p, key, k | ||
|
||
if not filename | ||
filename := SubStr( A_ScriptName, 1, -3 ) . "ini" | ||
|
||
FileRead, s, %filename% | ||
|
||
Loop, Parse, s, `n`r, %A_Space%%A_Tab% | ||
{ | ||
c := SubStr(A_LoopField, 1, 1) | ||
if (c="[") | ||
key := SubStr(A_LoopField, 2, -1) | ||
else if (c=";") | ||
continue | ||
else { | ||
p := InStr(A_LoopField, "=") | ||
if p { | ||
k := SubStr(A_LoopField, 1, p-1) | ||
%key%%k% := SubStr(A_LoopField, p+1) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Wallpapers] | ||
1=.\wallpapers\1.jpg | ||
2=.\wallpapers\2.jpg | ||
3=.\wallpapers\3.jpg | ||
4= | ||
5= | ||
6= | ||
7= | ||
8= | ||
9= |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
#SingleInstance, force | ||
#WinActivateForce | ||
; Credits to: https://github.com/Ciantic/VirtualDesktopAccessor | ||
|
||
#Include, read-ini.ahk | ||
|
||
; ====================================================================== | ||
; Setup | ||
; ====================================================================== | ||
|
||
DetectHiddenWindows, On | ||
hwnd := WinExist("ahk_pid " . DllCall("GetCurrentProcessId","Uint")) | ||
hwnd += 0x1000 << 32 | ||
|
||
hVirtualDesktopAccessor := DllCall("LoadLibrary", "Str", ".\virtual-desktop-accessor.dll", "Ptr") | ||
|
||
global GoToDesktopNumberProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "GoToDesktopNumber", "Ptr") | ||
global RegisterPostMessageHookProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "RegisterPostMessageHook", "Ptr") | ||
global UnregisterPostMessageHookProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "UnregisterPostMessageHook", "Ptr") | ||
global GetCurrentDesktopNumberProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "GetCurrentDesktopNumber", "Ptr") | ||
global GetDesktopCountProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "GetDesktopCount", "Ptr") | ||
|
||
DllCall(RegisterPostMessageHookProc, Int, hwnd, Int, 0x1400 + 30) | ||
OnMessage(0x1400 + 30, "VWMess") | ||
VWMess(wParam, lParam, msg, hwnd) { | ||
ChangeAppearance(lParam + 1) | ||
ChangeBackground(lParam + 1) | ||
Focus() | ||
} | ||
|
||
; ====================================================================== | ||
; Auto Execute | ||
; ====================================================================== | ||
|
||
Menu, Tray, Add, &Manage Desktops, OpenDesktopManager | ||
Menu, Tray, Default, &Manage Desktops | ||
Menu, Tray, Click, 1 | ||
|
||
ReadIni("settings.ini") | ||
ChangeAppearance(1) | ||
ChangeDesktop(1) | ||
|
||
; ====================================================================== | ||
; Keybindings | ||
; ====================================================================== | ||
|
||
*<!1:: | ||
*<!2:: | ||
*<!3:: | ||
*<!4:: | ||
*<!5:: | ||
*<!6:: | ||
*<!7:: | ||
*<!8:: | ||
*<!9:: | ||
ChangeDesktop(substr(A_ThisHotkey, 0, 1)) | ||
Return | ||
|
||
!SC029:: | ||
OpenDesktopManager() | ||
Return | ||
|
||
; ====================================================================== | ||
; Functions | ||
; ====================================================================== | ||
|
||
GoToNextDesktop() { | ||
i := (GetCurrentDesktopNumber() + 1) | ||
if (i < GetNumberOfDesktops()) { | ||
i := i + 1 | ||
} | ||
else { | ||
i := 1 | ||
} | ||
ChangeDesktop(i) | ||
} | ||
|
||
OpenDesktopManager() { | ||
Send #{Tab} | ||
} | ||
|
||
GetCurrentDesktopNumber() { | ||
Return DllCall(GetCurrentDesktopNumberProc) | ||
} | ||
|
||
GetNumberOfDesktops() { | ||
Return DllCall(GetDesktopCountProc) | ||
} | ||
|
||
ChangeDesktop(n) { | ||
DllCall(GoToDesktopNumberProc, Int, n-1) | ||
} | ||
|
||
ChangeBackground(n) { | ||
filePath := Wallpapers%n% | ||
isRelative := (substr(filePath, 1, 1) == ".") | ||
if (isRelative) { | ||
filePath := (A_WorkingDir . substr(filePath, 2)) | ||
} | ||
if (filePath and FileExist(filePath)) { | ||
DllCall("SystemParametersInfo", UInt, 0x14, UInt, 0, Str, filePath, UInt, 1) | ||
} | ||
} | ||
|
||
ChangeAppearance(n) { | ||
Menu, Tray, Tip, Desktop %n% | ||
Menu, Tray, Icon, icons/Black %n%.ico | ||
} | ||
|
||
Focus() { | ||
WinActivate, ahk_class Shell_TrayWnd | ||
SendEvent !{Esc} | ||
} | ||
|
||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.