wmint: updated to 0.9, added trivial patch to save laptop battery

This commit is contained in:
Mikhail Kolesnik 2008-03-22 23:19:54 +02:00
parent 39fe0358df
commit ceb17b233b
3 changed files with 62 additions and 6 deletions

View File

@ -1 +1,2 @@
5c5fb16a32a7ad529fb44da2e051424a wmint-0.8.tar.gz
ba8ee8e741b1a1bb89fc8de13d6e74bb wmint-0.9.tar.bz2
3059f569be017eb4982ea7fc41ee62e7 wmint-sleep.diff

View File

@ -1,15 +1,20 @@
# Description: A dockable app that displays flashing lights for IRQ's
# URL: http://www.cs.mun.ca/~gstarkes/wmaker/dockapps/sys.html
# Maintainer: Mikhail Kolesnik, mike at openbunker dot org
# Depends on: x11
# Depends on: xorg-libxpm
name=wmint
version=0.8
release=2
source=(http://web.cs.mun.ca/~gstarkes/wmaker/dockapps/files/$name-$version.tar.gz)
version=0.9
release=1
source=(http://ftp.sh.cvut.cz/MIRRORS/rock/ROCK-2.1/w/$name-$version.tar.bz2 \
wmint-sleep.diff)
build() {
cd $name.app/wmint
cd $name-$version/$name
# adds -s switch to prevent frequent wakeups
patch -p2 -i $SRC/wmint-sleep.diff
make
/usr/bin/install -D -m 755 wmint $PKG/usr/bin/wmint
}

50
wmint/wmint-sleep.diff Normal file
View File

@ -0,0 +1,50 @@
diff -Nru wmint-0.9-orig/wmint/wmint.c wmint-0.9/wmint/wmint.c
--- wmint-0.9-orig/wmint/wmint.c 2008-03-22 22:57:17.771804010 +0200
+++ wmint-0.9/wmint/wmint.c 2008-03-22 23:08:51.358802106 +0200
@@ -36,6 +36,7 @@
#define WMINT_VERSION "0.9"
char *ProgName;
+unsigned int usecs = 10000;
typedef struct {
unsigned short bit;
@@ -110,6 +111,19 @@
exit(1);
};
break;
+ case 's' :
+ if (++i == argc)
+ {
+ usage();
+ exit(1);
+ };
+ usecs = (unsigned int) strtol(argv[i], &endp, 10);
+ if (*endp || usecs<0 || usecs>1000000)
+ {
+ usage();
+ exit(1);
+ };
+ break;
case 'v' :
printVersion();
exit(0);
@@ -269,7 +283,7 @@
break;
}
}
- usleep(10000L);
+ usleep(usecs);
}
}
@@ -526,7 +540,8 @@
fprintf(stderr, "\nwmint - Sébastien Liénard <%s>, GCU (%s)\n\n",MY_EMAIL,GCU_HOME);
fprintf(stderr, "usage:\n");
fprintf(stderr, "\t-d <display name>\n");
- fprintf(stderr, "\t-i <interrupt number>\n");
+ fprintf(stderr, "\t-i <interrupt number>\n");
+ fprintf(stderr, "\t-s <sleep between refresh (in microseconds), default %u>\n", usecs);
fprintf(stderr, "\t-h\tthis help screen\n");
fprintf(stderr, "\t-v\tprint the version number\n");
fprintf(stderr, "\n");