This is useful for, e.g., compton.
---
Forgot to check for a NULL return in the last one.

 dwm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dwm.c b/dwm.c
index 4782343..6f56447 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1809,6 +1809,11 @@ updatebars(void)
                .background_pixmap = ParentRelative,
                .event_mask = ButtonPressMask|ExposureMask
        };
+       XClassHint *ch = XAllocClassHint();
+       if (ch) {
+               ch->res_name = "dwmstatus";
+               ch->res_class = "dwm";
+       }
        for (m = mons; m; m = m->next) {
                if (m->barwin)
                        continue;
@@ -1817,7 +1822,10 @@ updatebars(void)
                                CWOverrideRedirect|CWBackPixmap|CWEventMask, 
&wa);
                XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
                XMapRaised(dpy, m->barwin);
+               if (ch)
+                       XSetClassHint(dpy, m->barwin, ch);
        }
+       XFree(ch);
 }
 
 void
-- 
2.15.0


Reply via email to