xbattmon

simple battery monitor for X
git clone git://git.2f30.org/xbattmon
Log | Files | Refs | README | LICENSE

commit 305732fdbaa696bfdb2a13790d6044aa3450d7a1
parent 824b0ea1028167e7b224689eb3018c45d6166d40
Author: sin <sin@2f30.org>
Date:   Sun,  2 Nov 2014 11:43:02 +0000

Add raise option

Diffstat:
Mconfig.def.h | 1+
Mxbattmon.c | 8++++++--
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -9,3 +9,4 @@ unsigned int thickness = 2; /* 2 pixels by default */ time_t pollinterval = 5; /* poll battery state every 5 seconds */ int bottom = 1; /* set to 0 if you want the bar to be at the top */ int maxcap = 100; /* maximum battery capacity */ +int raise = 1; /* set to 0 if you don't want the bar to be raised on top */ diff --git a/xbattmon.c b/xbattmon.c @@ -87,7 +87,10 @@ setup(void) XChangeWindowAttributes(dpy, winbar, CWOverrideRedirect, &attr); XSelectInput(dpy, winbar, ExposureMask | VisibilityChangeMask); - XMapRaised(dpy, winbar); + if (raise == 1) + XMapRaised(dpy, winbar); + else + XMapWindow(dpy, winbar); gcbar = XCreateGC(dpy, winbar, 0, 0); @@ -217,7 +220,8 @@ again: break; case VisibilityNotify: if (ev.xvisibility.state != VisibilityUnobscured) - XRaiseWindow(dpy, winbar); + if (raise == 1) + XRaiseWindow(dpy, winbar); break; } }