General TC > Programming & Scripting - Unofficial
Poor man's TC clock app
(1/1)
PDP-8:
Just a fun thing I run in Aterm ...
I have this small rectangular clock running in the lower right about the same height at Wbar. 2-step setup.
1) In aterm, run this to see the clock every second:
--- Code: ---watch -n1 date
--- End code ---
resize the terminal to a small-ish rectangle so you only see one line. Then...
2) With the window resized, stop it with ctrl-c
Since I am only really interested in minute-updates, and not seconds, change the watch value to 60:
--- Code: ---watch -n60 date
--- End code ---
Now just slide this little rectangle clock to the right of wbar. Move it off the screen a bit if you aren't interested in the seconds and other info.
I know, kinda' dumb, but I think it's fun.
Rich:
Hi PDP-8
Long time no see. :)
Here's one I wrote several years ago:
https://forum.tinycorelinux.net/index.php/topic,13794.msg150397.html#msg150397
Rich:
Hi PDP-8
--- Quote from: PDP-8 on June 17, 2025, 05:09:55 AM --- ... Since I am only really interested in minute-updates, and not seconds, change the watch value to 60: ...
--- End quote ---
Or you could:
--- Code: ---# Display only hours and minutes (24 hour mode).
tc@E310:~$ date +'%H:%M'
09:26
# Display only hours and minutes (12 hour mode).
tc@E310:~$ date +'%I:%M'
09:27
# Display only hours and minutes (12 hour mode) with AM/PM indicator.
tc@E310:~$ date +'%I:%M%p'
09:27AM
--- End code ---
You can also hide the header that watch displays like this:
--- Code: ---watch -tn1 date +'%H:%M'
--- End code ---
Navigation
[0] Message Index
Go to full version