Systemd unit for locking on sleep

Issue #18 new
Vladimir-csp created an issue

Hi. I would like to share something I use myself:

it is possible to utilize loginctl to issue generic session lock event.

The following systemd unit may take care of that:

Description=Lock sessions before sleep

ExecStart=-/bin/loginctl lock-sessions
ExecStartPost=/bin/sleep 1


Also, a sample XDG autostart entry to utilize this unit on the user session's side (i3lock variant):

[Desktop Entry]
GenericName=Screen lock daemon
GenericName[ru]=Демон блокировки экрана
Comment=Provides screen locking
Comment[ru]=Предоставляет блокировку экрана
Exec=xss-lock -- i3lock -n

An offtopic side note, there is a new tool for brightness control that works better than xbacklight when it comes to newer video drivers: It is already in Debian.

Comments (0)

  1. Log in to comment