wmname

sets/prints window manager name similiar to hostname(1)
git clone git://git.suckless.org/wmname
Log | Files | Refs | README | LICENSE

commit 5fcac5aad79988fd242f475ef278278167a7cd33
parent ac3fe41b9b77964a56da652c3930f5e52dc40668
Author: Anselm R Garbe <garbeam@gmail.com>
Date:   Tue, 20 May 2008 15:08:05 +0100

simplifications
Diffstat:
Msetwmname.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/setwmname.c b/setwmname.c @@ -21,7 +21,7 @@ int main(int argc, char **argv) { Display *dpy; Window root, dummy; - Atom net_supporting_wm_check, net_wm_name, utf8_string; + Atom netwmcheck, netwmname, utf8_string; if(argc == 2) { if(!strncmp(argv[1], "-v", 3)) @@ -31,13 +31,13 @@ main(int argc, char **argv) { eprint("usage: setwmname <name> [-v]\n"); if(!(dpy = XOpenDisplay(0))) - eprint("dmenu: cannot open display\n"); + eprint("setwmname: cannot open display\n"); root = DefaultRootWindow(dpy); - net_supporting_wm_check = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - net_wm_name = XInternAtom(dpy, "_NET_WM_NAME", False); + netwmcheck = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); + netwmname = XInternAtom(dpy, "_NET_WM_NAME", False); utf8_string = XInternAtom(dpy, "UTF8_STRING", False); - XChangeProperty(dpy, root, net_supporting_wm_check, XA_WINDOW, 32, PropModeReplace, (unsigned char *)&root, 1); - XChangeProperty(dpy, root, net_wm_name, utf8_string, 8, PropModeReplace, (unsigned char *)argv[1], strlen(argv[1])); + XChangeProperty(dpy, root, netwmcheck, XA_WINDOW, 32, PropModeReplace, (unsigned char *)&root, 1); + XChangeProperty(dpy, root, netwmname, utf8_string, 8, PropModeReplace, (unsigned char *)argv[1], strlen(argv[1])); XSync(dpy, False); XCloseDisplay(dpy); return 0;