[Pkg-wmaker-commits] [wmbattery] 224/241: wmbattery: Add -n option to disable dial graphic.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Mon Aug 24 23:38:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmbattery.

commit 604a3c75d9953b6a68e5bf38884e7f8202bc49ae
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Wed May 13 23:38:54 2015 -0500

    wmbattery: Add -n option to disable dial graphic.
    
    Thanks to Christoph Fritz for the feature request.
---
 mask_nodial.xbm | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 wmbattery.1     |  3 +++
 wmbattery.c     | 14 ++++++++++++--
 3 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/mask_nodial.xbm b/mask_nodial.xbm
new file mode 100644
index 0000000..c610b0b
--- /dev/null
+++ b/mask_nodial.xbm
@@ -0,0 +1,46 @@
+#define mask_nodial_width 64
+#define mask_nodial_height 64
+static char mask_nodial_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, 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,
+   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, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff,
+   0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
+   0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff,
+   0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
+   0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff,
+   0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
+   0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff,
+   0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
+   0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff,
+   0xff, 0xff, 0x03, 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, 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/wmbattery.1 b/wmbattery.1
index 7168cc2..5f5c828 100644
--- a/wmbattery.1
+++ b/wmbattery.1
@@ -111,6 +111,9 @@ translated into the appropriate values.
 .TP
 .B \-i
 Display as icon.
+.TP
+.B \-n
+Disable dial graphic.
 .SH EXAMPLE
 Start at 10% battery to execute 'echo' including status information:
 .RS
diff --git a/wmbattery.c b/wmbattery.c
index 042816c..9e812bd 100644
--- a/wmbattery.c
+++ b/wmbattery.c
@@ -40,6 +40,7 @@
 #endif
 
 #include "mask.xbm"
+#include "mask_nodial.xbm"
 #include "sonypi.h"
 #include "acpi.h"
 #ifdef HAL
@@ -83,6 +84,7 @@ int delay = 0;
 int always_estimate_remaining = 0;
 int granularity_estimate_remaining = 1;
 int initial_state = WithdrawnState;
+int use_dial = 1;
 
 signed int low_pct = -1;
 signed int critical_pct = -1;
@@ -378,7 +380,7 @@ char *parse_commandline(int argc, char *argv[])
 	char *ret = NULL;
 
 	while (c != -1) {
-		c = getopt(argc, argv, "hd:g:if:b:w:c:l:es:a:x:v");
+		c = getopt(argc, argv, "hd:g:if:b:w:c:l:es:a:x:vn");
 		switch (c) {
 		case 'h':
 			printf("Usage: wmbattery [options]\n");
@@ -394,6 +396,7 @@ char *parse_commandline(int argc, char *argv[])
 			printf("\t-s granularity\tignore fluctuations less than granularity%% (implies -e)\n");
 			printf("\t-a file\t\twhen critical send file to /dev/audio\n");
 			printf("\t-x command\twhen critical execute this command\n");
+			printf("\t-n\t\tdisable dial graphic\n");
 			printf("\t-v\t\tdisplay version number\n");
 			exit(0);
 			break;
@@ -435,6 +438,9 @@ char *parse_commandline(int argc, char *argv[])
 			printf("wmbattery "PACKAGE_VERSION"\n");
 			exit(0);
 			break;
+		case 'n':
+			use_dial = 0;
+			break;
 		}
 	}
 
@@ -500,8 +506,12 @@ void make_window(char *display_name, int argc, char *argv[])
 			     GCForeground | GCBackground | GCGraphicsExposures,
 			     &gcv);
 
-	pixmask = XCreateBitmapFromData(display, win, mask_bits,
+	if (use_dial)
+		pixmask = XCreateBitmapFromData(display, win, mask_bits,
 					mask_width, mask_height);
+	else
+		pixmask = XCreateBitmapFromData(display, win, mask_nodial_bits,
+					mask_nodial_width, mask_nodial_height);
 	XShapeCombineMask(display, win, ShapeBounding, 0, 0,
 			  pixmask, ShapeSet);
 	XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbattery.git



More information about the Pkg-wmaker-commits mailing list