i3 / i3lock

improved screen locker
https://i3wm.org/i3lock
BSD 3-Clause "New" or "Revised" License
920 stars 404 forks source link

i3lock shows no background image as systemctl service #288

Closed Skyy93 closed 4 years ago

Skyy93 commented 4 years ago

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Other (Please describe in detail)

Current Behavior

I am getting a white screen when i close my notebook lid and open it again

Expected Behavior

showing my choosen background picture

Environment

Output of i3lock --version:

i3lock version: 2.11.1

I am using i3wm with ubuntu gnome

my systemd service

Systemd service:
[Unit]
Description=Lock the screen with i3lock
Before=sleep.target

[Service]
User=skyy
Type=simple
Environment=DISPLAY=:0
Environment=XAUTHORITY=/run/user/1000/gdm/Xauthority
ExecStart=/usr/bin/i3lock -n -f -i "/home/skyy/Pictures/jap.png"

[Install]
# Ensure that this is called when we're trying to suspend the machine
WantedBy=suspend.target
stapelberg commented 4 years ago

So you’re saying that if you run /usr/bin/i3lock -n -f -i "/home/skyy/Pictures/jap.png" from a terminal, the picture shows up?

What happens if you manually invoke the systemd unit using systemctl start?

Skyy93 commented 4 years ago

Yes and when i Start the Service Manual it shows the picture

stapelberg commented 4 years ago

When you run into the problem, can you log into your computer either by:

  1. switching to a virtual text console (e.g. ctrl-alt-f2)
  2. using SSH from a different device

and check which processes are running, e.g. using ps auxf?

Please paste the line for the i3lock process.

Skyy93 commented 4 years ago

@stapelberg

sorry for kept you waiting so long! I managed to get it fixed :)

My new config is now:

[Unit]
Description=i3lock
Before=sleep.target

[Service]
User=me
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock -i /home/me/Pictures/background.png

[Install]
WantedBy=sleep.target

and i added chmod+x on the service file