Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Lock screen on suspend - i3 - /etc/systemd/system/
Description=User suspend actions
User=rzi # Replace with your user id - %I does not work somehow :/
ExecStart=/usr/bin/blurlock # Or i3lock
ExecStartPost=/usr/bin/sleep 1

This comment has been minimized.

Copy link

reverendhomer commented Oct 6, 2017

ExecStartPost=/usr/bin/sleep 1

Why do you need this?


This comment has been minimized.

Copy link

rbran commented Dec 28, 2017

@reverendhomer There is a note in

As screen lockers may return before the screen is "locked", the screen may flash on resuming from suspend. Adding a small delay via ExecStartPost=/usr/bin/sleep 1 helps prevent this.


This comment has been minimized.

Copy link

kenoh commented Jan 27, 2018

%I would work if the service file name ended with @.service instead of .service. Then, you can enable it for a user: systemctl enable myservice@username.service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.