I don't understand Linux and sys-admin stuff, but I have installed recently xscreensaver Ubuntu 18.04.4 LTS as described here and I have followed all the steps. If I lock the screen with Cntrl+Alt+L then the xscreensaver starts. But If I wait for the screen to time out, it just goes blank black like the gnome-screensaver does, despite that I have gnome-screensaver installed. Curiously, when I type locate screensaver.desktop
I get:
/etc/xdg/autostart/gnome-screensaver.desktop
/home/nestor/.config/autostart/xscreensaver.desktop
I was afraid to delete the gnome-screensaver.desktop
file, so I out commented everything in it. Still, same problem persists.
If after a restart I type xscreensaver -nosplash
I get:
xscreensaver: 18:39:29: already running on display :0 (window 0x1a000de)
I guess, this is good and excludes the possibility that screensaver just doesn't get automatically started on start-up.
Then I followed the instructions here and I did:
sudo apt-get remove --auto-remove gnome-screensaver
sudo apt-get purge --auto-remove gnome-screensaver
systemctl --user enable xscreensaver.service
systemctl --user start xscreensaver.service
After the last command I got the message:
Failed to start xscreensaver.service: Unit xscreensaver.service is not loaded properly: Exec format error.
See user logs and 'systemctl --user status xscreensaver.service' for details.
The referred log says:
● xscreensaver.service - XScreenSaver
Loaded: error (Reason: Exec format error)
Active: inactive (dead)
апр 03 18:07:22 nestor-Eve-V systemd[1492]: /usr/lib/systemd/user/xscreensaver.service:5: Executable path is not absolute: xscreensaver
апр 03 18:07:22 nestor-Eve-V systemd[1492]: xscreensaver.service: Cannot add dependency job, ignoring: Unit xscreensaver.service is not loaded properly: Exec format error.
This suggests the problem is "Executable path is not absolute", so I opened the file /usr/lib/systemd/user/xscreensaver.service
and it contains:
[Unit]
Description=XScreenSaver
[Service]
ExecStart=xscreensaver
[Install]
WantedBy=default.target
Do I have to type there an absolute path? Any ideas how can I enable screensaver to work properly? thanks
Thanks for your question, @NeStack.
This error message seems clear:
So I opened the file with
sudo vim /usr/lib/systemd/user/xscreensaver.service
and saw this:I replaced it with
ExecStart=/usr/bin/xscreensaver
, after whichsystemctl --user start xscreensaver.service
no longer gives an error. `