I press my i3 shortcuts too often on my Windows machines without a result. That's the one of the reasons I made this repo.
- AutoHotkey
- Version: any v2 version
This uses Ciantic/VirtualDesktopAccessor, a DLL from where you can access Windows Desktop functions. I just put an already built ./VirtualDesktopAccessor.dll in this repository, but you free to build one yourself.
I will refer to n as the desktop number, which is limited to 9 in my script because the hotkeys are dynamically created for the number of available desktops (on startup and on addition/removal of desktops) and I can only create shortcuts for 1-9 automatically (key 1 to key 9).
Win + nto switch between desktopWin + Shift + nto move a window to a desktopWin + Alt + nto move a window to a desktop and also switch to the desktop
Additionally, it can restart the explorer with Win + Shift + r and can rotate your main display:
Win + F1for a normal horizontal displayWin + F2to rotate 90° degrees counterclockwise (normal vertical display)Win + F3to rotate 180° degrees counterclockwise (flipped horizontal display)Win + F4to rotate 270° degrees counterclockwise (flipped vertical display)
You can also send a message from other AutoHotkey scripts, like this:
desktop := WinExist("desktop.ahk ahk_class AutoHotkey")
PostMessage(0x5555, 0, 1, , "ahk_id " . desktop) ; 0 is to send a change desktop request, 1 is to change it the 2nd desktop (index starts at 0)This is a script to launch shortcuts configured through a JSON file. You can put folders you want to open, Batch/Powershell/Autohotkey scripts to launch and also put them into submenus.
Because of Windows-version specific limitations, some features may not be available. (described after this)
You can use this script to define a list of shortcuts which can open one folder in explorer or start a AutoHotkey script (path has to end with .ahk or .ah2).
Path for JSON: YOUR-HOME\shortcuts\shortcuts.json
Example JSON:
{
"shortcuts": {
"work": "C:\\work",
"temp": "C:\\Temp",
"my-script-ah2": "C:\\scripts\\hello-world.ah2",
"my-script-ahk": "C:\\scripts\\hello-world.ahk",
"submenu": {
"home": "C:\\Users\\user",
"goingDown": {
"wow": "C:\\"
}
}
}
}This script can open an W11 explorer with multiple tabs through a JSON configuration in your user folder (scripts look in the environment variables USERPROFILE and HOME in order).
Path for JSON: YOUR-HOME\shortcuts\shortcuts.json
Example JSON:
{
"shortcuts": {
"work": [
"C:\\work",
"C:\\Users\\user\\another-work-folder"
],
"temp": "C:\\Temp",
"my-script-ah2": "C:\\scripts\\hello-world.ah2",
"my-script-ahk": "C:\\scripts\\hello-world.ahk",
"submenu": {
"home": "C:\\Users\\user",
"goingDown": {
"wow": "C:\\"
}
}
}
}It has the general shortcuts that I use like media control, focusing windows, setting windows to be always-on-top.
Ctrl + Alt + p- play/pauseCtrl + Alt + Left/Right&Ctrl + AltGr + Left/Right- previous/next songWin + q&Win + Shift + q- close active window (sendsAlt + F4)Win + Shift + p- trigger Windows power menuWin + x- open AHK WindowSpy for window informationWin + Shift + x- open my own gui for searching windows informations through WinGetList with the standard ahk filtersWin + a- Activate DiscordWin + s- Activate SpotifyWin + Enter&Win + Alt + t- Open Windows TerminalWin + t- Set windows to AlwaysOnTopWin + Shift + 1- resize window to a little less than 40% screen height and scale the width proportionallyWin + Shift + a- click the notificiation icon at the bottom right (on W10 and W11)Win + m- (un-)minimize a windowCtrl + Alt + v- open a context menu for transforming somewhat valid file paths in the clipboard to:- with backlashes/slashes/custom separator
- add a prefix/suffix
Ctrl + v- can paste an image into the currently open explorer window (active tab on W11)Ctrl + Shift + c- copy the path(s) of the currently selected item(s)Ctrl + Shift + e- edit the currently selected item(s)
Starts my AutoHotkey scripts at once (useful for autostart)
Has the hotstrings for when I use the US keyboard layout (most of the time now) instead of the German keyboard layout.
converts stuff like: ae- to ä with the specified hot strings triggers at the top
This script comes from the AutoHotkey forums. It's a really cool script for listening to all kinds of window messages. Forum Link