Ease the build process by skipping the initial "cd wmtime" step. Document this in INSTALL. --- wmtime/INSTALL | 7 +- wmtime/Makefile | 25 ++ wmtime/wmtime-mask.xbm | 72 +++++ wmtime/wmtime-master.xpm | 187 +++++++++++ wmtime/wmtime.1 | 179 +++++++++++ wmtime/wmtime.c | 691 ++++++++++++++++++++++++++++++++++++++++ wmtime/wmtime/Makefile | 25 -- wmtime/wmtime/wmtime-mask.xbm | 72 ----- wmtime/wmtime/wmtime-master.xpm | 187 ----------- wmtime/wmtime/wmtime.1 | 179 ----------- wmtime/wmtime/wmtime.c | 691 ---------------------------------------- 11 files changed, 1157 insertions(+), 1158 deletions(-) create mode 100755 wmtime/Makefile create mode 100644 wmtime/wmtime-mask.xbm create mode 100644 wmtime/wmtime-master.xpm create mode 100644 wmtime/wmtime.1 create mode 100644 wmtime/wmtime.c delete mode 100755 wmtime/wmtime/Makefile delete mode 100644 wmtime/wmtime/wmtime-mask.xbm delete mode 100644 wmtime/wmtime/wmtime-master.xpm delete mode 100644 wmtime/wmtime/wmtime.1 delete mode 100644 wmtime/wmtime/wmtime.c
diff --git a/wmtime/INSTALL b/wmtime/INSTALL index 94943c4..813a6e0 100644 --- a/wmtime/INSTALL +++ b/wmtime/INSTALL @@ -8,11 +8,10 @@ Nothing particular, but a computer might come in handy doh ;-) Installation -------------------------------------------------------------- 1) % tar -zxvf wmtime-1.1.tar.gz -2) % cd wmtime/wmtime -3) % make -4) % make install (as root) +2) % make +3) % make install (as root) -5)* WMTime uses month and weekday abbreviations from the +4)* WMTime uses month and weekday abbreviations from the currently set locale. If these abbreviations do not use Latin alphabet characters, then WMTime defaults to US/English. diff --git a/wmtime/Makefile b/wmtime/Makefile new file mode 100755 index 0000000..0b3ce5c --- /dev/null +++ b/wmtime/Makefile @@ -0,0 +1,25 @@ +LIBDIR = -L/usr/X11R6/lib +LIBS = -lXpm -lXext -lX11 -lm +OBJS = wmtime.o \ + wmgeneral/wmgeneral.o \ + wmgeneral/misc.o \ + wmgeneral/list.o +XPMS = wmtime-master.xpm wmtime-mask.xbm + +CC = gcc +CFLAGS += -O2 + +.c.o: + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c -Wall $< -o $*.o + +wmtime: $(OBJS) $(XPMS) + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o wmtime $(OBJS) $(LIBDIR) $(LIBS) + +clean:: + for i in $(OBJS) ; do \ + rm -f $$i; \ + done + rm -f wmtime + +install:: wmtime + install -m 755 wmtime $(DESTDIR)/usr/bin diff --git a/wmtime/wmtime-mask.xbm b/wmtime/wmtime-mask.xbm new file mode 100644 index 0000000..dd73c69 --- /dev/null +++ b/wmtime/wmtime-mask.xbm @@ -0,0 +1,72 @@ +#define wmtime_mask_width 128 +#define wmtime_mask_height 64 +static char wmtime_mask_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/wmtime/wmtime-master.xpm b/wmtime/wmtime-master.xpm new file mode 100644 index 0000000..d6571a5 --- /dev/null +++ b/wmtime/wmtime-master.xpm @@ -0,0 +1,187 @@ +/* XPM */ +static char * wmtime_master_xpm[] = { +"160 164 20 1", +" c #00000000FFFF", +". c #208120812081", +"X c #000000000000", +"o c #C71BC71BC71B", +"O c #2081B2CAAEBA", +"+ c #000049244103", +"@ c #00007DF771C6", +"# c #18618A288617", +"$ c #96589A699658", +"% c #79E77DF779E7", +"& c #69A66DB669A6", +"* c #514459655144", +"= c #41034D344103", +"- c #30C23CF330C2", +"; c #18619A699658", +": c #0820861779E7", +"> c #000071C66185", +", c #000061855144", +"< c #00004D344103", +"1 c #10407DF779E7", +" ................................", +" ................................", +" ................................", +" ................................", +" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................", +" X......................................................o X......................................................o ................................", +" X.........................OOO..........................o X......................................................o ................................", +" X.........................OOO+.........................o X......................................................o ................................", +" X..............@@.........OOO+........@@...............o X......................................................o ................................", +" X..............@@+.........+++........@@+..............o X......................................................o ................................", +" X...............++.....................++..............o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......@@......................................@@......o X......................................................o ................................", +" X......@@+.....................................@@+.....o X......................................................o ................................", +" X.......++......................................++.....o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................", +" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", +" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", +" X..OOO...........................................OOO...o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................", +" X..OOO+..........................................OOO+..o X...++++...++++.......++++...++++.......++++...++++....o ................................", +" X..OOO+..........................................OOO+..o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................", +" X...+++...........................................+++..o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", +" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", +" X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......@@......................................@@......o X......................................................o ................................", +" X......@@+.....................................@@+.....o X......................................................o ................................", +" X.......++......................................++.....o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" X..............@@.....................@@...............o X......................................................o ................................", +" X..............@@+........OOO.........@@+..............o X......................................................o ................................", +" X...............++........OOO+.........++..............o X......................................................o ................................", +" X.........................OOO+.........................o X......................................................o ................................", +" X..........................+++.........................o X......................................................o ................................", +" X......................................................o X......................................................o ................................", +" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................", +" ................................", +" ................................", +" XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" X..............o X....................................o X..............o X....................................o ................................", +" oooooooooooooooo oooooooooooooooooooooooooooooooooooooo oooooooooooooooo oooooooooooooooooooooooooooooooooooooo ................................", +" ................................", +" ................................", +" ................................", +" ................................", +"................................................................................................................................................................", +"..OOO...+++#.#OOO#.#OOO#.#+++#.#OOO#.#OOO#.#OOO#.#OOO#.#OOO#....................................................................................................", +".O...O.+...O.+...O.+...O.O...O.O...+.O...+.+...O.O...O.O...O............O.....$$%%&&**==--......................................................................", +".O...O.+...O.+...O.+...O.O...O.O...+.O...+.+...O.O...O.O...O.......O....O.....$$%%&&**==--......................................................................", +".#+++#..+++#.#OOO#..OOO#.#OOO#.#OOO#.#OOO#..+++#.#OOO#.#OOO#..#O#..#...O........................................................................................", +".O...O.+...O.O...+.+...O.+...O.+...O.O...O.+...O.O...O.+...O...........O......OO;;::>>,,<<......................................................................", +".O...O.+...O.O...+.+...O.+...O.+...O.O...O.+...O.O...O.+...O.......O..O.......OO;;::>>,,<<......................................................................", +"..OOO...+++#.#OOO#.#OOO#..+++#.#OOO#.#OOO#..+++#.#OOO#.#OOO#.......#..O.........................................................................................", +"................................................................................................................................................................", +" ", +"................................................................................................................................................................", +".+OOO+.#OOO...OOO#.#OOO..#OOO#.#OOO#.#OOO#.#+++#..+++#..+++#.#+++#.#+++..O+++O.#OOO..#OOO#.#OOO#.#OOO#.#OOO#.#OOO#.#OOO#.#+++#.#+++#.#+++#.#+++#.#+++#.#OOO#....", +".O...O.O...O.O...+.O...O.O...+.O...+.O...+.O...O.+...O.+...O.O...O.O...+.OO.OO.O...O.O...O.O...O.O...O.O...O.O...+.+.O.+.O...O.O...O.O...O.O...O.O...O.+...O....", +".O...O.O...O.O...+.O...O.O...+.O...+.O...+.O...O.+...O.+...O.O...O.O...+.O.O.O.O...O.O...O.O...O.O...O.O...O.O...+.+.O.+.O...O.O...O.O...O..O.O..O...O.+..O+....", +".#OOO#.#OOO..#+++..#+++#.#OOO..#OOO..#+#O#.#OOO#..+++#..+++#.#OOO..#+++..#+++#.#+++#.#+++#.#OOO#.#O++#.#OOO..#OOO#..+#+..#+++#.#+++#.#+++#...O...#OOO#..+O+.....", +".O...O.O...O.O...+.O...O.O...+.O...+.O...O.O...O.+...O.+...O.O...O.O...+.O...O.O...O.O...O.O...+.O.O.O.O...O.+...O.+.O.+.O...O.O...O.O.O.O..O.O..+...O.+O..+....", +".O...O.O...O.O...+.O...O.O...+.O...+.O...O.O...O.+...O.+...O.O...O.O...+.O...O.O...O.O...O.O...+.O..OO.O...O.+...O.+.O.+.O...O.O...O.OO.OO.O...O.+...O.O...+....", +".#+++#.#OOO...OOO#.#OOO..#OOO#.#+++..#OOO#.#+++#..+++#.#OOO#.#+++#.#OOO#.#+++#.#+++#.#OOO#.#+++..#OOO#.#+++#.#OOO#..+#+..#OOOO..OOO..#+++#.#+++#.#OOO#.#OOO#....", +"................................................................................................................................................................", +" ", +"............................................................................. ", +"............................................................................. ", +"...OOOO...++++1.1OOOO#.1OOOO1.1++++1.1OOOO1.1OOOO#.1OOOO1.1OOOO#.1OOOO#...... ", +"..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O..O... ", +"..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O..O... ", +"..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O...... ", +"..1++++1..++++1.1OOOO1.1OOOO1.1OOOO1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1...... ", +"..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O...... ", +"..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O..O... ", +"..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O..O... ", +"...OOOO...++++1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1...... ", +"............................................................................. ", +"............................................................................. ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/wmtime/wmtime.1 b/wmtime/wmtime.1 new file mode 100644 index 0000000..8b51e57 --- /dev/null +++ b/wmtime/wmtime.1 @@ -0,0 +1,179 @@ +'\" t +.\" Man page for wmtime +.\" Copyright (c) 2003 Software in the Public Interest, Inc. +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2 of the License, or (at +.\" your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, but +.\" WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +.\" General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; if not, write to the Free Software +.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +.\" USA. +.\" +.TH WMTIME 1 "October 2013" "WMTIME 1.1" + +.SH NAME +wmtime \- Window Maker dockapp that displays the time and date + +.SH SYNOPSIS + +.B wmtime +[ +.I OPTION +] + +.SH DESCRIPTION + +.B WMTime +displays the time and date and gives you some nice additional +features too. It is intended for docking in Window Maker. + +It currently provides: + +.IP \(bu 4 +the time and date; + +.IP \(bu +a realtime morphing interface (analog <> digital mode); +.IP \(bu +auto\-scaled and anti\-aliased hands; +.IP \(bu +localization, displaying the day and date in various languages; +.IP \(bu +three user\-defined commands to launch. + +.SH OPTIONS + +.TP +.BR \-d , \ \-digital +Display the digital clock on startup, instead of the analog clock. + +.TP +.BI \-display \ display +This option specifies the X server to contact; see +.IR X(7x) . + +.TP +.BI \-geometry \ geometry +This option specifies the preferred position of clock; see +.IR X(7x) . + +.TP +.BR \-n , \ \-noseconds +Disables the second hand. + +.TP +.B \-h +Show help information. + +.TP +.B \-v +Print the version number. + +.SH USAGE +The +.B WMTime +window is separated into top and bottom sections. The top section +contains a clock and the bottom section contains the date. + +The clock can be toggled between analog and digital modes. To do this, +click in the bottom section of the window. + +WMTime can also be used to launch programs. You may click either left, +middle, or right mouse buttons in the top section of the window. The +pre\-configured program will be launched according to the mouse button +clicked. (see +.B CONFIGURATION FILE +below.) + +In order to move +.BR WMTime , +drag on the outer edges. These are not sensitive to mouse clicks. + +.SH "DOCKING IN WINDOW MANAGERS" + +.TP +Window Maker + +Window Maker users should drag and drop the +.B WMTime +window on the Dock. Then, right\-click on the border of the window and +select \*(lqSettings...\*(rq. Check \*(lqStart when Window Maker +is started\*(rq. + +.TP +AfterStep + +AfterStep users should put the following in their +.I $HOME/.steprc + +.RS 16 +Wharf wmtime \- MaxSwallow "wmtime" wmtime & +.RE + +.TP +Other window managers + +.B WMTime +runs nicely as a 64x64 shaped icon on your desktop. + +.SH "CONFIGURATION FILE" + +.B WMTime +can launch three user\-defined commands, triggered by left, middle and +right mouse button clicks. You can define the commands to launch in +.I $HOME/.wmtimerc + +.RS +.PD 0 +left: xterm +.PP +middle: xload +.PP +right: xcalc +.PP +.PD +.RE + +If +.B WMTime +detects a +.I $HOME/.wmtimerc +file, it will launch the appropriate command when you click on the clock. + +The system administrator can define default commands in +.IR /etc/wmtimerc . +The administrator may also choose to \*(lqfix\*(rq particular commands, +making it impossible for users to change. These commands can be defined in +.IR /etc/wmtimerc.fixed , +although this isn't a nice thing to do. + +.SH FILES + +.I /etc/wmtimerc +.br +.I $HOME/.wmtimerc +.br +.I /etc/wmtimerc.fixed + +.SH AUTHORS + +.B WMTime +was written by Martijn Pieterse and Antoine Nulle. + +This manual page was written by Simon Law <sfl...@debian.org> for the +.B Debian +system (but may be used by others). It is based on the documentation provided +by the original program. + +This manual is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. diff --git a/wmtime/wmtime.c b/wmtime/wmtime.c new file mode 100644 index 0000000..2bb9c5c --- /dev/null +++ b/wmtime/wmtime.c @@ -0,0 +1,691 @@ +/* + Code based on wmppp/wmifs + + [Orig WMMON comments] + + This code was mainly put together by looking at the + following programs: + + asclock + A neat piece of equip, used to display the date + and time on the screen. + Comes with every AfterStep installation. + + Source used: + How do I create a not so solid window? + How do I open a window? + How do I use pixmaps? + + ------------------------------------------------------------ + + Author: Martijn Pieterse (piete...@xs4all.nl) + + This program is distributed under the GPL license. + (as were asclock and pppstats) + + ---- + Changes: + ---- + 15/07/2008 (Paul Harris, harris...@gmail.com) + * Minor changes to correct build warnings + 09/10/2003 (Simon Law, sfl...@debian.org) + * Add -geometry support + * Add -noseconds support + * Make the digital clock fill the space provided + * Eliminated exploitable static buffers + 17/05/1998 (Antoine Nulle, w...@xs4all.nl) + * Updated version number and some other minor stuff + 16/05/1998 (Antoine Nulle, w...@xs4all.nl) + * Added Locale support, based on original diff supplied + by Alen Salamun (snow...@hal9000.medinet.si) + 04/05/1998 (Martijn Pieterse, piete...@xs4all.nl) + * Moved the hands one pixel down. + * Removed the RedrawWindow out of the main loop + 02/05/1998 (Martijn Pieterse, piete...@xs4all.nl) + * Removed a lot of code that was in the wmgeneral dir. + 02/05/1998 (Antoine Nulle, w...@xs4all.nl) + * Updated master-xpm, hour dots where a bit 'off' + 30/04/1998 (Martijn Pieterse, piete...@xs4all.nl) + * Added anti-aliased hands + 23/04/1998 (Martijn Pieterse, piete...@xs4all.nl) + * Changed the hand lengths.. again! ;) + * Zombies were created, so added wait code + 21/04/1998 (Martijn Pieterse, piete...@xs4all.nl) + * Added digital/analog switching support + 18/04/1998 (Martijn Pieterse, piete...@xs4all.nl) + * Started this project. + * Copied the source from wmmon. +*/ + +#define _GNU_SOURCE +#include <stdlib.h> +#include <stdio.h> +#include <time.h> +#include <string.h> +#include <fcntl.h> +#include <unistd.h> +#include <math.h> +#include <locale.h> +#include <langinfo.h> +#include <iconv.h> +#include <ctype.h> + +#include <sys/wait.h> +#include <sys/param.h> +#include <sys/types.h> + +#include <X11/Xlib.h> +#include <X11/xpm.h> +#include <X11/extensions/shape.h> + +#include "wmgeneral/wmgeneral.h" +#include "wmgeneral/misc.h" + +#include "wmtime-master.xpm" +#include "wmtime-mask.xbm" + + /***********/ + /* Defines */ +/***********/ + +const char* default_left_action = NULL; +const char* default_middle_action = NULL; +const char* default_right_action = NULL; + +#define WMMON_VERSION "1.1" + + /********************/ + /* Global Variables */ +/********************/ + +int digital = 0; +int noseconds = 0; +char day_of_week[7][3] = { "SU", "MO", "TU", "WE", "TH", "FR", "SA" }; +char mon_of_year[12][4] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" }; + +/* functions */ +void usage(char *); +void printversion(void); + +void wmtime_routine(int, char **); +void get_lang(); + +int main(int argc, char *argv[]) { + + int i; + char *name = argv[0]; + + for (i=1; i<argc; i++) { + char *arg = argv[i]; + + if (*arg=='-') { + switch (arg[1]) { + case 'd' : + if (strcmp(arg+1, "display") + && strcmp(arg+1, "digital") && strcmp(arg+1, "d")) { + usage(name); + return 1; + } + if (!strcmp(arg+1, "digital") || !(strcmp(arg+1, "d"))) + digital = 1; + break; + case 'g' : + if (strcmp(arg+1, "geometry")) { + usage(name); + return 1; + } + break; + case 'n' : + if (strcmp(arg+1, "noseconds") && strcmp(arg+1, "n")) { + usage(name); + return 1; + } else { + noseconds = 1; + } + break; + case 'v' : + printversion(); + return 0; + default: + usage(name); + return 1; + } + } + } + + if (setlocale(LC_ALL, "") != NULL) + get_lang(); + + wmtime_routine(argc, argv); + return 0; +} + +/************/ +/* get_lang */ +/************/ +void get_lang(void) +{ + char langbuf[10], outbuf[10]; + char *inp, *outp; + iconv_t icd; + int i, ret; + size_t insize, outsize; + + icd = iconv_open("ASCII//TRANSLIT", nl_langinfo(CODESET)); + if (icd < 0) + return; + + for (i = 0; i < 7; i++) { + strncpy(langbuf, nl_langinfo(ABDAY_1 + i), 10); + insize = outsize = 10; + inp = langbuf; + outp = outbuf; + do { + ret = iconv(icd, &inp, &insize, &outp, &outsize); + } while (outsize > 0 && ret > 0); + if (strstr(outbuf,"?") != NULL) return; + for (outp = outbuf, outsize = 0; *outp != 0 && outsize < 2; + outp++, outsize++) + day_of_week[i][outsize] = toupper(*outp); + } + for (i = 0; i < 12; i++) { + strncpy(langbuf, nl_langinfo(ABMON_1 + i), 10); + insize = outsize = 10; + inp = langbuf; + outp = outbuf; + do { + ret = iconv(icd, &inp, &insize, &outp, &outsize); + } while (outsize > 0 && ret > 0); + if (strstr(outbuf,"?") != NULL) return; + for (outp = outbuf, outsize = 0; *outp != 0 && outsize < 3; + outp++, outsize++) + mon_of_year[i][outsize] = toupper(*outp); + } + + iconv_close(icd); +} + +/*******************************************************************************\ +|* wmtime_routine *| +\*******************************************************************************/ + +char *left_action = NULL; +char *right_action = NULL; +char *middle_action = NULL; + +void DrawTime(int, int, int); +void DrawWijzer(int, int, int); +void DrawDate(int, int, int); + +void wmtime_routine(int argc, char **argv) { + + rckeys wmtime_keys[] = { + { "left", &left_action }, + { "right", &right_action }, + { "middle", &middle_action }, + { NULL, NULL } + }; + + int i; + XEvent Event; + int but_stat = -1; + + struct tm *time_struct; + + long starttime; + long curtime; + + char *conffile = NULL; + + /* Scan through ~/.wmtimerc for the mouse button actions. */ + if (default_left_action) left_action = strdup(default_left_action); + if (default_middle_action) middle_action = strdup(default_middle_action); + if (default_right_action) right_action = strdup(default_right_action); + + /* Scan through the .rc files */ + if (asprintf(&conffile, "/etc/wmtimerc") >= 0) { + parse_rcfile(conffile, wmtime_keys); + free(conffile); + } + + if (asprintf(&conffile, "%s/.wmtimerc", getenv("HOME")) >= 0) { + parse_rcfile(conffile, wmtime_keys); + free(conffile); + } + + if (asprintf(&conffile, "/etc/wmtimerc.fixed") >= 0) { + parse_rcfile(conffile, wmtime_keys); + free(conffile); + } + + openXwindow(argc, argv, wmtime_master_xpm, wmtime_mask_bits, 128, 64); + + /* Mask out the right parts of the clock */ + copyXPMArea(0, 0, 128, 64, 0, 98); /* Draw the borders */ + copyXPMArea(0, 0, 64, 64, 64, 0); /* Draw the clock face */ + copyXPMArea(64, 98, 64, 64, 0, 0); /* Draw the LCD background */ + setMaskXY(0, 0); + + /* add mouse region */ + AddMouseRegion(0, 5, 48, 58, 60); + AddMouseRegion(1, 5, 5, 58, 46); + + starttime = time(0); + + curtime = time(0); + time_struct = localtime(&curtime); + + while (1) { + curtime = time(0); + + waitpid(0, NULL, WNOHANG); + + time_struct = localtime(&curtime); + + + if (curtime >= starttime) { + if (!digital) { + /* Now to update the seconds */ + + DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); + + DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); + + } else { + + DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); + + DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); + } + RedrawWindow(); + } + + + while (XPending(display)) { + XNextEvent(display, &Event); + switch (Event.type) { + case Expose: + RedrawWindow(); + break; + case DestroyNotify: + XCloseDisplay(display); + exit(0); + break; + case ButtonPress: + but_stat = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); + break; + case ButtonRelease: + i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); + if (but_stat == i && but_stat >= 0) { + switch (but_stat) { + case 0: + digital = 1-digital; + + if (digital) { + copyXPMArea(64, 98, 64, 64, 0, 0); + DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); + DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); + } else { + copyXPMArea(0, 98, 64, 64, 0, 0); + DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); + DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); + } + RedrawWindow(); + break; + case 1: + switch (Event.xbutton.button) { + case 1: + if (left_action) + execCommand(left_action); + break; + case 2: + if (middle_action) + execCommand(middle_action); + break; + case 3: + if (right_action) + execCommand(right_action); + break; + } + } + } + break; + } + } + + /* Sleep 0.3 seconds */ + usleep(300000L); + } +} + +/*******************************************************************************\ +|* DrawTime *| +\*******************************************************************************/ + +void DrawTime(int hr, int min, int sec) { + const int time_size = 16; + char time[time_size]; + char *p = time; + int i,j,k=6; + int numfields; + + /* 7x13 */ + + if (noseconds) { + snprintf(time, time_size, "%02d:%02d ", hr, min); + numfields = 2; + } + else { + snprintf(time, time_size, "%02d:%02d:%02d ", hr, min, sec); + numfields = 3; + } + + for (i=0; i < numfields; i++) { + for (j=0; j<2; j++) { + copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 18); + k += 7; + p++; + } + if (*p == ':') { + copyXPMArea(71, 84, 5, 13, k, 18); + k += 4; + p++; + } + } +} + +/*******************************************************************************\ +|* DrawDate *| +\*******************************************************************************/ + +void DrawDate(int wkday, int dom, int month) { + const int date_size = 16; + char date[date_size]; + char *p = date; + int i,k; + + /* 7x13 */ + + snprintf(date, date_size, + "%.2s%02d%.3s ", day_of_week[wkday], dom, mon_of_year[month]); + + k = 5; + for (i=0; i<2; i++) { + if (*p < 'A') + copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); + else + copyXPMArea((*p-'A')*6, 74, 6, 9, k, 49); + k += 6; + p++; + } + k = 23; + for (i=0; i<2; i++) { + copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); + k += 6; + p++; + } + copyXPMArea(61, 64, 4, 9, k, 49); + k += 4; + for (i=0; i<3; i++) { + if (*p < 'A') + copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); + else + copyXPMArea((*p-'A')*6, 74, 6, 9, k, 49); + k += 6; + p++; + } +} + +/*******************************************************************************\ +|* DrawWijzer *| +\*******************************************************************************/ + +void DrawWijzer(int hr, int min, int sec) { + + double psi; + int dx,dy; + int x,y; + int ddx,ddy; + int adder; + int k; + + int i; + + hr %= 12; + + copyXPMArea(5+64, 5, 54, 40, 5, 5); + + /**********************************************************************/ + psi = hr * (M_PI / 6.0); + psi += min * (M_PI / 360); + + dx = floor(sin(psi) * 22 * 0.7 + 0.5); + dy = floor(-cos(psi) * 16 * 0.7 + 0.5); + + // dx, dy is het punt waar we naar toe moeten. + // Zoek alle punten die ECHT op de lijn liggen: + + ddx = 1; + ddy = 1; + if (dx < 0) ddx = -1; + if (dy < 0) ddy = -1; + + x = 0; + y = 0; + + if (abs(dx) > abs(dy)) { + if (dy != 0) + adder = abs(dx) / 2; + else + adder = 0; + for (i=0; i<abs(dx); i++) { + // laat de kleur afhangen van de adder. + // adder loopt van abs(dx) tot 0 + + k = 12 - adder / (abs(dx) / 12.0); + copyXPMArea(79+k, 67, 1, 1, x + 31, y + 24 - ddy); + + copyXPMArea(79, 67, 1, 1, x + 31, y + 24); + + k = 12-k; + copyXPMArea(79+k, 67, 1, 1, x + 31, y + 24 + ddy); + + + x += ddx; + + adder -= abs(dy); + if (adder < 0) { + adder += abs(dx); + y += ddy; + } + } + } else { + if (dx != 0) + adder = abs(dy) / 2; + else + adder = 0; + for (i=0; i<abs(dy); i++) { + k = 12 - adder / (abs(dy) / 12.0); + copyXPMArea(79+k, 67, 1, 1, x + 31 - ddx, y + 24); + + copyXPMArea(79, 67, 1, 1, x + 31, y + 24); + + k = 12-k; + copyXPMArea(79+k, 67, 1, 1, x + 31 + ddx, y + 24); + + y += ddy; + + adder -= abs(dx); + if (adder < 0) { + adder += abs(dy); + x += ddx; + } + } + } + /**********************************************************************/ + psi = min * (M_PI / 30.0); + psi += sec * (M_PI / 1800); + + dx = floor(sin(psi) * 22 * 0.55 + 0.5); + dy = floor(-cos(psi) * 16 * 0.55 + 0.5); + + // dx, dy is het punt waar we naar toe moeten. + // Zoek alle punten die ECHT op de lijn liggen: + + dx += dx; + dy += dy; + + ddx = 1; + ddy = 1; + if (dx < 0) ddx = -1; + if (dy < 0) ddy = -1; + + x = 0; + y = 0; + + if (abs(dx) > abs(dy)) { + if (dy != 0) + adder = abs(dx) / 2; + else + adder = 0; + for (i=0; i<abs(dx); i++) { + // laat de kleur afhangen van de adder. + // adder loopt van abs(dx) tot 0 + + k = 12 - adder / (abs(dx) / 12.0); + copyXPMArea(79+k, 67, 1, 1, x + 31, y + 24 - ddy); + + copyXPMArea(79, 67, 1, 1, x + 31, y + 24); + + k = 12-k; + copyXPMArea(79+k, 67, 1, 1, x + 31, y + 24 + ddy); + + + x += ddx; + + adder -= abs(dy); + if (adder < 0) { + adder += abs(dx); + y += ddy; + } + } + } else { + if (dx != 0) + adder = abs(dy) / 2; + else + adder = 0; + for (i=0; i<abs(dy); i++) { + k = 12 - adder / (abs(dy) / 12.0); + copyXPMArea(79+k, 67, 1, 1, x + 31 - ddx, y + 24); + + copyXPMArea(79, 67, 1, 1, x + 31, y + 24); + + k = 12-k; + copyXPMArea(79+k, 67, 1, 1, x + 31 + ddx, y + 24); + + y += ddy; + + adder -= abs(dx); + if (adder < 0) { + adder += abs(dy); + x += ddx; + } + } + } + /**********************************************************************/ + if (noseconds) + return; /* Skip drawing the seconds. */ + + psi = sec * (M_PI / 30.0); + + dx = floor(sin(psi) * 22 * 0.9 + 0.5); + dy = floor(-cos(psi) * 16 * 0.9 + 0.5); + + // dx, dy is het punt waar we naar toe moeten. + // Zoek alle punten die ECHT op de lijn liggen: + + ddx = 1; + ddy = 1; + if (dx < 0) ddx = -1; + if (dy < 0) ddy = -1; + + if (dx == 0) ddx = 0; + if (dy == 0) ddy = 0; + + x = 0; + y = 0; + + + if (abs(dx) > abs(dy)) { + if (dy != 0) + adder = abs(dx) / 2; + else + adder = 0; + for (i=0; i<abs(dx); i++) { + // laat de kleur afhangen van de adder. + // adder loopt van abs(dx) tot 0 + + k = 12 - adder / (abs(dx) / 12.0); + copyXPMArea(79+k, 70, 1, 1, x + 31, y + 24 - ddy); + + k = 12-k; + copyXPMArea(79+k, 70, 1, 1, x + 31, y + 24); + + + x += ddx; + + adder -= abs(dy); + if (adder < 0) { + adder += abs(dx); + y += ddy; + } + } + } else { + if (dx != 0) + adder = abs(dy) / 2; + else + adder = 0; + for (i=0; i<abs(dy); i++) { + k = 12 - adder / (abs(dy) / 12.0); + copyXPMArea(79+k, 70, 1, 1, x + 31 - ddx, y + 24); + + k = 12-k; + copyXPMArea(79+k, 70, 1, 1, x + 31, y + 24); + + y += ddy; + + adder -= abs(dx); + if (adder < 0) { + adder += abs(dy); + x += ddx; + } + } + } +} + +/*******************************************************************************\ +|* usage *| +\*******************************************************************************/ + +void usage(char *name) { + printf("Usage: %s [OPTION]...\n", name); + printf("WindowMaker dockapp that displays the time and date.\n"); + printf("\n"); + printf(" -d, -digital display the digital clock\n"); + printf(" -display DISPLAY contact the DISPLAY X server\n"); + printf(" -geometry GEOMETRY position the clock at GEOMETRY\n"); + printf(" -n, -noseconds disables the second hand\n"); + printf(" -h display this help and exit\n"); + printf(" -v output version information and exit\n"); +} + +/*******************************************************************************\ +|* printversion *| +\*******************************************************************************/ + +void printversion(void) { + printf("WMTime version %s\n", WMMON_VERSION); +} + +/* vim: sw=4 ts=4 columns=82 + */ diff --git a/wmtime/wmtime/Makefile b/wmtime/wmtime/Makefile deleted file mode 100755 index 35ac1ba..0000000 --- a/wmtime/wmtime/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -LIBDIR = -L/usr/X11R6/lib -LIBS = -lXpm -lXext -lX11 -lm -OBJS = wmtime.o \ - ../wmgeneral/wmgeneral.o \ - ../wmgeneral/misc.o \ - ../wmgeneral/list.o -XPMS = wmtime-master.xpm wmtime-mask.xbm - -CC = gcc -CFLAGS += -O2 - -.c.o: - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c -Wall $< -o $*.o - -wmtime: $(OBJS) $(XPMS) - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o wmtime $(OBJS) $(LIBDIR) $(LIBS) - -clean:: - for i in $(OBJS) ; do \ - rm -f $$i; \ - done - rm -f wmtime - -install:: wmtime - install -m 755 wmtime $(DESTDIR)/usr/bin diff --git a/wmtime/wmtime/wmtime-mask.xbm b/wmtime/wmtime/wmtime-mask.xbm deleted file mode 100644 index dd73c69..0000000 --- a/wmtime/wmtime/wmtime-mask.xbm +++ /dev/null @@ -1,72 +0,0 @@ -#define wmtime_mask_width 128 -#define wmtime_mask_height 64 -static char wmtime_mask_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0x0f, - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; diff --git a/wmtime/wmtime/wmtime-master.xpm b/wmtime/wmtime/wmtime-master.xpm deleted file mode 100644 index d6571a5..0000000 --- a/wmtime/wmtime/wmtime-master.xpm +++ /dev/null @@ -1,187 +0,0 @@ -/* XPM */ -static char * wmtime_master_xpm[] = { -"160 164 20 1", -" c #00000000FFFF", -". c #208120812081", -"X c #000000000000", -"o c #C71BC71BC71B", -"O c #2081B2CAAEBA", -"+ c #000049244103", -"@ c #00007DF771C6", -"# c #18618A288617", -"$ c #96589A699658", -"% c #79E77DF779E7", -"& c #69A66DB669A6", -"* c #514459655144", -"= c #41034D344103", -"- c #30C23CF330C2", -"; c #18619A699658", -": c #0820861779E7", -"> c #000071C66185", -", c #000061855144", -"< c #00004D344103", -"1 c #10407DF779E7", -" ................................", -" ................................", -" ................................", -" ................................", -" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................", -" X......................................................o X......................................................o ................................", -" X.........................OOO..........................o X......................................................o ................................", -" X.........................OOO+.........................o X......................................................o ................................", -" X..............@@.........OOO+........@@...............o X......................................................o ................................", -" X..............@@+.........+++........@@+..............o X......................................................o ................................", -" X...............++.....................++..............o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......@@......................................@@......o X......................................................o ................................", -" X......@@+.....................................@@+.....o X......................................................o ................................", -" X.......++......................................++.....o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................", -" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", -" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", -" X..OOO...........................................OOO...o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................", -" X..OOO+..........................................OOO+..o X...++++...++++.......++++...++++.......++++...++++....o ................................", -" X..OOO+..........................................OOO+..o X..+....+.+....+.....+....+.+....+.....+....+.+....+...o ................................", -" X...+++...........................................+++..o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", -" X......................................................o X..+....+.+....+..+..+....+.+....+..+..+....+.+....+...o ................................", -" X......................................................o X...++++...++++.......++++...++++.......++++...++++....o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......@@......................................@@......o X......................................................o ................................", -" X......@@+.....................................@@+.....o X......................................................o ................................", -" X.......++......................................++.....o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" X..............@@.....................@@...............o X......................................................o ................................", -" X..............@@+........OOO.........@@+..............o X......................................................o ................................", -" X...............++........OOO+.........++..............o X......................................................o ................................", -" X.........................OOO+.........................o X......................................................o ................................", -" X..........................+++.........................o X......................................................o ................................", -" X......................................................o X......................................................o ................................", -" oooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooooooooooooooooooooooooooooooo ................................", -" ................................", -" ................................", -" XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" X..............o X....................................o X..............o X....................................o ................................", -" oooooooooooooooo oooooooooooooooooooooooooooooooooooooo oooooooooooooooo oooooooooooooooooooooooooooooooooooooo ................................", -" ................................", -" ................................", -" ................................", -" ................................", -"................................................................................................................................................................", -"..OOO...+++#.#OOO#.#OOO#.#+++#.#OOO#.#OOO#.#OOO#.#OOO#.#OOO#....................................................................................................", -".O...O.+...O.+...O.+...O.O...O.O...+.O...+.+...O.O...O.O...O............O.....$$%%&&**==--......................................................................", -".O...O.+...O.+...O.+...O.O...O.O...+.O...+.+...O.O...O.O...O.......O....O.....$$%%&&**==--......................................................................", -".#+++#..+++#.#OOO#..OOO#.#OOO#.#OOO#.#OOO#..+++#.#OOO#.#OOO#..#O#..#...O........................................................................................", -".O...O.+...O.O...+.+...O.+...O.+...O.O...O.+...O.O...O.+...O...........O......OO;;::>>,,<<......................................................................", -".O...O.+...O.O...+.+...O.+...O.+...O.O...O.+...O.O...O.+...O.......O..O.......OO;;::>>,,<<......................................................................", -"..OOO...+++#.#OOO#.#OOO#..+++#.#OOO#.#OOO#..+++#.#OOO#.#OOO#.......#..O.........................................................................................", -"................................................................................................................................................................", -" ", -"................................................................................................................................................................", -".+OOO+.#OOO...OOO#.#OOO..#OOO#.#OOO#.#OOO#.#+++#..+++#..+++#.#+++#.#+++..O+++O.#OOO..#OOO#.#OOO#.#OOO#.#OOO#.#OOO#.#OOO#.#+++#.#+++#.#+++#.#+++#.#+++#.#OOO#....", -".O...O.O...O.O...+.O...O.O...+.O...+.O...+.O...O.+...O.+...O.O...O.O...+.OO.OO.O...O.O...O.O...O.O...O.O...O.O...+.+.O.+.O...O.O...O.O...O.O...O.O...O.+...O....", -".O...O.O...O.O...+.O...O.O...+.O...+.O...+.O...O.+...O.+...O.O...O.O...+.O.O.O.O...O.O...O.O...O.O...O.O...O.O...+.+.O.+.O...O.O...O.O...O..O.O..O...O.+..O+....", -".#OOO#.#OOO..#+++..#+++#.#OOO..#OOO..#+#O#.#OOO#..+++#..+++#.#OOO..#+++..#+++#.#+++#.#+++#.#OOO#.#O++#.#OOO..#OOO#..+#+..#+++#.#+++#.#+++#...O...#OOO#..+O+.....", -".O...O.O...O.O...+.O...O.O...+.O...+.O...O.O...O.+...O.+...O.O...O.O...+.O...O.O...O.O...O.O...+.O.O.O.O...O.+...O.+.O.+.O...O.O...O.O.O.O..O.O..+...O.+O..+....", -".O...O.O...O.O...+.O...O.O...+.O...+.O...O.O...O.+...O.+...O.O...O.O...+.O...O.O...O.O...O.O...+.O..OO.O...O.+...O.+.O.+.O...O.O...O.OO.OO.O...O.+...O.O...+....", -".#+++#.#OOO...OOO#.#OOO..#OOO#.#+++..#OOO#.#+++#..+++#.#OOO#.#+++#.#OOO#.#+++#.#+++#.#OOO#.#+++..#OOO#.#+++#.#OOO#..+#+..#OOOO..OOO..#+++#.#+++#.#OOO#.#OOO#....", -"................................................................................................................................................................", -" ", -"............................................................................. ", -"............................................................................. ", -"...OOOO...++++1.1OOOO#.1OOOO1.1++++1.1OOOO1.1OOOO#.1OOOO1.1OOOO#.1OOOO#...... ", -"..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O..O... ", -"..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O..O... ", -"..O....O.+....O.+....O.+....O.O....O.O....+.O....+.+....O.O....O.O....O...... ", -"..1++++1..++++1.1OOOO1.1OOOO1.1OOOO1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1...... ", -"..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O...... ", -"..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O..O... ", -"..O....O.+....O.O....+.+....O.+....O.+....O.O....O.+....O.O....O.+....O..O... ", -"...OOOO...++++1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1..++++1.1OOOO1.1OOOO1...... ", -"............................................................................. ", -"............................................................................. ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" "}; diff --git a/wmtime/wmtime/wmtime.1 b/wmtime/wmtime/wmtime.1 deleted file mode 100644 index 8b51e57..0000000 --- a/wmtime/wmtime/wmtime.1 +++ /dev/null @@ -1,179 +0,0 @@ -'\" t -.\" Man page for wmtime -.\" Copyright (c) 2003 Software in the Public Interest, Inc. -.\" -.\" This program is free software; you can redistribute it and/or modify -.\" it under the terms of the GNU General Public License as published by -.\" the Free Software Foundation; either version 2 of the License, or (at -.\" your option) any later version. -.\" -.\" This program is distributed in the hope that it will be useful, but -.\" WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -.\" General Public License for more details. -.\" -.\" You should have received a copy of the GNU General Public License -.\" along with this program; if not, write to the Free Software -.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 -.\" USA. -.\" -.TH WMTIME 1 "October 2013" "WMTIME 1.1" - -.SH NAME -wmtime \- Window Maker dockapp that displays the time and date - -.SH SYNOPSIS - -.B wmtime -[ -.I OPTION -] - -.SH DESCRIPTION - -.B WMTime -displays the time and date and gives you some nice additional -features too. It is intended for docking in Window Maker. - -It currently provides: - -.IP \(bu 4 -the time and date; - -.IP \(bu -a realtime morphing interface (analog <> digital mode); -.IP \(bu -auto\-scaled and anti\-aliased hands; -.IP \(bu -localization, displaying the day and date in various languages; -.IP \(bu -three user\-defined commands to launch. - -.SH OPTIONS - -.TP -.BR \-d , \ \-digital -Display the digital clock on startup, instead of the analog clock. - -.TP -.BI \-display \ display -This option specifies the X server to contact; see -.IR X(7x) . - -.TP -.BI \-geometry \ geometry -This option specifies the preferred position of clock; see -.IR X(7x) . - -.TP -.BR \-n , \ \-noseconds -Disables the second hand. - -.TP -.B \-h -Show help information. - -.TP -.B \-v -Print the version number. - -.SH USAGE -The -.B WMTime -window is separated into top and bottom sections. The top section -contains a clock and the bottom section contains the date. - -The clock can be toggled between analog and digital modes. To do this, -click in the bottom section of the window. - -WMTime can also be used to launch programs. You may click either left, -middle, or right mouse buttons in the top section of the window. The -pre\-configured program will be launched according to the mouse button -clicked. (see -.B CONFIGURATION FILE -below.) - -In order to move -.BR WMTime , -drag on the outer edges. These are not sensitive to mouse clicks. - -.SH "DOCKING IN WINDOW MANAGERS" - -.TP -Window Maker - -Window Maker users should drag and drop the -.B WMTime -window on the Dock. Then, right\-click on the border of the window and -select \*(lqSettings...\*(rq. Check \*(lqStart when Window Maker -is started\*(rq. - -.TP -AfterStep - -AfterStep users should put the following in their -.I $HOME/.steprc - -.RS 16 -Wharf wmtime \- MaxSwallow "wmtime" wmtime & -.RE - -.TP -Other window managers - -.B WMTime -runs nicely as a 64x64 shaped icon on your desktop. - -.SH "CONFIGURATION FILE" - -.B WMTime -can launch three user\-defined commands, triggered by left, middle and -right mouse button clicks. You can define the commands to launch in -.I $HOME/.wmtimerc - -.RS -.PD 0 -left: xterm -.PP -middle: xload -.PP -right: xcalc -.PP -.PD -.RE - -If -.B WMTime -detects a -.I $HOME/.wmtimerc -file, it will launch the appropriate command when you click on the clock. - -The system administrator can define default commands in -.IR /etc/wmtimerc . -The administrator may also choose to \*(lqfix\*(rq particular commands, -making it impossible for users to change. These commands can be defined in -.IR /etc/wmtimerc.fixed , -although this isn't a nice thing to do. - -.SH FILES - -.I /etc/wmtimerc -.br -.I $HOME/.wmtimerc -.br -.I /etc/wmtimerc.fixed - -.SH AUTHORS - -.B WMTime -was written by Martijn Pieterse and Antoine Nulle. - -This manual page was written by Simon Law <sfl...@debian.org> for the -.B Debian -system (but may be used by others). It is based on the documentation provided -by the original program. - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. diff --git a/wmtime/wmtime/wmtime.c b/wmtime/wmtime/wmtime.c deleted file mode 100644 index 2c4f6e8..0000000 --- a/wmtime/wmtime/wmtime.c +++ /dev/null @@ -1,691 +0,0 @@ -/* - Code based on wmppp/wmifs - - [Orig WMMON comments] - - This code was mainly put together by looking at the - following programs: - - asclock - A neat piece of equip, used to display the date - and time on the screen. - Comes with every AfterStep installation. - - Source used: - How do I create a not so solid window? - How do I open a window? - How do I use pixmaps? - - ------------------------------------------------------------ - - Author: Martijn Pieterse (piete...@xs4all.nl) - - This program is distributed under the GPL license. - (as were asclock and pppstats) - - ---- - Changes: - ---- - 15/07/2008 (Paul Harris, harris...@gmail.com) - * Minor changes to correct build warnings - 09/10/2003 (Simon Law, sfl...@debian.org) - * Add -geometry support - * Add -noseconds support - * Make the digital clock fill the space provided - * Eliminated exploitable static buffers - 17/05/1998 (Antoine Nulle, w...@xs4all.nl) - * Updated version number and some other minor stuff - 16/05/1998 (Antoine Nulle, w...@xs4all.nl) - * Added Locale support, based on original diff supplied - by Alen Salamun (snow...@hal9000.medinet.si) - 04/05/1998 (Martijn Pieterse, piete...@xs4all.nl) - * Moved the hands one pixel down. - * Removed the RedrawWindow out of the main loop - 02/05/1998 (Martijn Pieterse, piete...@xs4all.nl) - * Removed a lot of code that was in the wmgeneral dir. - 02/05/1998 (Antoine Nulle, w...@xs4all.nl) - * Updated master-xpm, hour dots where a bit 'off' - 30/04/1998 (Martijn Pieterse, piete...@xs4all.nl) - * Added anti-aliased hands - 23/04/1998 (Martijn Pieterse, piete...@xs4all.nl) - * Changed the hand lengths.. again! ;) - * Zombies were created, so added wait code - 21/04/1998 (Martijn Pieterse, piete...@xs4all.nl) - * Added digital/analog switching support - 18/04/1998 (Martijn Pieterse, piete...@xs4all.nl) - * Started this project. - * Copied the source from wmmon. -*/ - -#define _GNU_SOURCE -#include <stdlib.h> -#include <stdio.h> -#include <time.h> -#include <string.h> -#include <fcntl.h> -#include <unistd.h> -#include <math.h> -#include <locale.h> -#include <langinfo.h> -#include <iconv.h> -#include <ctype.h> - -#include <sys/wait.h> -#include <sys/param.h> -#include <sys/types.h> - -#include <X11/Xlib.h> -#include <X11/xpm.h> -#include <X11/extensions/shape.h> - -#include "../wmgeneral/wmgeneral.h" -#include "../wmgeneral/misc.h" - -#include "wmtime-master.xpm" -#include "wmtime-mask.xbm" - - /***********/ - /* Defines */ -/***********/ - -const char* default_left_action = NULL; -const char* default_middle_action = NULL; -const char* default_right_action = NULL; - -#define WMMON_VERSION "1.1" - - /********************/ - /* Global Variables */ -/********************/ - -int digital = 0; -int noseconds = 0; -char day_of_week[7][3] = { "SU", "MO", "TU", "WE", "TH", "FR", "SA" }; -char mon_of_year[12][4] = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" }; - -/* functions */ -void usage(char *); -void printversion(void); - -void wmtime_routine(int, char **); -void get_lang(); - -int main(int argc, char *argv[]) { - - int i; - char *name = argv[0]; - - for (i=1; i<argc; i++) { - char *arg = argv[i]; - - if (*arg=='-') { - switch (arg[1]) { - case 'd' : - if (strcmp(arg+1, "display") - && strcmp(arg+1, "digital") && strcmp(arg+1, "d")) { - usage(name); - return 1; - } - if (!strcmp(arg+1, "digital") || !(strcmp(arg+1, "d"))) - digital = 1; - break; - case 'g' : - if (strcmp(arg+1, "geometry")) { - usage(name); - return 1; - } - break; - case 'n' : - if (strcmp(arg+1, "noseconds") && strcmp(arg+1, "n")) { - usage(name); - return 1; - } else { - noseconds = 1; - } - break; - case 'v' : - printversion(); - return 0; - default: - usage(name); - return 1; - } - } - } - - if (setlocale(LC_ALL, "") != NULL) - get_lang(); - - wmtime_routine(argc, argv); - return 0; -} - -/************/ -/* get_lang */ -/************/ -void get_lang(void) -{ - char langbuf[10], outbuf[10]; - char *inp, *outp; - iconv_t icd; - int i, ret; - size_t insize, outsize; - - icd = iconv_open("ASCII//TRANSLIT", nl_langinfo(CODESET)); - if (icd < 0) - return; - - for (i = 0; i < 7; i++) { - strncpy(langbuf, nl_langinfo(ABDAY_1 + i), 10); - insize = outsize = 10; - inp = langbuf; - outp = outbuf; - do { - ret = iconv(icd, &inp, &insize, &outp, &outsize); - } while (outsize > 0 && ret > 0); - if (strstr(outbuf,"?") != NULL) return; - for (outp = outbuf, outsize = 0; *outp != 0 && outsize < 2; - outp++, outsize++) - day_of_week[i][outsize] = toupper(*outp); - } - for (i = 0; i < 12; i++) { - strncpy(langbuf, nl_langinfo(ABMON_1 + i), 10); - insize = outsize = 10; - inp = langbuf; - outp = outbuf; - do { - ret = iconv(icd, &inp, &insize, &outp, &outsize); - } while (outsize > 0 && ret > 0); - if (strstr(outbuf,"?") != NULL) return; - for (outp = outbuf, outsize = 0; *outp != 0 && outsize < 3; - outp++, outsize++) - mon_of_year[i][outsize] = toupper(*outp); - } - - iconv_close(icd); -} - -/*******************************************************************************\ -|* wmtime_routine *| -\*******************************************************************************/ - -char *left_action = NULL; -char *right_action = NULL; -char *middle_action = NULL; - -void DrawTime(int, int, int); -void DrawWijzer(int, int, int); -void DrawDate(int, int, int); - -void wmtime_routine(int argc, char **argv) { - - rckeys wmtime_keys[] = { - { "left", &left_action }, - { "right", &right_action }, - { "middle", &middle_action }, - { NULL, NULL } - }; - - int i; - XEvent Event; - int but_stat = -1; - - struct tm *time_struct; - - long starttime; - long curtime; - - char *conffile = NULL; - - /* Scan through ~/.wmtimerc for the mouse button actions. */ - if (default_left_action) left_action = strdup(default_left_action); - if (default_middle_action) middle_action = strdup(default_middle_action); - if (default_right_action) right_action = strdup(default_right_action); - - /* Scan through the .rc files */ - if (asprintf(&conffile, "/etc/wmtimerc") >= 0) { - parse_rcfile(conffile, wmtime_keys); - free(conffile); - } - - if (asprintf(&conffile, "%s/.wmtimerc", getenv("HOME")) >= 0) { - parse_rcfile(conffile, wmtime_keys); - free(conffile); - } - - if (asprintf(&conffile, "/etc/wmtimerc.fixed") >= 0) { - parse_rcfile(conffile, wmtime_keys); - free(conffile); - } - - openXwindow(argc, argv, wmtime_master_xpm, wmtime_mask_bits, 128, 64); - - /* Mask out the right parts of the clock */ - copyXPMArea(0, 0, 128, 64, 0, 98); /* Draw the borders */ - copyXPMArea(0, 0, 64, 64, 64, 0); /* Draw the clock face */ - copyXPMArea(64, 98, 64, 64, 0, 0); /* Draw the LCD background */ - setMaskXY(0, 0); - - /* add mouse region */ - AddMouseRegion(0, 5, 48, 58, 60); - AddMouseRegion(1, 5, 5, 58, 46); - - starttime = time(0); - - curtime = time(0); - time_struct = localtime(&curtime); - - while (1) { - curtime = time(0); - - waitpid(0, NULL, WNOHANG); - - time_struct = localtime(&curtime); - - - if (curtime >= starttime) { - if (!digital) { - /* Now to update the seconds */ - - DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); - - DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); - - } else { - - DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); - - DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); - } - RedrawWindow(); - } - - - while (XPending(display)) { - XNextEvent(display, &Event); - switch (Event.type) { - case Expose: - RedrawWindow(); - break; - case DestroyNotify: - XCloseDisplay(display); - exit(0); - break; - case ButtonPress: - but_stat = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); - break; - case ButtonRelease: - i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y); - if (but_stat == i && but_stat >= 0) { - switch (but_stat) { - case 0: - digital = 1-digital; - - if (digital) { - copyXPMArea(64, 98, 64, 64, 0, 0); - DrawTime(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); - DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); - } else { - copyXPMArea(0, 98, 64, 64, 0, 0); - DrawWijzer(time_struct->tm_hour, time_struct->tm_min, time_struct->tm_sec); - DrawDate(time_struct->tm_wday, time_struct->tm_mday, time_struct->tm_mon); - } - RedrawWindow(); - break; - case 1: - switch (Event.xbutton.button) { - case 1: - if (left_action) - execCommand(left_action); - break; - case 2: - if (middle_action) - execCommand(middle_action); - break; - case 3: - if (right_action) - execCommand(right_action); - break; - } - } - } - break; - } - } - - /* Sleep 0.3 seconds */ - usleep(300000L); - } -} - -/*******************************************************************************\ -|* DrawTime *| -\*******************************************************************************/ - -void DrawTime(int hr, int min, int sec) { - const int time_size = 16; - char time[time_size]; - char *p = time; - int i,j,k=6; - int numfields; - - /* 7x13 */ - - if (noseconds) { - snprintf(time, time_size, "%02d:%02d ", hr, min); - numfields = 2; - } - else { - snprintf(time, time_size, "%02d:%02d:%02d ", hr, min, sec); - numfields = 3; - } - - for (i=0; i < numfields; i++) { - for (j=0; j<2; j++) { - copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 18); - k += 7; - p++; - } - if (*p == ':') { - copyXPMArea(71, 84, 5, 13, k, 18); - k += 4; - p++; - } - } -} - -/*******************************************************************************\ -|* DrawDate *| -\*******************************************************************************/ - -void DrawDate(int wkday, int dom, int month) { - const int date_size = 16; - char date[date_size]; - char *p = date; - int i,k; - - /* 7x13 */ - - snprintf(date, date_size, - "%.2s%02d%.3s ", day_of_week[wkday], dom, mon_of_year[month]); - - k = 5; - for (i=0; i<2; i++) { - if (*p < 'A') - copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); - else - copyXPMArea((*p-'A')*6, 74, 6, 9, k, 49); - k += 6; - p++; - } - k = 23; - for (i=0; i<2; i++) { - copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); - k += 6; - p++; - } - copyXPMArea(61, 64, 4, 9, k, 49); - k += 4; - for (i=0; i<3; i++) { - if (*p < 'A') - copyXPMArea((*p-'0')*6, 64, 6, 9, k, 49); - else - copyXPMArea((*p-'A')*6, 74, 6, 9, k, 49); - k += 6; - p++; - } -} - -/*******************************************************************************\ -|* DrawWijzer *| -\*******************************************************************************/ - -void DrawWijzer(int hr, int min, int sec) { - - double psi; - int dx,dy; - int x,y; - int ddx,ddy; - int adder; - int k; - - int i; - - hr %= 12; - - copyXPMArea(5+64, 5, 54, 40, 5, 5); - - /**********************************************************************/ - psi = hr * (M_PI / 6.0); - psi += min * (M_PI / 360); - - dx = floor(sin(psi) * 22 * 0.7 + 0.5); - dy = floor(-cos(psi) * 16 * 0.7 + 0.5); - - // dx, dy is het punt waar we naar toe moeten. - // Zoek alle punten die ECHT op de lijn liggen: - - ddx = 1; - ddy = 1; - if (dx < 0) ddx = -1; - if (dy < 0) ddy = -1; - - x = 0; - y = 0; - - if (abs(dx) > abs(dy)) { - if (dy != 0) - adder = abs(dx) / 2; - else - adder = 0; - for (i=0; i<abs(dx); i++) { - // laat de kleur afhangen van de adder. - // adder loopt van abs(dx) tot 0 - - k = 12 - adder / (abs(dx) / 12.0); - copyXPMArea(79+k, 67, 1, 1, x + 31, y + 24 - ddy); - - copyXPMArea(79, 67, 1, 1, x + 31, y + 24); - - k = 12-k; - copyXPMArea(79+k, 67, 1, 1, x + 31, y + 24 + ddy); - - - x += ddx; - - adder -= abs(dy); - if (adder < 0) { - adder += abs(dx); - y += ddy; - } - } - } else { - if (dx != 0) - adder = abs(dy) / 2; - else - adder = 0; - for (i=0; i<abs(dy); i++) { - k = 12 - adder / (abs(dy) / 12.0); - copyXPMArea(79+k, 67, 1, 1, x + 31 - ddx, y + 24); - - copyXPMArea(79, 67, 1, 1, x + 31, y + 24); - - k = 12-k; - copyXPMArea(79+k, 67, 1, 1, x + 31 + ddx, y + 24); - - y += ddy; - - adder -= abs(dx); - if (adder < 0) { - adder += abs(dy); - x += ddx; - } - } - } - /**********************************************************************/ - psi = min * (M_PI / 30.0); - psi += sec * (M_PI / 1800); - - dx = floor(sin(psi) * 22 * 0.55 + 0.5); - dy = floor(-cos(psi) * 16 * 0.55 + 0.5); - - // dx, dy is het punt waar we naar toe moeten. - // Zoek alle punten die ECHT op de lijn liggen: - - dx += dx; - dy += dy; - - ddx = 1; - ddy = 1; - if (dx < 0) ddx = -1; - if (dy < 0) ddy = -1; - - x = 0; - y = 0; - - if (abs(dx) > abs(dy)) { - if (dy != 0) - adder = abs(dx) / 2; - else - adder = 0; - for (i=0; i<abs(dx); i++) { - // laat de kleur afhangen van de adder. - // adder loopt van abs(dx) tot 0 - - k = 12 - adder / (abs(dx) / 12.0); - copyXPMArea(79+k, 67, 1, 1, x + 31, y + 24 - ddy); - - copyXPMArea(79, 67, 1, 1, x + 31, y + 24); - - k = 12-k; - copyXPMArea(79+k, 67, 1, 1, x + 31, y + 24 + ddy); - - - x += ddx; - - adder -= abs(dy); - if (adder < 0) { - adder += abs(dx); - y += ddy; - } - } - } else { - if (dx != 0) - adder = abs(dy) / 2; - else - adder = 0; - for (i=0; i<abs(dy); i++) { - k = 12 - adder / (abs(dy) / 12.0); - copyXPMArea(79+k, 67, 1, 1, x + 31 - ddx, y + 24); - - copyXPMArea(79, 67, 1, 1, x + 31, y + 24); - - k = 12-k; - copyXPMArea(79+k, 67, 1, 1, x + 31 + ddx, y + 24); - - y += ddy; - - adder -= abs(dx); - if (adder < 0) { - adder += abs(dy); - x += ddx; - } - } - } - /**********************************************************************/ - if (noseconds) - return; /* Skip drawing the seconds. */ - - psi = sec * (M_PI / 30.0); - - dx = floor(sin(psi) * 22 * 0.9 + 0.5); - dy = floor(-cos(psi) * 16 * 0.9 + 0.5); - - // dx, dy is het punt waar we naar toe moeten. - // Zoek alle punten die ECHT op de lijn liggen: - - ddx = 1; - ddy = 1; - if (dx < 0) ddx = -1; - if (dy < 0) ddy = -1; - - if (dx == 0) ddx = 0; - if (dy == 0) ddy = 0; - - x = 0; - y = 0; - - - if (abs(dx) > abs(dy)) { - if (dy != 0) - adder = abs(dx) / 2; - else - adder = 0; - for (i=0; i<abs(dx); i++) { - // laat de kleur afhangen van de adder. - // adder loopt van abs(dx) tot 0 - - k = 12 - adder / (abs(dx) / 12.0); - copyXPMArea(79+k, 70, 1, 1, x + 31, y + 24 - ddy); - - k = 12-k; - copyXPMArea(79+k, 70, 1, 1, x + 31, y + 24); - - - x += ddx; - - adder -= abs(dy); - if (adder < 0) { - adder += abs(dx); - y += ddy; - } - } - } else { - if (dx != 0) - adder = abs(dy) / 2; - else - adder = 0; - for (i=0; i<abs(dy); i++) { - k = 12 - adder / (abs(dy) / 12.0); - copyXPMArea(79+k, 70, 1, 1, x + 31 - ddx, y + 24); - - k = 12-k; - copyXPMArea(79+k, 70, 1, 1, x + 31, y + 24); - - y += ddy; - - adder -= abs(dx); - if (adder < 0) { - adder += abs(dy); - x += ddx; - } - } - } -} - -/*******************************************************************************\ -|* usage *| -\*******************************************************************************/ - -void usage(char *name) { - printf("Usage: %s [OPTION]...\n", name); - printf("WindowMaker dockapp that displays the time and date.\n"); - printf("\n"); - printf(" -d, -digital display the digital clock\n"); - printf(" -display DISPLAY contact the DISPLAY X server\n"); - printf(" -geometry GEOMETRY position the clock at GEOMETRY\n"); - printf(" -n, -noseconds disables the second hand\n"); - printf(" -h display this help and exit\n"); - printf(" -v output version information and exit\n"); -} - -/*******************************************************************************\ -|* printversion *| -\*******************************************************************************/ - -void printversion(void) { - printf("WMTime version %s\n", WMMON_VERSION); -} - -/* vim: sw=4 ts=4 columns=82 - */ -- 2.1.0 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.