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.

#!/bin/bash
while true ; do
	for i in $HOME/.wallpaper/*.bmp ; do 
		img2txt -W 132 -H 48 $i
		sleep 10
		clear
	done
done	

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 thoughts on “My Photos screensaver for the console

  1. Yu-Jie Lin

    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.

    Reply
    1. Yu-Jie Lin

      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.

      Reply
  2. David

    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.

    Reply
    1. K.Mandla Post author

      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:

      Reply
  3. Pingback: More fun with the My Photos screensaver « Motho ke motho ka botho

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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