Centos 6: Replace gnome-screensaver with xscreensaver

Centos 6 comes with gnome-screensaver by default. Also, VLC media player that you can find on rpmforge repo is 1.1.13. VLC has an option “Disable screensaver”. If you check that option VLC will try to disable screensaver while movie is played. But, unfortunately, that option is not working if you are using gnome-screensaver. So, I decided to give xscreensaver a go. You can find a lot of articles on the internet where authors are explaining how to do that. But, i couldn’t find any how to that explains how to make global changes to system making me able to make a switch transparently, without users even noticing a change.

1. Uninstall gnome-screensaver

[root@thinker ~]# yum erase gnome-screensaver

2. Install xscreensaver

[root@thinker ~]# yum install xscreensaver xscreensaver-gl-base xscreensaver-extras xscreensaver-gl-extras

In next few steps we will install yum-utils and download gnome-screensaver rpm. We need to do that so that we can “steal” autostart file. We will alter that file so that we can start xscreensaver service globaly for all users.

3. Install yum-utils

[root@thinker ~]# yum install yum-utils

4. Download gnome-screensaver rpm

[root@thinker ~]# cd /tmp
[root@thinker tmp]# mkdir gs
[root@thinker tmp]# cd gs
[root@thinker gs]# yumdownloader gnome-screensaver.x86_64 ./

5. Unpack gnome-screensaver rpm

[root@thinker gs]# rpm2cpio gnome-screensaver-2.28.3-24.el6.x86_64.rpm | cpio -id
[root@thinker gs]# cd etc/xdg/autostart/

6. Create xscreensaver autostart

[root@thinker autostart]# mv gnome-screensaver.desktop xscreensaver.desktop
[root@thinker autostart]# vi xscreensaver.desktop

Find a line Exec=gnome-screensaver. Replace that line with Exec=xscreensaver -nosplash. Save and exit.

7. Move autostart file to global location

[root@thinker autostart]# mv xscreensaver.desktop /etc/xdg/autostart/

That’s it. Restart your computer or, if you are more expirienced, go to init 3 and return to init 5. Your new screensaver will be active.
Enjoy! 🙂

Leave a Reply