I’ve been a fan of the Electric Sheep screensaver for a long time, but I haven’t been running it lately.
It turns out that there is now a new linux version, so I thought I would try to install it on my home machine running Fedora 8. The source install went great, I already had all the prerequisites installed, so simple configure; make; make install went fine.
The problem was a strange interaction with xscreensaver and mplayer. I did a system update recently, and mplayer decided that the “stop-xscreensaver=1” setting in my ~/.mplayer/config stopped working. That means every ten minutes while I’m watching videos, the screensaver kicks in. So I switched to the alternative method of preventing the screensaver from starting up by using the heartbeat command to tell the screensaver not to start every 30 minutes.
That worked great. When I got around to installing Electric Sheep though, I found a problem: Electric Sheep uses mplayer to play the videos it creates. Mplayer tells the screensaver to not invoke. So while Electric Sheep worked fine from the command line, when run as a screensaver it would just quit immediately.
The solution: a simple bash script that checks whether electricsheep is running. If it is, it does nothing, otherwise it will call the “do not invoke the screensaver” command. If anyone else is interested, here i the script:
#!/bin/bash
#
# devans 2008-07-19
# This script will check to see if electricsheep is running, and if so, it will do nothing
# If it is not running, it will invoke xscreensave-command -deactivate to prevent xscreensaver
# from running. Mostly this is useful is set as the command to call via heartbeat-cmd in
# ~/.mplayer/config
if [[ -z $(ps -ef | grep electricsheep | grep -v grep) ]] ; then
# echo "suppressing";
xscreensaver-command -deactivate
fi
The whole thing works well if you put heartbeat-cmd="~devans/suppressXscreensaver.sh &"
in your ~/.mplayer/config
So far the screensaver seems a bit unreliable. It has trouble starting up sometimes and the screen just blanks. I haven’t tracked down what the problem is, but when it works it is really beautiful.
Leave a Reply