My phosphor screensaver

On 30 November 2007, in applications, computing, config, by ayoli

Phosphor is a nice screensaver (at least, I love it) that scrolls a text on the screen in a old school 80’s style. On Ubuntu 7.10, it comes with xscreensaver-data-extra from universe repository.
I wrote a bash script to generate the text choosing a random fortunes from a folder ~/fortunes where I save the fortunes in a text file (the script doesn’t depends from fortune app) :

#!/bin/bash
	
  1. put the fortunes in an array c=0 for i in `ls $HOME/fortunes/`; do fortune[$c]=$i c=$c+1 done;
  2. count the fortunes
nb_fortunes=${#fortune[*]}
  1. take a random fortune from the array
fortune_out=${fortune[$((RANDOM%nb_fortunes))]}
  1. Now, output it echo ”——————————————————————————————————————” echo ”$USER@$HOSTNAME:`date +%H:%M:%S` ~>\$ cat fortunes/$fortune_out” echo ” ” cat $HOME/fortunes/$fortune_out
The next step is phosphor configuration, here’s the command I use to launch it :
phosphor -root -delay 57846 -scale 2 -ticks 13 -program /home/ayoli/local/bin/myfortunes
Replace /home/ayoli/local/bin/myfortunes with the path to your text generator application (which can also be a rss agregator, htop, or any other CLI app).
  • If you use Xscreensaver, launch xcreensaver-demo from a terminal, then choose phosphor screensaver, hit ‘settings’ button and then ‘advanced’. Here you can enter the line.
  • Else if you use gnome-screensaver you need to edit, as super user, the file that gnome-screensaver uses to launch phosphor :
    sudo gedit /usr/share/applications/screensavers/phosphor.desktop
    find the line that begins with exec and paste your configuration line
Tagged with:  

5 Responses to “My phosphor screensaver”

  1. [...] Exec=phosphor -root -delay 57846 -scale 2 -ticks 13 -program /tu_ruta/tu_programa Sustituyendo tu_ruta/tu_programa por ese programa o shell script tuyo, que muestra un texto al azar. Ademas nos puede venir bien para depurar nuestro codigo sobre la marcha. DESDE ubuntulife.net Original en ayozone.org [...]

  2. Maxamoto says:

    Oh jesus. What a waste of code. You linsux people are always making it harder than it needs to be.

    On FreeBSD, ‘phosphor -program fortune’ will accomplish the exact same thing. What a dumbass…

  3. jarjruwv says:

    jarjruwv…

    jarjruwv…

Leave a Reply

Weboy

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!