You are not logged in.
I remember seeing a forum topic a while back where someone posted a command to give a clock at the command line that would update every second and whatnot, but I can't seem to find the topic. IIRC, it was just `watch` and a command that actually rendered the current time (it wasn't `date`). I can't seem to find the command by searching through man pages, so hopefully someone knows what I'm talking about?
Last edited by arew264 (2009-05-23 14:53:30)
Offline
Not what you are looking for, but the most awesome CLI clock is clockywock
Last edited by keenerd (2009-05-23 06:32:31)
Offline
Maybe http://bbs.archlinux.org/viewtopic.php?id=68663 is what you were looking for?
br0tat0chip in #archlinux and on freenode
Offline
while true
do
time=`date +%r`
printf "\r${time}"
done
It's a clock.
Offline
@keenerd
That's definitely awesome, but I'm looking for a digital clock because I can put a digital clock in a small window at one of the corners of the screen.
@djnm
That's the thread I was looking for. Thanks.
@karol
Yep, it's a clock. I'll have to figure out whether I want to use a straight clock like you wrote or use figlet like the poster in the forum topic. Beyond that, the approach is basically the same.
Offline
while true do time=`date +%r` printf "\r${time}" done
It's a clock.
This produces a high cpu load. Insert a sleep 1 in the loop. Same result, almost no extra load.
To know or not to know ...
... the questions remain forever.
Offline
> This produces a high cpu load. Insert a sleep 1 in the loop. Same result, almost no extra load.
Ooops, shame on me. Thanks for the heads up, bernarcher.
Offline
Improved. Run with an ampersand following, and it will give you the time as you work.
#!/bin/bash
### Floating Clock ###
######################
cols=`tput cols`
touch /tmp/tclock.run
while [ -e /tmp/tclock.run ]; do
tput sc
tput cup 0 $((cols - 13))
printf " $(date +%r) "
tput rc
sleep 1
done
Last edited by Wintervenom (2009-05-23 23:04:20)
Offline
Just to show off how boring I am:
watch -n 1 -t date
Offline
C'mon, you're not boring and the code is p-e-r-f-e-c-t.
May I have your autograph?
Offline
If you want a digital clock that is low on resources to run in X, then i would suggest an app/package called asimpleclock. It's an adesklet, and is very easy to configure.
Knute
Offline
Just to show off how boring I am:
watch -n 1 -t date
Woaah! That's perfect.
How can it be that this watch command slipped my attention in ten years of unix/linux use???
Thanks, scottish!
To know or not to know ...
... the questions remain forever.
Offline
You're welcome. watch is really useful. I use it to monitor things like sensors from lm_sensors when I'm being particularly brutal on my processor.
Offline