The obvious question is WHY? For one thing Linux developers don’t seem to have put much effort into screensavers so the choice is restricted. A few extras are available here though.
Windows ones can be run using Wine. However what works with which combinations of soft- and hardware is, as ever, something which is only revealed by trying it.
Leaving cosmetics aside, another advantage of this method is that you can easily stop the screensaver from activating if you’re watching a YouTube video or something similar.
The first thing you need is your desired Windows screensaver. These are files ending in .scr located in C:\Windows\System32. The simple ones are self-contained but some require additional files and finding out what they are and where they are located is a challenge. This particularly applies to those from Windows 98, which had the largest selection of screensavers. When XP came out MicroSoft removed a lot and also their supporting files so if you are desperate for something like Haunted House you’ve got your work cut out. If you know what files you need they can be copied from a machine running Windows 98 — not as unlikely as it seems given its growing popularity with vintage gamers — or from an installation disk. These things are also available on-line but you are then having to trust that they don’t come with bonus malware.
I however have no desire for the complicated ones and this guide is based on the simple ones like Flying Windows, Pipes &c where the .scr file is all that’s needed. I’ll use Flying Windows as an example — the actual file for this is called ssflywin.scr. However, this does require the font wingding.ttf to be installed for it to work properly.
Obviously you need Wine installed and working before going any further.
Firstly test that your chosen screensaver works on your computer by running:--
Windows ones can be run using Wine. However what works with which combinations of soft- and hardware is, as ever, something which is only revealed by trying it.
Leaving cosmetics aside, another advantage of this method is that you can easily stop the screensaver from activating if you’re watching a YouTube video or something similar.
The first thing you need is your desired Windows screensaver. These are files ending in .scr located in C:\Windows\System32. The simple ones are self-contained but some require additional files and finding out what they are and where they are located is a challenge. This particularly applies to those from Windows 98, which had the largest selection of screensavers. When XP came out MicroSoft removed a lot and also their supporting files so if you are desperate for something like Haunted House you’ve got your work cut out. If you know what files you need they can be copied from a machine running Windows 98 — not as unlikely as it seems given its growing popularity with vintage gamers — or from an installation disk. These things are also available on-line but you are then having to trust that they don’t come with bonus malware.
I however have no desire for the complicated ones and this guide is based on the simple ones like Flying Windows, Pipes &c where the .scr file is all that’s needed. I’ll use Flying Windows as an example — the actual file for this is called ssflywin.scr. However, this does require the font wingding.ttf to be installed for it to work properly.
Obviously you need Wine installed and working before going any further.
Firstly test that your chosen screensaver works on your computer by running:--
wine ssflywin.scr /s
If it does then great, if not try a different .scr file or forget the whole idea.
The next thing is to make it work automatically but not when watching YouTube. For this we need a couple of additional programs and a script.
To install the programs open a terminal and type:--
The next thing is to make it work automatically but not when watching YouTube. For this we need a couple of additional programs and a script.
To install the programs open a terminal and type:--
sudo apt-get install xprintidle wmctrl
Then open a text editor and enter the script itself or download it from here:--
#!/bin/sh
# *** DEPENDS ON xprintidle AND wmctrl ***
# Screensaver to use
Screensaver=/home/joe/.wine/ssflywin.scr
# Minutes to wait before activating
Timeout=10
#Convert minutes to milliseconds
IDLE_TIME=$(($Timeout*60*1000))
# Clobber normal Linux Screensaver and screen-blanking.
xset s off -dpms
sleep_time=$IDLE_TIME
triggered=false
# ceil() instead of floor()
while sleep $(((sleep_time+999)/1000)); do
idle=$(xprintidle)
if [ $idle -ge $IDLE_TIME ]; then
if ! $triggered; then
# Get a list of open windows and count the number of times YouTube &c is on it.
youtube=`wmctrl -l|egrep -c 'YouTube|My5|All 4'`
if [ $youtube -ge 1 ]; then
triggered=false
sleep_time=$IDLE_TIME
else
wine $Screensaver /s
triggered=true
sleep_time=$IDLE_TIME
fi
fi
else
triggered=false
# Give 100 ms buffer to avoid frantic loops shortly before triggers.
sleep_time=$((IDLE_TIME-idle+100))
fi
done
The line starting:—
Screensaver=
will need amending to suit the loaction and name of your .scr file and you may want a longer or shorter delay than the ten minutes set by:—
Timeout=
The line:--
youtube=`wmctrl -l|egrep -c 'YouTube|My5|All 4'`
gets a list of open windows and checks if YouTube, or Channel 4 or 5’s catch-up service is on it. If so it doesn’t activate the screensaver. This list can be tweaked to suit your requirements.
What you call the script and where you put it is up to you. I called mine winss and put it, along with ssflywin.scr, in my .wine directory.
Now back in the terminal type SOMETHING LIKE this, exactly what depends on what you’ve called your script and where you’ve put it:--
What you call the script and where you put it is up to you. I called mine winss and put it, along with ssflywin.scr, in my .wine directory.
Now back in the terminal type SOMETHING LIKE this, exactly what depends on what you’ve called your script and where you’ve put it:--
chmod 755 /home/joe/.wine/winss
to make it executable.
Now go to your Startup Applications and switch off the existing screensaver and add a new item pointing at your script. This will then load it up on your next re-boot.
If the screensaver can be configured, for instance to use custom text, these settings are accessed via:--
Now go to your Startup Applications and switch off the existing screensaver and add a new item pointing at your script. This will then load it up on your next re-boot.
If the screensaver can be configured, for instance to use custom text, these settings are accessed via:--
wine whatever.scr /c
To download a PDF version of this click here.