Skip to content

Instantly share code, notes, and snippets.

@malted
Last active September 15, 2021 18:05
Show Gist options
  • Save malted/96c59885e3236eddbb819e542a684816 to your computer and use it in GitHub Desktop.
Save malted/96c59885e3236eddbb819e542a684816 to your computer and use it in GitHub Desktop.
Autolocker

Autolocker

My screen auto lock implementation

Required packages

sudo pacman -S xautolock slock dunst

Explanation

xautolock runs slock - a simple screen locker - after no input has been detected for 5 minutes.

20 seconds before slock will be run, a message is sent to dunst using notify-send.

The secure flag means xautolock will ignore enable, disable, toggle, locknow, unlocknow, and restart messages meaning it is harder to unlock by other means, for example an ssh session.

xautolock -locker slock -time 5 -notify 20 -notifier "notify-send 'About to lock' 'The screen will lock in 20 seconds'" -secure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment