K.Mandla's blog of Linux experiences

Some Crux ports for console clocks

My real-life commitments are more intense in summer, and so I have to apologize for the blank spot over the past couple of days. It’s not that I didn’t have anything to say, but that I didn’t have much time to myself in the first place, and couldn’t spend it typing or tweaking.

For today, I have wanted to tack up a couple more Crux ports, mostly for the console clocks that I have mentioned in recent history. If you’re not a Crux user you probably won’t find these interesting; if you’re an Arch user you might find them useful as starting points for PKGBUILDS, if they don’t already exist in AUR.

(If Pkgfiles look like primitive PKGBUILDs, that would be because in a way, they are. It’s one of the nice things about Crux: As Arch has matured PKGBUILDs have become a teeny bit more complex, whereas Crux ports are still quite simple.)

Ticker is fun because it does things a little differently than the run-of-the-mill console clock. With this you can stream the date and time — via the date command, or others — down the side of the screen, as opposed to planted in the center as most others do.

And ticker will allow you almost any input, so you can feed it the results of just about any command. It would be nice to be able to customize it a little more — pick a specific block character for readability, or maybe add some color — but as it is it’s unusual and fun to mess with. 🙂

Post navigation

4 thoughts on “Some Crux ports for console clocks”

As far as the comments go, we all have more real-life-commitments on summertime.

As always, a very inspiring post(I’m starting to have CLI dreams, really), but my question is:

Have you ever considered creating your own Distro?

As far as I can see, from the way you almost always achieve your goal (Building up instead of tearing down, Porting from AUR to Crux…), you might actually have, by now, a complete OS of your own, something like a Kmandlux…hehehe

I sort of did, a couple of years ago. If you follow the Projects link at the top of the page, you’ll find Ubuntu GTK1.2 Remix, which was something I set up for myself, and later shared.

I don’t really support it any longer, mostly because my own philosophy on software setups has changed. But it’s still there and will still be usable for as long as the Hardy repos are online. You could give it a try if you like; I still seed the ISO and sometimes still get questions about it.

Aside from that though, I don’t have any plans to mastermind my own distro. I feel like the system I would build is already available, in the form of Arch or Crux or a console-only Debian system. I would just be duplicating efforts, and I have so little time as it is.

I am truly honored to have “ticker” mentioned in one of your articles 🙂 You mentioned wishing it could do color. I was tempted to start adding special codes to add color, or pause, or vary the speed. But then I thought, keep it simple, you can do those things from the shell.

So, for example, you could use a while loop to update the time every 20 seconds or so (like ticker-clock does), but then every 15 times through the loop (5 mins) you could call

echo -e “\x1b[0;34m”

to turn the color blue (vt100), then pipe the output of some other script (like a weather forecast, or remind) to a new invocation of ticker to scroll the message. You could change the color to reflect the content of the message. Likewise, you can vary the speed by invoking ticker multiple times with different -d parameters. You can “pause” by calling sleep(1) between calls to ticker. If you know the height of your screen (e.g. use LINES=`tput lines`) you can scroll a message completely off the screen with

ticker -l $LINES “”

I tried to make it as light as possible so you could string together multiple calls to it in a script with minimal drain on resources. That’s why I embedded the glyphs right in the source, rather than loading them from a file. But I will think about adding an option to load an alternate “font” from a file someday. In the meantime, if you know some C it is really pretty easy to tweak the look of a glyph. There are no dependencies, so its dead simple to recompile (see the Makefile).