dwm
dynamic window manager
git clone https://9o.is/git/dwm.git
commit f7d68a02b873c79ccdbae3ff864e2b7e885aa4df parent b003c69b9edc7dd9c838ef1259c8cf8f4f632407 Author: Jul <jul@9o.is> Date: Sun, 1 Feb 2026 16:02:48 -0500 prefix qubes vm name to title Diffstat:
| M | dwm.c | | | 16 | ++++++++++++++-- |
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dwm.c b/dwm.c @@ -64,6 +64,7 @@ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetClientInfo, NetLast }; /* EWMH atoms */ enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ +enum { QubesVMName, QubesLast }; /* Qubes atoms */ enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkCounter, ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ @@ -85,6 +86,7 @@ typedef struct { typedef struct Monitor Monitor; typedef struct Client Client; struct Client { + char vmname[256]; char name[256]; float mina, maxa; int x, y, w, h; @@ -242,6 +244,7 @@ static void zoom(const Arg *arg); /* variables */ static const char broken[] = "broken"; +static const char gui_domain[] = "sys-gui"; static char stext[256]; static int screen; static int sw, sh; /* X display screen geometry width, height */ @@ -265,7 +268,7 @@ static void (*handler[LASTEvent]) (XEvent *) = { [PropertyNotify] = propertynotify, [UnmapNotify] = unmapnotify }; -static Atom wmatom[WMLast], netatom[NetLast]; +static Atom wmatom[WMLast], netatom[NetLast], qubesatom[QubesLast]; static int restart = 0; static int running = 1; static Cur *cursor[CurLast]; @@ -778,6 +781,11 @@ drawbar(Monitor *m) x = 0; + if (m->sel) { + w = TEXTW(m->sel->vmname); + x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->vmname, 0); + } + if ((w = m->ww - tw - x) > bh) { if (m->sel) { drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); @@ -1311,7 +1319,7 @@ propertynotify(XEvent *e) drawbars(); break; } - if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { + if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName] || ev->atom == qubesatom[QubesVMName]) { updatetitle(c); if (c == c->mon->sel) drawbar(c->mon); @@ -1666,6 +1674,8 @@ setup(void) netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); netatom[NetClientInfo] = XInternAtom(dpy, "_NET_CLIENT_INFO", False); + /* init qubes atoms */ + qubesatom[QubesVMName] = XInternAtom(dpy, "_QUBES_VMNAME", False); /* init cursors */ cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); cursor[CurResize] = drw_cur_create(drw, XC_sizing); @@ -2125,6 +2135,8 @@ updatestatus(void) void updatetitle(Client *c) { + if (!gettextprop(c->win, qubesatom[QubesVMName], c->vmname, sizeof c->vmname)) + snprintf(c->vmname, sizeof(c->vmname), "%s", gui_domain); if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); if (c->name[0] == '\0') /* hack to mark broken clients */