Friday, October 14, 2011

Installing XScreenSaver in 11.10, Ubuntu Oneiric

Gnome 3 doesn't come with a 'real' screensaver, so neither does Ubuntu Oneiric. All it offers is a blank screen, which most of us are not satisfied with. Don't panic, it is scheduled to return to Ubuntu soon:

At the moment, the only workaround is to replace Gnome Screensaver with some alternative one. The most popular one is XScreenSaver, and this is how to implement it.

Installation and Configuration

First, remove 'gnome-screensaver' by going to a Terminal and running:

sudo apt-get remove gnome-screensaver

Now for installing XScreenSaver, run:

sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

You'd also need to add XScreenSaver to your Startup Applications for running it automatically when you login. So search the Dash for 'Startup Applications' and open it.

Now, add a new entry for XScreenSaver as shown in the screenshot below:

Where is:
  • Name = XScreenSaver
  • Command = xscreensaver -no-splash
On the next relogin, the XScreenSaver daemon will be run automatically, but to use XScreenSaver immediately, you can also just open its 'Screensaver' settings dialog, it would prompt you then to run the daemon. Therefore, just search the Dash for 'XScreenSaver' and start it, or alternatively, find 'Screensaver' in the classic Gnome menu.

This is what you've got:

And as a bonus, you also get some extra power settings, which Oneiric is missing otherwise.

Inhibit the Screensaver when a Video is Playing

You obviously don't want the screensaver to kick-in every time you leave your mouse idle, especially while watching a movie. 'Caffeine' would serve that purpose nicely. So, get to a Terminal and run:

sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine python-glade2

Bring the Lock Screen Back to Life

The removal of Gnome Screensaver results in the lock screen not working at all. To fix that, you need to create a symbolic link to the XScreenSaver executable in place of the now removed Gnome Screensaver executable. So from a Terminal, run:

sudo ln -sf /usr/bin/xscreensaver-command /usr/bin/gnome-screensaver-command

You might need to re-login for the lock screen to start working.

Revert the Changes

If at some point you want to revert to Gnome Screensaver, just run these commands from a Terminal:

sudo apt-get remove xscreensaver xscreensaver-gl-extra xscreensaver-data-extra
sudo rm /usr/bin/gnome-screensaver-command
sudo apt-get install gnome-screensaver

Related Posts:

Appearance , Oneiric Ocelot