xbattmon

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

commit 8bc2d8e8b07eedb8cbdc0b70fdab31e763ca72aa
parent f1beee21d776d40997c5d383ef8e9fb35eb3382e
Author: lostd <lostd@2f30.org>
Date:   Sat, 21 Mar 2015 16:08:33 +0200

Set a window name

Diffstat:
Mxbattmon.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/xbattmon.c b/xbattmon.c @@ -1,5 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include <X11/Xlib.h> +#include <X11/Xutil.h> #include <err.h> #include <errno.h> #include <limits.h> @@ -52,6 +53,8 @@ setup(void) { XSetWindowAttributes attr; XColor color, exact; + XTextProperty text; + static char *name = "xbattmon"; int r; int screen; unsigned int width, height; @@ -107,6 +110,9 @@ setup(void) attr.override_redirect = True; XChangeWindowAttributes(dpy, winbar, CWOverrideRedirect, &attr); + XStringListToTextProperty(&name, 1, &text); + XSetWMName(dpy, winbar, &text); + XSelectInput(dpy, winbar, ExposureMask | VisibilityChangeMask); if (raise == 1) XMapRaised(dpy, winbar);