Thanks to Christoph Fritz for the feature request.
---
 wmbattery/mask_nodial.xbm | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 wmbattery/wmbattery.1     |  3 +++
 wmbattery/wmbattery.c     | 14 ++++++++++++--
 3 files changed, 61 insertions(+), 2 deletions(-)
 create mode 100644 wmbattery/mask_nodial.xbm

diff --git a/wmbattery/mask_nodial.xbm b/wmbattery/mask_nodial.xbm
new file mode 100644
index 0000000..c610b0b
--- /dev/null
+++ b/wmbattery/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/wmbattery.1 b/wmbattery/wmbattery.1
index 7168cc2..5f5c828 100644
--- a/wmbattery/wmbattery.1
+++ b/wmbattery/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/wmbattery.c b/wmbattery/wmbattery.c
index 042816c..9e812bd 100644
--- a/wmbattery/wmbattery.c
+++ b/wmbattery/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,
-- 
2.1.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to