Live data from Hacker News

An analog clock in your bash prompt on OS X

github.com

11–20 of 21 posts

Re: An analog clock in your bash prompt on OS X

#11
post #10

Instead of using a very long set of If statements, I think you could just use something like a=$((`date +%M`/15));b=$((128335 + `date +%l` +((a*(a**2-39*a+110))/6)));printf '%x' $b; and print the resulting hex's character, no? (I'd finish off the code myself, but I have a bus to catch) Edit: Ah, I see Sephr came prepared. ;)

I'm sure you could. It's a quick hack.

Re: An analog clock in your bash prompt on OS X

#13

Honest question: Do you prefer this to a digital time display? Why? Personally, when it comes to time, I "think" digital.

No idea really. I made it quickly this morning, and I'm trying it out today. It does make it easier to see whether a bunch of commands were performed at roughly the same time than a digital display.

Re: An analog clock in your bash prompt on OS X

#15
post #11
post #10

Instead of using a very long set of If statements, I think you could just use something like a=$((`date +%M`/15));b=$((128335 + `date +%l` +((a*(a**2-39*a+110))/6)));printf '%x' $b; and print the resulting hex's character, no? (I'd finish off the code myself, but I have a bus to catch) Edit: Ah, I see Sephr came prepared. ;)

I'm sure you could. It's a quick hack.

No criticism here; your quick hack let me do a quick hack and learn some bash in the process. :)

Re: An analog clock in your bash prompt on OS X

#16
post #11
post #10

Instead of using a very long set of If statements, I think you could just use something like a=$((`date +%M`/15));b=$((128335 + `date +%l` +((a*(a**2-39*a+110))/6)));printf '%x' $b; and print the resulting hex's character, no? (I'd finish off the code myself, but I have a bus to catch) Edit: Ah, I see Sephr came prepared. ;)

I'm sure you could. It's a quick hack.

[deleted]

Re: An analog clock in your bash prompt on OS X

#17
post #13

Honest question: Do you prefer this to a digital time display? Why? Personally, when it comes to time, I "think" digital.

No idea really. I made it quickly this morning, and I'm trying it out today. It does make it easier to see whether a bunch of commands were performed at roughly the same time than a digital display.

Your advantage unfortunately obscures other useful information.

My [zsh] prompt displays the exact time down to the second on its own line. I just scan up looking at the time to see if the hours match or minutes... But I still have the ability to know if one was 3 minutes 33 seconds or one was 27 minutes 10 seconds within that hour/half hour.

Re: An analog clock in your bash prompt on OS X

#18

This is cutesy, but having a timestamp on your prompt is an easy-to-implement sometimes-lifesaver. Highly recommended, one way or another :)

I'd love this for its compact nature, but I like digital for its precision. A title tag would be great!

   (clockface)
Post reply on HN