14

I've just installed xscreensaver instead of gnome-screensaver in Ubuntu 12.04 in gnome-session-fallback (Gnome Classic) mode. It works fine, but I have a problem: I put "xscreensaver -no-splash" command to the startup applications list.

But it doesn't start automatically, I have to run this command manually. I think that the problem is that it tries to start before I log in. So how can I start it automatically after login?

Update Jan 2021

I moved to a different DE a long time ago, so this issue no longer affects me. New answers are still coming, however I cannot mark any of them as accepted as I can't test them any more.

balping
  • 453

9 Answers9

16

Tested and used in Ubuntu 13.04

As no answer has been marked as correct yet; this could be this issue with running xscreensaver on startup

as @peterx14 says here, many of the tutorials for setting up xscreensaver provide incorrect information.

They tell you to set up a screensaver.desktop file with the following command:

sudo gedit /etc/xdg/autostart/screensaver.desktop

and then place inside it the following information:

[Desktop Entry]
Name=Screensaver
Type=Applicaton
Exec=xscreensaver -nosplash

However, for some reason, in many of these tutorials, the above command is incorrect. 'Application' has been misspelt as 'Applicaton'. This causes the startup command to not work.

Therefore, if you have already entered the command

"xscreensaver -no-splash" 

into your startup list, it would not work as xscreensaver is not set up with the type application.

To find out if this is the issue: first run locate screensaver.desktop. This should, somewhere in the list, tell you where screensaver.desktop is. On my computer it's in /etc/xdg/autostart/screensaver.desktop, then open it in an editor (terminal 'nano' may be best as you will need sudo commands to open it) and change 'Applicaton' to 'Application'.

Also, different tutorials (such as liberiangeek and Radu's response) suggest using:

"xscreensaver -nosplash"

as the fix above uses. This depends which value you have within your screensaver.desktop file on line 4: Exec=xscreensaver -nosplash.

planty182
  • 181
7

One possible way is to introduce a short delay of (for example) 10 seconds before running the command. This should allow all the logon processes to complete before running the xscreensaver command.

Use a startup application command line of:

sh -c "sleep 10 && xscreensaver -no-splash &"
fossfreedom
  • 174,526
4

I had it working then I updated to 14.04 and it stopped working.

The solution is to go into Synaptic and completely remove the Gnome screen saver. Ubuntu sneakily reinstalls it on "upgrade".

When you reboot it should work now with the original xscreensaver -nosplash startup.

Seth
  • 59,332
Kibi
  • 201
1

I spent several hours with the same problem but then I finally found the answer that I was looking for.

Go to forums.debian.net follow the directions changing only two things.

The first is the line that reads:

gedit ~/.config/autostart/xcreensaver.desktop

Needs to be entered as:

sudo gedit ~/.config/autostart/xcreensaver.desktop

And the second is that to perform this it must be done from the user account it is be applied to, and to do this the user must be an Administrator.

So if the user is a standard user their account type must be change to Administrator it done for them from their account and then the account changed back to a Standard user.

Hope it corrects your problem as well.

1

Use xscreensaver-daemon.desktop from /usr/share/xscreensaver to replace xscreensaver.desktop .

See https://bugs.launchpad.net/ubuntu/+source/xscreensaver/+bug/406534 comment#8

This works for me in 14.04

0

In the event you make a typo creating the autostart entry in Startup Applications, you have to fix it in two places.

In my case, I left out the "r" in "xscreensave -nosplash" which causes Startup Applications to create ~/.config/autostart/xscreensave.desktop

The executable "xscreensave" does not exist & you will not see an obvious error on log in.

What you will notice is if you start Screensaver manually, it asks you if you want to start the daemon (which indicates it never autostarted)

So even if you fix the typo later in Startup Applications, it does not update the filename (as of 20.04.1 LTS) and you will continue to be puzzled why the daemon doesn't start on login.

After fixing the command line field, you have to also rename the file to match the correct executable name:

~/.config/autostart/xscreensaver.desktop

point being, check both:

  1. the command line argument in your Startup Applications entry is correct and
  2. the filename in ~/.config/autostart is correct
0

One way is to define a systemd service:

$ cat > ~/.config/systemd/user/xscreensaver.service <<EOF
[Unit]
Description=XScreenSaver
After=network.target

[Service] ExecStart=/usr/bin/xscreensaver -nosplash Restart=always RestartSec=3

[Install] WantedBy=default.target EOF

Then,

$ systemctl --user enable xscreensaver.service
$ systemctl --user start xscreensaver.service
$ systemctl --user status xscreensaver.service

BTW it could appear to fail at first if the xscreensaver daemon is already running. In that case, do:

$ pkill xscreensaver

Then check the status again, and it should now be active.

Robbie Capps
  • 129
  • 3
0

I think, it has something to do with output redirection. The following line worked for me in Lubuntu 13.10:

xscreensaver -nosplash -log /dev/null
0

I'm new to Ubuntu, was running Mandrake/Mandriva for over 10yrs. From what I just found the simple solution if you want it to start after a logout/login or boot is to go to 'show applications > Startup Applications > Add > then add xscreensaver as the command. If I misread the question I apologize.

Chris Pollock
  • 511
  • 2
  • 5
  • 15