You are not logged in.
Pages: 1
My systemd service for locking the screen using i3lock after returning from suspend no longer triggers.
My resume.service:
[Unit]
Description=User resume actions
Before=sleep.target
[Service]
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock -c 000000
[Install]
WantedBy=sleep.target
I have added in a User line under [Service] to no avail. When trying to enable the service and I return from suspend, systemctl status resume.service reads:
i3lock[14065]: No protocol specified
i3lock[14065]: i3lock: Could not connect to X11, maybe you need to set DISPLAY?
systemd[1]: resume.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Unit resume.service entered failed state.
systemd[1]: resume.service failed.
I've also tried other X-based screen lockers and none work. I am using gdm as the display manager and i3 as the window manager. Could this be an issue with the recent update to X11?
Offline
Are you sure your DISPLAY is 0?
Offline
I've checked as such:
$ echo $DISPLAY
:0
Offline
You need to add your user like this:
[Service]
User=bartbkrsusername
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock
Offline
I added the user line with my username and still have the same issue.
I'm not sure if this matters but I am enabling it as a system service, not a user service.
Offline
I added the user line with my username and still have the same issue.
Have you rebooted, or reloaded the units with this?
# systemctl daemon-reload
Systemd does not pick up changes to services files unless you reboot or reload the daemons.
I'm not sure if this matters but I am enabling it as a system service, not a user service.
Yes, that's correct.
Offline
Yes, I performed a systemd daemon-reload and still no i3lock upon returning from sleep.
The service file is currently in /etc/systemd/system/.
Offline
Looks like this was fixed by the most recent upgrade of Xorg:
upgraded xorg-server-common (1.17.1-1 -> 1.17.1-2)
upgraded xorg-server (1.17.1-1 -> 1.17.1-2)
Thanks for all those who helped!
Offline
Pages: 1