General TC > Programming & Scripting - Unofficial

tinyclock, yet another clock for the desktop

(1/1)

Rich:
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: ---/* 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.
--- End code ---
This is a sample conf file:

--- Code: ---#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
--- End code ---
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.

Rich:
For a really small, no frills, script based clock, see:
http://forum.tinycorelinux.net/index.php/topic,13794.0.html

Rich:
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.

Rich:

--- Quote from: Rich on August 06, 2012, 01:45:03 AM --- ... From the C source file:

--- Code: ---  ~ 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 ~
--- End code ---

--- End quote ---
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: ---"Volume One: Xlib Programming Manual"
--- End code ---
including the quotes to find a working URL. Then go to  Appendix A. Specifying Fonts.

Navigation

[0] Message Index

Go to full version