|Jun 14, 2023
#153 in Windows APIs
A utility to customize the keyboard shortcut for session locking on Windows.
- Free Win+L for other uses.1
- Use the shortcut that you want instead of the Microsoft-mandated shortcut.
winlock -d # Disables the lock screen (and Win+L with it)
winlock -r # Restores the lock screen (and Win+L with it)
winlock -cwk j # Sets a shortcut Ctrl+Win+J to lock the screen (Win+L still functional)
winlock -drcwk j # Replaces Win+L with Ctrl+Win+J
winlock --help # Describes usage with more detail
Note: experimental, subject to change.
To exit gracefully send an interrupt signal (press Ctrl+C to the program). Ungraceful exits (e.g. process termination) will impede the
-r flag from functioning.
1 My own reason for making this is wanting to use Win+L inside a Windows-hosted virtual-machine (in my i3 config, where such bindings are popular and very handy). Its elevated priority means that even when the virtual-machine captures the button press, Windows does too and simultaneously locks the host screen.