My Photos screensaver for the console

Seems like every distro — or perhaps every desktop environment, I should say — has a “My Photos” screensaver. I don’t see the appeal really, but I have met some people that used it exclusively on their machines.

Along with about 1,200 photos of their grandkids, which says something to me about them as grandparents. :shock: :roll:

Point being, the text-only systems that I espouse have Matrix-esque screensavers, full-screen clocks in analogue and digital, Moire patterns and globular balls. You can even get an aquarium rolling.

No “My Photos” screensaver. More’s the pity.

But some people gotta have it, and I wouldn’t want to leave them out in the cold. In that case, I suggest img2txt out of the caca libraries, plus a simple loop that skips through image files in a folder.

Something like this should work.

while true ; do
	for i in $HOME/.wallpaper/*.bmp ; do 
		img2txt -W 132 -H 48 $i
		sleep 10

Feel free to improve on that script if you like. My inner code monkey was a brain donor. After that, screen should do all the dirty work with its blankerprg and idle settings.

A couple of wacky things in there: img2txt defaults to a teeny little picture if you don’t feed it dimensions. I tried using the $COLUMNS and $LINES variables, but it seemed to ignore them.

So that’s where the 132 and 48 come from, which are comfortable dimensions for an 800×600 LCD using 12-point Terminus as a font.

Additionally, I should note that you can compile and install the caca libraries without imlib2 support, and still use .bmp file formats.

That’s only important if you are like me, and you run exclusively without Xorg. Otherwise, you probably have those image format libraries already installed, and it won’t matter.

So what’s it look like? Glad you asked.

It looks like crap, that’s what it looks like. But what were you expecting? :lol: You might find it worth your while to select images by virtue of contrast, cut them down considerably and reduce their quality.

If you find it worth your while, that is.

On the other hand, if you have framebuffer support and you pull the same stunt with a proper framebuffer image viewer instead of img2txt as the prime mover … that might be something to brag about.

But I’ll leave that to you. It sounds too easy. :)

About these ads

5 Responses to “My Photos screensaver for the console”

  1. 1 Yu-Jie Lin 2010/12/09 at 4:35 PM

    About columns and lines, you need to export them before run the script and `shopt -s checkwinsize` if the terminal size might change, with `trap` the SIGWINCH signal is better.

    Or you can just run `tput cols` and `tput lines` to get those two numbers.

    • 2 Yu-Jie Lin 2010/12/09 at 4:38 PM

      Second thought, I am not sure if checkwinsize will update variables in running script.

      I just came up another idea, just `source` the script will also do the trick.

  2. 3 David 2010/12/10 at 8:28 PM

    Did you have some bad experience with Slackware? Is that why you never write about it?
    Seems like you write about every other distro except Slackware,
    so I was just wondering why you don’t like it.

    Also I was wondering, have you ever gotten X11 to work on Crux?
    I like Crux, but have not got X working on it since version 2.3.
    Actually, X worked on Crux version 2.6 until I rebooted and then it was gone and no amount of fiddling could get it working again.

    Well written, interesting blog, by the way.

    • 4 K.Mandla 2010/12/10 at 10:08 PM

      Hi David. I have tried Slackware a few times and should probably spend more time with it. My biggest problem always seems to be dependencies: I know full well that I will need to pay close attention, but I grow frustrated and tend to quit after a bit. I promise to try harder next time, and not just jump to something easy like Salix or Slax.

      As far as X on Crux 2.3+, I haven’t had any problems with older machines up to 2.7, but the core duo requires some kernel-level settings that I hadn’t figured out, last time I tried it. It’s also something I should spend more time with. ;)

      But for the Trident-driven machines and for the C&T card in this Pentium, I haven’t had any problems getting X working. Not that I use it very often though, either. :roll:

  1. 1 More fun with the My Photos screensaver « Motho ke motho ka botho Trackback on 2010/12/14 at 11:30 PM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Visit the Wiki!

Some recent desktops

May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF

May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games

Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers


This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,958,984 hits



Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: