Home > Linux > What time is it?

What time is it?

People using a panel probably has a clock somewhere in there. I know I did, when I used gnome-panel and then later pypanel/tint2 with openbox. Recently, though, I changed to pure openbox, with no panels and system tray. Yes, thats kinda boring, but I still use an old 15″ CRT display and screen real estate is something I don’t like to waste.

Now, while openbox’s key bindings took care of my window managing needs, I started missing the small little clock at the corner. I had conky set up just to display the time and date, but more often than not, it was under the browser or the pdf I was glancing through.

A panel, just for the sake of a clock? Nah thats just preposterous. Then I realised that I already had xbindkeys running, for the mpd controls and all that. So I wrote a really-tiny-little script that displays the time, date and battery for 5 seconds and then goes away.

For the time being, its just a shell script running in an urvtc instance. Maybe someday I will put it in zenity or something like that. However, for what its worth, it shows me the time at a key press, and lets me carry on the good work.

echo “DATE :: $(date +”%Y, %dth %B – %A”)”
echo “TIME :: $(date +”%r %Z”)”
echo -n “BATTERY :: $(acpi|grep -Eo “[0-9%,:]{3,}”|tail -n1)”
sleep 5

Nice and easy, and a proof of the insane customizability of a linux desktop.

Categories: Linux Tags:
  1. No comments yet.
  1. No trackbacks yet.

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: