Skip to content

Instantly share code, notes, and snippets.

@rometsch
rometsch / i3autolock.md
Last active April 14, 2024 16:52
Configure lockscreen for i3 window manager.

The i3-wm does not come with a keybinding to lock the screen or a preconfigured auto lockscreen. This gist describes how to setup both using i3lock and xautolock. i3lock is a minimalistic lockscreen and xautolock monitors mouse and keyboard activities to automatically lock the screen after a certain time of beiing inactive.

First get the tools if neccessary. E.g. sudo apt install i3lock xautolock.

To setup the keybinding Ctrl+Alt+l (last one is a lowercase L) to lock the screen append the following lines to the i3 configuration file located at ~/.config/i3/config.

# keybinding to lock screen