#lock #hotkey #keyboard-shortcuts #login #locking #os #windows

bin+lib winlock

A utility to customize the keyboard shortcut for session locking on Windows

1 unstable release

0.1.0 Jun 14, 2023

#200 in Windows APIs

MIT/Apache

16KB
296 lines

WinLock

A utility to customize the keyboard shortcut for session locking on Windows.

Why

  • Free Win+L for other uses.1
  • Use the shortcut that you want instead of the Microsoft-mandated shortcut.

Usage

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.

Dependencies

~149MB
~2.5M SLoC