WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tinyclock, yet another clock for the desktop  (Read 7864 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
tinyclock, yet another clock for the desktop
« on: August 06, 2012, 01:45:03 AM »
A relatively small clock for the desktop. Stripped it's about 8000 bytes, sstrip will reduce that to 6700 bytes. Runs
under Xorg or Xvesa. Has been tested under TC3.4 and TC4.1 with flwm_topside.
From the C source file:
Code: [Select]
/* Tinyclock is a small clock for the desktop. Written by Richard A. Rost Aug. 5, 2012
 * The first time it is run, it will create the file ~/.config/tinyclock/tinyclock.conf
 * If you update this file while it's running, it will re-read the conf file and apply
 * the new settings. If you drag the clock to a new location, it will update the conf
 * file. Empty lines and lines beginning with # are ignored. There are no spaces
 * allowed before or after the = signs.
 *
 * For a list of appropriate fonts available on your system:
 *    xlsfonts -f -*-*-*-*-*-*-*-S-DPIx-DPIy-T-*-iso8859-1
 * Where:
 * S  Size of font in tenth of a point. For a 12 point font, use 120
 * DPIx and DPIy  These values can be found in the conf file
 * T  Use  p  for proportional. For monospace (fixed), try  m  or  c
 *
 * A proper font line in the conf file should look similiar to this:
 *    font=-b&h-luxi sans-bold-o-normal-*-*-140-95-94-p-*-iso8859-1
 *
 * For more information about specifying fonts, see:
 * http://menehune.opt.wfu.edu/Kokua/Irix_6.5.21_doc_cd/usr/share/Insight/library/SGI_bookshelves/SGI_Developer/books/XLib_PG/sgi_html/apa.html
 *
 * To compile, install compiletc, xorg-7.x-dev and run:
 *    gcc  -march=i486 -mtune=i686 -Os -s -pipe -Wall -lX11 tinyclock.c -o tinyclock
 * Ignore the  'format' and 'charascent' may be used uninitialized  warnings.
This is a sample conf file:
Code: [Select]
#DPIx=95 DPIy=94  Desktop=1920x1080
xpos=1701
ypos=1042
12/24=12
font=-b&h-luxi mono-bold-o-normal-*-*-140-95-94-m-*-iso8859-1
I've attached the C source code for anyone who wants to try this program. I've also attached a png of the clock.
Unfortunately, imlib2_grab clipped the border.
« Last Edit: August 07, 2012, 01:06:56 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: tinyclock, yet another clock for the desktop
« Reply #1 on: August 06, 2012, 02:20:12 AM »
For a really small, no frills, script based clock, see:
http://forum.tinycorelinux.net/index.php/topic,13794.0.html

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: tinyclock, yet another clock for the desktop
« Reply #2 on: August 07, 2012, 01:11:24 PM »
I replace the attached png in the original post with a much better screen shot. The larger clock is from the C based
program and the smaller one is produced by the script mentioned in the second post.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: tinyclock, yet another clock for the desktop
« Reply #3 on: June 18, 2019, 10:29:50 AM »
... From the C source file:
Code: [Select]
  ~ Snip ~
 *
 * For more information about specifying fonts, see:
 * http://menehune.opt.wfu.edu/Kokua/Irix_6.5.21_doc_cd/usr/share/Insight/library/SGI_bookshelves/SGI_Developer/books/XLib_PG/sgi_html/apa.html
 ~ Snip ~
That URL no longer appears to be valid. This one is:
http://csweb.cs.wfu.edu/~torgerse/Kokua/Irix_6.5.21_doc_cd/usr/share/Insight/library/SGI_bookshelves/SGI_Developer/books/XLib_PG/sgi_html/apa.html

If that URL becomes non function-able, do a Google search for Version 11 of the X Window System manual:
Code: [Select]
"Volume One: Xlib Programming Manual"including the quotes to find a working URL. Then go to  Appendix A. Specifying Fonts.
« Last Edit: June 25, 2019, 10:30:53 AM by Rich »