WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Script to create a real barebones desktop clock  (Read 6100 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Script to create a real barebones desktop clock
« on: August 05, 2012, 10:59:32 PM »
The title says it all. Directions on how to launch are in the attached script. For something fancier, see:
http://forum.tinycorelinux.net/index.php/topic,13793.msg77140.html#new

« Last Edit: August 05, 2012, 11:13:06 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Script to create a real barebones desktop clock
« Reply #1 on: May 25, 2020, 10:31:18 PM »
Attached is an updated version of tinierclock. This version runs directly without the need for any external commands. Just
download, then:
Code: [Select]
chmod 775 tinierclock2.sh
./tinierclock2.sh

There are variables for changing the XY coordinates of the clock as well as the font.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Script to create a real barebones desktop clock
« Reply #2 on: May 25, 2020, 10:52:06 PM »
If I set the width to 8 for a 24h clock, it displays just "AM" - maybe the default font is too wide?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Script to create a real barebones desktop clock
« Reply #3 on: May 25, 2020, 10:56:44 PM »
Hi Juanito
A 24 hour clock doesn't have AM or PM, just 6 digits and 2 colons.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Script to create a real barebones desktop clock
« Reply #4 on: May 25, 2020, 11:01:15 PM »
Hi Juanito
You also have to change this:
Code: [Select]
# For 24 hour format, comment the 12 hour line and uncomment the 24 hour line.
# echo -ne `/bin/date +'%T'` > $TTY # Display the time (24 hour format)
echo -ne `/bin/date +'%I:%M:%S%p'` > $TTY # Display the time (12 hour format)
sleep 1
done

to this:
Code: [Select]
# For 24 hour format, comment the 12 hour line and uncomment the 24 hour line.
echo -ne `/bin/date +'%T'` > $TTY # Display the time (24 hour format)
# echo -ne `/bin/date +'%I:%M:%S%p'` > $TTY # Display the time (12 hour format)
sleep 1
done

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Script to create a real barebones desktop clock
« Reply #5 on: May 25, 2020, 11:31:08 PM »
That'll teach me not to read to the end - works fine now  :)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Script to create a real barebones desktop clock
« Reply #6 on: May 26, 2020, 05:17:09 AM »
Hi Juanito
... - works fine now  :)
Good. I though maybe I'd missed something, again.

Quote
That'll teach me not to read to the end ...
You should have just blamed me and said you couldn't find it buried amongst all the comments. ;D