This is an incredibly basic window "manager" that lets you bind simple key combinations to reposition and resize the foreground window instantly. You can choose from the predefined layouts or use a custom one by defining the coordinates and dimensions. Modifiers and key-codes are defined using their raw numeric values. This is an intentionally lazy design decision to allow users to assign potentially dubious key-codes at their own risk.
Clone the repo and build it with cargo build --release.
You may need to add the executable to your anti-virus exclusions list.
The binary (target/release/winmgr.exe) provides three commands:
Adds a registry entry to run the executable on startup.
./target/release/winmgr.exe installRemoves the aforementioned registry entry.
./target/release/winmgr.exe uninstallRuns the application in the background.
Note: On first run a config file will be written to $HOME/winmgr.json. Changes made to the config won't automatically apply; you will need to end the winmgr.exe task in Task Manager then re-run it.
./target/release/winmgr.exe runConfig file is written to $HOME/winmgr.json.
- LeftHalf
- RightHalf
- LeftThird
- RightThird
- LeftTwoThirds
- RightTwoThirds
- CenterThird
- CenterSmall
- CenterMedium
- CenterLarge
{
"keybinds": [
{
"modifiers": ["0x2"],
"key": "0x61",
"layout": {
"x": 100,
"y": 100,
"w": 1000,
"h": 1000
}
}
]
}A margin can be set with the root field margin.
{
"margin": 32
}- Alt
0x1 - Control
0x2 - Shift
0x4 - Windows
0x8
See https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
This example binds the predefined layouts to Ctrl+Numpad0-9.
{
"margin": 32,
"keybinds": [
{
"modifiers": ["0x2"],
"key": "0x61",
"layout": "LeftThird"
},
{
"modifiers": ["0x2"],
"key": "0x62",
"layout": "CenterThird"
},
{
"modifiers": ["0x2"],
"key": "0x63",
"layout": "RightTwoThirds"
},
{
"modifiers": ["0x2"],
"key": "0x64",
"layout": "LeftHalf"
},
{
"modifiers": ["0x2"],
"key": "0x65",
"layout": "CenterLarge"
},
{
"modifiers": ["0x2"],
"key": "0x66",
"layout": "RightHalf"
},
{
"modifiers": ["0x2"],
"key": "0x67",
"layout": "LeftTwoThirds"
},
{
"modifiers": ["0x2"],
"key": "0x68",
"layout": "CenterSmall"
},
{
"modifiers": ["0x2"],
"key": "0x69",
"layout": "RightThird"
},
{
"modifiers": ["0x2"],
"key": "0x60",
"layout": "CenterMedium"
}
]
}