WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Poor man's TC clock app  (Read 103 times)

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 941
Poor man's TC clock app
« on: June 17, 2025, 05:09:55 AM »
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: [Select]
watch -n1 date
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: [Select]
watch -n60 date
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.




That's a UNIX book! - cool  -- Garth

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12166
Re: Poor man's TC clock app
« Reply #1 on: June 17, 2025, 09:05:34 AM »
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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12166
Re: Poor man's TC clock app
« Reply #2 on: June 17, 2025, 09:38:00 AM »
Hi PDP-8
... Since I am only really interested in minute-updates, and not seconds, change the watch value to 60: ...
Or you could:
Code: [Select]
# 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

You can also hide the header that  watch  displays like this:
Code: [Select]
watch -tn1 date +'%H:%M'