diff --git a/wmclock/.footprint b/wmclock/.footprint new file mode 100644 index 000000000..38e56df7c --- /dev/null +++ b/wmclock/.footprint @@ -0,0 +1,6 @@ +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/bin/ +-rwxr-xr-x root/root usr/bin/wmclock +drwxr-xr-x root/root usr/man/ +drwxr-xr-x root/root usr/man/man1/ +-r--r--r-- root/root usr/man/man1/wmclock.1x.gz diff --git a/wmclock/.md5sum b/wmclock/.md5sum new file mode 100644 index 000000000..7e0177c3d --- /dev/null +++ b/wmclock/.md5sum @@ -0,0 +1,4 @@ +97f6e82f55f216ba724859d4652586b4 wmclock-1.0.12.2.tar.gz +0b6171a856c041fec0b2fc61d4bf2cc0 wmclock-fix_year_display.diff +682670891873386fec16c1d2219c374d wmclock-manpage.diff +ef26a885e3b2c75388560211e9d9b5c1 wmclock-nopolling.diff diff --git a/wmclock/Pkgfile b/wmclock/Pkgfile new file mode 100644 index 000000000..684178424 --- /dev/null +++ b/wmclock/Pkgfile @@ -0,0 +1,21 @@ +# Description: A Window Maker applet which displays date and time +# URL: http://www.jmknoble.net/WindowMaker/wmclock/ +# Maintainer: Mikhail Kolesnik, mike at openbunker dot org +# Packager: Simone Rota, sip at crux dot nu +# Depends on: xorg-gccmakedep, xorg-imake, xorg-libxpm + +name=wmclock +version=1.0.12.2 +release=3 +source=(http://www.dockapps.org/download.php/id/328/$name-$version.tar.gz \ + $name-nopolling.diff $name-fix_year_display.diff $name-manpage.diff) + +build() { + cd $name-$version + patch -p0 -i $SRC/$name-nopolling.diff + patch -p0 -i $SRC/$name-fix_year_display.diff + patch -p0 -i $SRC/$name-manpage.diff + ./configure --lang english + make + make DESTDIR=$PKG install install.man +} diff --git a/wmclock/wmclock-fix_year_display.diff b/wmclock/wmclock-fix_year_display.diff new file mode 100644 index 000000000..77a15766b --- /dev/null +++ b/wmclock/wmclock-fix_year_display.diff @@ -0,0 +1,34 @@ +--- wmclock.c-orig 2008-11-16 18:23:07.185633821 +0100 ++++ wmclock.c 2008-11-16 18:23:25.482650412 +0100 +@@ -828,7 +828,14 @@ + #endif /* !ONLY_SHAPED_WINDOW */ + for (i = 0; i < NUM_TIME_POSITIONS; i++) + { +- xPos[i] += enable12HourClock ? timePos24[i] : timePos12[i]; ++ if (enable12HourClock && (!enableYearDisplay)) ++ { ++ xPos[i] += timePos24[i]; ++ } ++ else ++ { ++ xPos[i] += timePos12[i]; ++ } + } + + /* Open the display */ +--- wmclock.c-orig 2000-03-08 08:31:33.000000000 +0100 ++++ wmclock.c 2007-10-03 22:42:36.000000000 +0200 +@@ -470,11 +470,11 @@ + XCopyArea(dpy, led.pixmap, visible.pixmap, normalGC, + digitXOffset , digitYOffset, LED_NUM_WIDTH, LED_NUM_HEIGHT, + xPos[DIGIT_1_X_POS], yPos[DIGIT_Y_POS]); +- digitXOffset = LED_NUM_WIDTH * (year % 1000); ++ digitXOffset = LED_NUM_WIDTH * (year % 1000 / 100); + XCopyArea(dpy, led.pixmap, visible.pixmap, normalGC, + digitXOffset , digitYOffset, LED_NUM_WIDTH, LED_NUM_HEIGHT, + xPos[DIGIT_2_X_POS], yPos[DIGIT_Y_POS]); +- digitXOffset = LED_NUM_WIDTH * (year % 100); ++ digitXOffset = LED_NUM_WIDTH * (year % 100 / 10); + XCopyArea(dpy, led.pixmap, visible.pixmap, normalGC, + digitXOffset , digitYOffset, LED_NUM_WIDTH, LED_NUM_HEIGHT, + xPos[DIGIT_3_X_POS], yPos[DIGIT_Y_POS]); diff --git a/wmclock/wmclock-manpage.diff b/wmclock/wmclock-manpage.diff new file mode 100644 index 000000000..e19ac01d5 --- /dev/null +++ b/wmclock/wmclock-manpage.diff @@ -0,0 +1,22 @@ +--- wmclock.man.in-orig 2008-11-16 18:22:33.061623927 +0100 ++++ wmclock.man.in 2008-11-16 18:22:33.417626015 +0100 +@@ -25,9 +25,7 @@ + .TH wmclock 1x "@DATE@" "Version @VERSION@" + .\" ---------------------------------------------------------------- + .SH NAME +-.PP +-.BR wmclock : +-a dockable clock for the Window Maker window manager ++wmclock \- A dockable clock for the Window Maker window manager + .\" ---------------------------------------------------------------- + .SH SYNOPSIS + .HP +@@ -196,7 +194,7 @@ + .\" ---------------------------------------------------------------- + .SH COPYRIGHT AND LICENSE + .PP +-Copyright © 1999 by Jim Knoble . Significant ++Copyright \(co 1999 by Jim Knoble . Significant + portions of + .B wmclock + are directly derived from diff --git a/wmclock/wmclock-nopolling.diff b/wmclock/wmclock-nopolling.diff new file mode 100644 index 000000000..a5a338f78 --- /dev/null +++ b/wmclock/wmclock-nopolling.diff @@ -0,0 +1,77 @@ +--- wmclock.c.orig 2008-09-28 17:41:49.000000000 +0200 ++++ wmclock.c 2008-09-28 20:33:59.000000000 +0200 +@@ -20,6 +20,7 @@ + * with the software or the use or other dealings in the software. + */ + ++#include + #include + #include + #include +@@ -141,7 +142,8 @@ + Display *dpy; + Window rootWindow; + int screen; +-/* int xFd; */ ++int xFd; ++fd_set xFdSet; + int displayDepth; + XSizeHints sizeHints; + XWMHints wmHints; +@@ -801,6 +803,7 @@ + XTextProperty wmName; + XClassHint classHint; + Pixmap shapeMask; ++ struct timeval nextEvent; + + /* Parse command line options */ + progName = extractProgName(argv[0]); +@@ -849,7 +852,7 @@ + screen = DefaultScreen(dpy); + rootWindow = RootWindow(dpy, screen); + displayDepth = DefaultDepth(dpy, screen); +- /* xFd = XConnectionNumber(dpy); */ ++ xFd = XConnectionNumber(dpy); + + /* Icon Daten nach XImage konvertieren */ + GetXpms(); +@@ -1049,14 +1052,32 @@ + poll((struct poll *) 0, (size_t) 0, 50); /* 5/100 sec */ + } + #else +- if (enableYearDisplay) +- { +- usleep(200000L); /* 1/5 sec */ +- } ++ //We compute the date of next event, in order to avoid polling ++ if (enableBlinking) ++ { ++ gettimeofday(&nextEvent,NULL); ++ nextEvent.tv_sec = 0; ++ nextEvent.tv_usec = 1000000-nextEvent.tv_usec; ++ } + else +- { +- usleep(50000L); /* 5/100 sec */ +- } ++ { ++ if (enableYearDisplay) ++ { ++ nextEvent.tv_sec = 86400-actualTime%86400; ++ nextEvent.tv_usec = 0; ++ } ++ else ++ { ++ nextEvent.tv_sec = 60-actualTime%60; ++ nextEvent.tv_usec = 0; ++ } ++ } ++ printf("xFd %d\n", xFd); ++ FD_ZERO(&xFdSet); ++ FD_SET(xFd,&xFdSet); ++ printf("debut select %d\n", nextEvent.tv_sec); ++ select(FD_SETSIZE,&xFdSet,NULL,NULL,&nextEvent); ++ printf("fin select\n"); + #endif + } + return(0);