2
I have recently moved to using systemd
to manage power control.
In order to get my screen to be locked when returning from suspend, I created /etc/systemd/system/i3lock.service
with these contents
[Unit]
Description=i3lock
Before=sleep.target
[Service]
User=fommil
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock -c 000000
[Install]
WantedBy=sleep.target
and then ran systemctl enable i3lock.service
.
But this means the lock is always for the fommil
user.
How does one set up a service that will run the screen locker as the user who currently owns the X session?
I don't think that's a job for the system systemd. And the user is not the only problem, the
DISPLAY
environment variable is another one. – Cristian Ciupitu – 2014-06-29T21:07:44.0102
You might want to try i3lock-wait-for-suspend by olvaffe or i3lock-wait-for-suspend by kanru.
– Cristian Ciupitu – 2014-06-29T21:25:57.770