You are not logged in.
Pages: 1
I have wrote a suspend hook like written in: https://wiki.archlinux.org/index.php/Po … vice_files
Which I put in /etc/systemd/system/resume@.service, this is its content:
[Unit]
Description=User resume actions
After=suspend.target
[Service]
Type=Simple
User=%I
ExecStartPost=/usr/bin/i3lock
[Install]
WantedBy=suspend.targetI have enabled it by typing: sudo systemctl enable resume@alex
Where alex is my username.
After suspending i3lock is not executed (the screen is not locked).
What can I do?
Last edited by AlexIL (2016-10-04 19:48:42)
Offline
What can I do?
Hello!
I suggest you do the following:
- Check the status for the unit/service you wrote
- Read your journal and look for any errors connected to the unit/service you wrote
- Solve the problem/ask for help if you are unable to solve it yourself
Regards
Martin
Last edited by onslow77 (2016-10-04 19:41:02)
Offline
systemd --user runs as a separate process from the systemd --system process. User units can not reference or depend on system units.
Edit:
Misread it as you were running it as a user service sorry for the noise
Last edited by loqs (2016-10-04 19:44:14)
Offline
My unit file wasn't written properly which resulted in errors.
Here's the working one:
[Unit]
Description=User resume actions
Before=sleep.target
[Service]
Type=forking
User=alex
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock --image /home/alex/Pictures/lockscreen.png --show-failed-attempts -c 000000
ExecStartPost=/usr/bin/sleep 1
[Install]
WantedBy=sleep.targetThanks for the help, I'll mark it as solved.
Offline
Pages: 1