Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

Tue, 27 Nov 2012

Set the Xfce Clock the way you want it

Before:

After:

Using the Clock app in the upper panel of the Xfce 4.8 desktop in Debian Wheezy, I didn't like the stock way date and time was displayed as just time only in the default:

08:23 AM

Luckily when you right-click on Xfce's Clock in the panel, left-click on Properties and choose "Custom Format" under Xfce's Clock options, you can use anything that the Unix/Linux date command switches offer. Go to man date and study up for every single option.

At first, I used the easy %c, which is one of a few options in date that bring a whole lot of information into your clock:

%c
Fri 02 Nov 2012 08:23:27 AM PDT

That's good but not exactly what I wanted. I spent considerable time looking at man date. This is more complicated but gives me output more like I want:

%A, %B %-d, %Y - %-I:%M %p %Z
Friday, November 2, 2012 - 8:23 AM PDT

I now have the full day of the week, full month, 12-hour time and time zone -- all with no "leading zeroes."

Lately I've wanted to save a little space, so I use %b instead of %B:

%A, %b %-d, %Y - %-I:%M %p %Z
Friday, Nov 2, 2012 - 8:23 AM PDT

Explanation: All of these parameters are explained in man date. You use a minus sign to remove the leading zeroes in dates and times when they are in single digits: %-d and %-I instead of %d and %I

Spending some time with man date is the best way to get exactly the output you want in your Xfce (or any other Unix-based) clock application.

Also: If you want to go from 08:23 AM to 8:23 AM -- removing the leading zero, use this:

%-I:%M %p
8:23 AM

I pretty much included this last one so I'll remember it. But if I didn't, man date is my friend.