2020-07-03 21:04:11 +00:00
|
|
|
diff -ruN dwm-6.2-ori/config.def.h dwm-6.2/config.def.h
|
|
|
|
--- dwm-6.2-ori/config.def.h 2019-02-02 18:25:28.000000000 +0530
|
2020-12-27 15:29:38 +00:00
|
|
|
+++ dwm-6.2/config.def.h 2020-12-27 19:52:54.790231420 +0530
|
|
|
|
@@ -12,10 +12,26 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
static const char col_gray3[] = "#bbbbbb";
|
|
|
|
static const char col_gray4[] = "#eeeeee";
|
|
|
|
static const char col_cyan[] = "#005577";
|
|
|
|
+static const char col1[] = "#ffffff";
|
|
|
|
+static const char col2[] = "#ffffff";
|
|
|
|
+static const char col3[] = "#ffffff";
|
|
|
|
+static const char col4[] = "#ffffff";
|
|
|
|
+static const char col5[] = "#ffffff";
|
|
|
|
+static const char col6[] = "#ffffff";
|
2020-12-27 15:29:38 +00:00
|
|
|
+
|
|
|
|
+enum { SchemeNorm, SchemeCol1, SchemeCol2, SchemeCol3, SchemeCol4,
|
|
|
|
+ SchemeCol5, SchemeCol6, SchemeSel }; /* color schemes */
|
|
|
|
+
|
2020-07-03 21:04:11 +00:00
|
|
|
static const char *colors[][3] = {
|
|
|
|
/* fg bg border */
|
|
|
|
- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
|
|
|
- [SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
|
|
|
+ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
|
|
|
+ [SchemeCol1] = { col1, col_gray1, col_gray2 },
|
|
|
|
+ [SchemeCol2] = { col2, col_gray1, col_gray2 },
|
|
|
|
+ [SchemeCol3] = { col3, col_gray1, col_gray2 },
|
|
|
|
+ [SchemeCol4] = { col4, col_gray1, col_gray2 },
|
|
|
|
+ [SchemeCol5] = { col5, col_gray1, col_gray2 },
|
|
|
|
+ [SchemeCol6] = { col6, col_gray1, col_gray2 },
|
2020-08-17 22:19:20 +00:00
|
|
|
+ [SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
2020-07-03 21:04:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* tagging */
|
2020-12-27 15:29:38 +00:00
|
|
|
@@ -103,7 +119,9 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
|
|
|
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
|
|
|
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
|
|
|
- { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
|
|
|
+ { ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1} },
|
|
|
|
+ { ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2} },
|
|
|
|
+ { ClkStatusText, 0, Button3, sigdwmblocks, {.i = 3} },
|
|
|
|
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
|
|
|
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
|
|
|
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
|
|
|
diff -ruN dwm-6.2-ori/dwm.c dwm-6.2/dwm.c
|
2020-07-29 19:06:23 +00:00
|
|
|
--- dwm-6.2-ori/dwm.c 2019-02-02 18:25:28.000000000 +0530
|
2020-12-30 10:57:28 +00:00
|
|
|
+++ dwm-6.2/dwm.c 2020-12-30 16:24:10.847012386 +0530
|
2020-11-08 15:43:08 +00:00
|
|
|
@@ -40,6 +40,7 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
#include <X11/extensions/Xinerama.h>
|
|
|
|
#endif /* XINERAMA */
|
|
|
|
#include <X11/Xft/Xft.h>
|
|
|
|
+#include <fcntl.h>
|
|
|
|
|
|
|
|
#include "drw.h"
|
|
|
|
#include "util.h"
|
2020-12-27 15:29:38 +00:00
|
|
|
@@ -56,10 +57,14 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
|
|
|
|
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
|
|
|
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
2020-08-21 18:22:43 +00:00
|
|
|
+#define TTEXTW(X) (drw_fontset_getwidth(drw, (X)))
|
2020-07-03 21:04:11 +00:00
|
|
|
+
|
2020-12-04 22:35:16 +00:00
|
|
|
+#define STATUSLENGTH 256
|
2020-07-03 21:04:11 +00:00
|
|
|
+#define DWMBLOCKSLOCKFILE "/tmp/dwmblocks.pid"
|
2020-12-27 15:29:38 +00:00
|
|
|
+#define DELIMITERENDCHAR 10
|
2020-07-03 21:04:11 +00:00
|
|
|
|
|
|
|
/* enums */
|
|
|
|
-enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
|
|
|
-enum { SchemeNorm, SchemeSel }; /* color schemes */
|
|
|
|
+enum { CurNormal, CurHand, CurResize, CurMove, CurLast }; /* cursor */
|
|
|
|
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
|
|
|
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
|
|
|
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
|
2020-12-28 16:23:17 +00:00
|
|
|
@@ -124,6 +129,7 @@
|
|
|
|
unsigned int tagset[2];
|
|
|
|
int showbar;
|
|
|
|
int topbar;
|
|
|
|
+ int statushandcursor;
|
|
|
|
Client *clients;
|
|
|
|
Client *sel;
|
|
|
|
Client *stack;
|
|
|
|
@@ -205,6 +211,7 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
static void seturgent(Client *c, int urg);
|
|
|
|
static void showhide(Client *c);
|
|
|
|
static void sigchld(int unused);
|
|
|
|
+static void sigdwmblocks(const Arg *arg);
|
|
|
|
static void spawn(const Arg *arg);
|
|
|
|
static void tag(const Arg *arg);
|
|
|
|
static void tagmon(const Arg *arg);
|
2020-12-28 16:23:17 +00:00
|
|
|
@@ -219,6 +226,7 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
static void updatebarpos(Monitor *m);
|
|
|
|
static void updatebars(void);
|
|
|
|
static void updateclientlist(void);
|
2020-09-23 15:07:49 +00:00
|
|
|
+static void updatedwmblockssig(int x);
|
2020-07-03 21:04:11 +00:00
|
|
|
static int updategeom(void);
|
|
|
|
static void updatenumlockmask(void);
|
|
|
|
static void updatesizehints(Client *c);
|
2020-12-28 16:23:17 +00:00
|
|
|
@@ -236,12 +244,15 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
|
|
|
|
/* variables */
|
|
|
|
static const char broken[] = "broken";
|
|
|
|
-static char stext[256];
|
2020-12-04 22:35:16 +00:00
|
|
|
+static char stextc[STATUSLENGTH];
|
|
|
|
+static char stexts[STATUSLENGTH];
|
2020-07-03 21:04:11 +00:00
|
|
|
static int screen;
|
|
|
|
static int sw, sh; /* X display screen geometry width, height */
|
2020-11-08 15:43:08 +00:00
|
|
|
-static int bh, blw = 0; /* bar geometry */
|
|
|
|
+static int bh, blw, ble; /* bar geometry */
|
2020-12-28 16:23:17 +00:00
|
|
|
+static int wstext; /* width of status text */
|
2020-11-08 15:43:08 +00:00
|
|
|
static int lrpad; /* sum of left and right padding for text */
|
|
|
|
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
|
|
|
+static unsigned int dwmblockssig;
|
|
|
|
static unsigned int numlockmask = 0;
|
|
|
|
static void (*handler[LASTEvent]) (XEvent *) = {
|
|
|
|
[ButtonPress] = buttonpress,
|
2020-12-27 15:29:38 +00:00
|
|
|
@@ -416,13 +427,13 @@
|
2020-09-30 16:29:06 +00:00
|
|
|
void
|
|
|
|
buttonpress(XEvent *e)
|
|
|
|
{
|
|
|
|
- unsigned int i, x, click;
|
2020-12-27 15:29:38 +00:00
|
|
|
+ int i, x;
|
2020-11-08 15:43:08 +00:00
|
|
|
+ unsigned int click;
|
2020-09-30 16:29:06 +00:00
|
|
|
Arg arg = {0};
|
|
|
|
Client *c;
|
|
|
|
Monitor *m;
|
2020-11-08 15:43:08 +00:00
|
|
|
XButtonPressedEvent *ev = &e->xbutton;
|
|
|
|
|
|
|
|
- click = ClkRootWin;
|
|
|
|
/* focus monitor if necessary */
|
|
|
|
if ((m = wintomon(ev->window)) && m != selmon) {
|
|
|
|
unfocus(selmon->sel, 1);
|
2020-12-28 16:23:17 +00:00
|
|
|
@@ -430,25 +441,29 @@
|
2020-09-30 16:29:06 +00:00
|
|
|
focus(NULL);
|
|
|
|
}
|
|
|
|
if (ev->window == selmon->barwin) {
|
|
|
|
- i = x = 0;
|
2020-11-08 15:43:08 +00:00
|
|
|
- do
|
|
|
|
- x += TEXTW(tags[i]);
|
|
|
|
- while (ev->x >= x && ++i < LENGTH(tags));
|
|
|
|
- if (i < LENGTH(tags)) {
|
|
|
|
- click = ClkTagBar;
|
|
|
|
- arg.ui = 1 << i;
|
|
|
|
- } else if (ev->x < x + blw)
|
|
|
|
- click = ClkLtSymbol;
|
2020-07-03 21:04:11 +00:00
|
|
|
- else if (ev->x > selmon->ww - TEXTW(stext))
|
|
|
|
- click = ClkStatusText;
|
|
|
|
- else
|
|
|
|
- click = ClkWinTitle;
|
2020-12-28 16:23:17 +00:00
|
|
|
+ if (ev->x < ble - blw) {
|
|
|
|
+ i = -1, x = -ev->x;
|
|
|
|
+ do
|
|
|
|
+ x += TEXTW(tags[++i]);
|
|
|
|
+ while (x <= 0);
|
|
|
|
+ click = ClkTagBar;
|
|
|
|
+ arg.ui = 1 << i;
|
|
|
|
+ } else if (ev->x < ble)
|
|
|
|
+ click = ClkLtSymbol;
|
|
|
|
+ else if (ev->x < selmon->ww - wstext)
|
2020-07-03 21:04:11 +00:00
|
|
|
+ click = ClkWinTitle;
|
2020-11-08 15:43:08 +00:00
|
|
|
+ else if ((x = selmon->ww - lrpad / 2 - ev->x) > 0 && (x -= wstext - lrpad) <= 0) {
|
2020-09-23 15:07:49 +00:00
|
|
|
+ updatedwmblockssig(x);
|
2020-07-03 21:04:11 +00:00
|
|
|
+ click = ClkStatusText;
|
2020-12-27 15:29:38 +00:00
|
|
|
+ } else
|
2020-07-03 21:04:11 +00:00
|
|
|
+ return;
|
|
|
|
} else if ((c = wintoclient(ev->window))) {
|
|
|
|
focus(c);
|
|
|
|
restack(selmon);
|
2020-11-08 15:43:08 +00:00
|
|
|
XAllowEvents(dpy, ReplayPointer, CurrentTime);
|
|
|
|
click = ClkClientWin;
|
|
|
|
- }
|
|
|
|
+ } else
|
|
|
|
+ click = ClkRootWin;
|
|
|
|
for (i = 0; i < LENGTH(buttons); i++)
|
|
|
|
if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
|
|
|
|
&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
|
2020-12-28 16:23:17 +00:00
|
|
|
@@ -695,7 +710,7 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
void
|
|
|
|
drawbar(Monitor *m)
|
|
|
|
{
|
|
|
|
- int x, w, sw = 0;
|
|
|
|
+ int x, w;
|
|
|
|
int boxs = drw->fonts->h / 9;
|
|
|
|
int boxw = drw->fonts->h / 6 + 2;
|
|
|
|
unsigned int i, occ = 0, urg = 0;
|
2020-12-29 20:55:22 +00:00
|
|
|
@@ -703,9 +718,32 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
|
|
|
|
/* draw status first so it can be overdrawn by tags later */
|
|
|
|
if (m == selmon) { /* status is only drawn on selected monitor */
|
|
|
|
- drw_setscheme(drw, scheme[SchemeNorm]);
|
|
|
|
- sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
|
|
|
|
- drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
|
2020-12-29 20:55:22 +00:00
|
|
|
+ char *stc = stextc;
|
|
|
|
+ char *stp = stextc;
|
|
|
|
+ char tmp;
|
2020-07-03 21:04:11 +00:00
|
|
|
+
|
2020-07-16 18:55:13 +00:00
|
|
|
+ drw_setscheme(drw, scheme[SchemeNorm]);
|
2020-11-08 15:43:08 +00:00
|
|
|
+ x = m->ww - wstext;
|
|
|
|
+ drw_rect(drw, x, 0, lrpad / 2, bh, 1, 1); x += lrpad / 2; /* to keep left padding clean */
|
2020-07-13 21:52:25 +00:00
|
|
|
+ for (;;) {
|
2020-12-29 20:55:22 +00:00
|
|
|
+ if ((unsigned char)*stc >= ' ') {
|
|
|
|
+ stc++;
|
2020-07-13 21:52:25 +00:00
|
|
|
+ continue;
|
|
|
|
+ }
|
2020-12-29 20:55:22 +00:00
|
|
|
+ tmp = *stc;
|
|
|
|
+ if (stp != stc) {
|
|
|
|
+ *stc = '\0';
|
|
|
|
+ x = drw_text(drw, x, 0, TTEXTW(stp), bh, 0, stp, 0);
|
|
|
|
+ }
|
|
|
|
+ if (tmp == '\0')
|
2020-07-13 21:52:25 +00:00
|
|
|
+ break;
|
2020-12-29 20:55:22 +00:00
|
|
|
+ if (tmp - DELIMITERENDCHAR - 1 < LENGTH(colors))
|
|
|
|
+ drw_setscheme(drw, scheme[tmp - DELIMITERENDCHAR - 1]);
|
|
|
|
+ *stc = tmp;
|
|
|
|
+ stp = ++stc;
|
2020-07-03 21:04:11 +00:00
|
|
|
+ }
|
2020-07-16 18:55:13 +00:00
|
|
|
+ drw_setscheme(drw, scheme[SchemeNorm]);
|
2020-11-08 15:43:08 +00:00
|
|
|
+ drw_rect(drw, x, 0, m->ww - x, bh, 1, 1); /* to keep right padding clean */
|
2020-07-03 21:04:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (c = m->clients; c; c = c->next) {
|
2020-12-29 20:55:22 +00:00
|
|
|
@@ -724,11 +762,17 @@
|
2020-11-08 15:43:08 +00:00
|
|
|
urg & 1 << i);
|
|
|
|
x += w;
|
|
|
|
}
|
|
|
|
- w = blw = TEXTW(m->ltsymbol);
|
|
|
|
+ w = TEXTW(m->ltsymbol);
|
2020-07-03 21:04:11 +00:00
|
|
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
|
|
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
|
|
|
|
|
|
|
- if ((w = m->ww - sw - x) > bh) {
|
2020-11-08 15:43:08 +00:00
|
|
|
+ if (m == selmon) {
|
|
|
|
+ blw = w, ble = x;
|
|
|
|
+ w = m->ww - wstext - x;
|
|
|
|
+ } else
|
|
|
|
+ w = m->ww - x;
|
|
|
|
+
|
|
|
|
+ if (w > bh) {
|
2020-07-03 21:04:11 +00:00
|
|
|
if (m->sel) {
|
|
|
|
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
|
|
|
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
|
2020-12-29 20:55:22 +00:00
|
|
|
@@ -1119,17 +1163,24 @@
|
2020-12-28 16:23:17 +00:00
|
|
|
motionnotify(XEvent *e)
|
|
|
|
{
|
|
|
|
static Monitor *mon = NULL;
|
|
|
|
+ int x;
|
2020-07-03 21:04:11 +00:00
|
|
|
Monitor *m;
|
|
|
|
XMotionEvent *ev = &e->xmotion;
|
|
|
|
|
|
|
|
- if (ev->window != root)
|
2020-11-08 15:43:08 +00:00
|
|
|
- return;
|
|
|
|
- if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
|
|
|
- unfocus(selmon->sel, 1);
|
|
|
|
- selmon = m;
|
|
|
|
- focus(NULL);
|
|
|
|
- }
|
|
|
|
- mon = m;
|
|
|
|
+ if (ev->window == root) {
|
|
|
|
+ if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
|
|
|
|
+ unfocus(selmon->sel, 1);
|
|
|
|
+ selmon = m;
|
|
|
|
+ focus(NULL);
|
|
|
|
+ }
|
|
|
|
+ mon = m;
|
2020-12-28 16:23:17 +00:00
|
|
|
+ } else if (ev->window == selmon->barwin && (x = selmon->ww - lrpad / 2 - ev->x) > 0
|
|
|
|
+ && (x -= wstext - lrpad) <= 0)
|
|
|
|
+ updatedwmblockssig(x);
|
|
|
|
+ else if (selmon->statushandcursor) {
|
|
|
|
+ selmon->statushandcursor = 0;
|
|
|
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
2020-07-03 21:04:11 +00:00
|
|
|
+ }
|
2020-11-08 15:43:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2020-12-29 20:55:22 +00:00
|
|
|
@@ -1564,6 +1615,7 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False);
|
|
|
|
/* init cursors */
|
|
|
|
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
|
|
|
|
+ cursor[CurHand] = drw_cur_create(drw, XC_hand2);
|
|
|
|
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
|
|
|
|
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
|
|
|
|
/* init appearance */
|
2020-12-29 20:55:22 +00:00
|
|
|
@@ -1637,6 +1689,28 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
+sigdwmblocks(const Arg *arg)
|
|
|
|
+{
|
|
|
|
+ int fd;
|
|
|
|
+ struct flock fl;
|
2020-12-27 15:29:38 +00:00
|
|
|
+ union sigval sv;
|
2020-07-03 21:04:11 +00:00
|
|
|
+
|
2020-08-17 22:19:20 +00:00
|
|
|
+ if (!dwmblockssig)
|
2020-07-03 21:04:11 +00:00
|
|
|
+ return;
|
2020-12-27 15:29:38 +00:00
|
|
|
+ sv.sival_int = (dwmblockssig << 8) | arg->i;
|
2020-07-03 21:04:11 +00:00
|
|
|
+ fd = open(DWMBLOCKSLOCKFILE, O_RDONLY);
|
|
|
|
+ if (fd == -1)
|
|
|
|
+ return;
|
|
|
|
+ fl.l_type = F_WRLCK;
|
|
|
|
+ fl.l_start = 0;
|
|
|
|
+ fl.l_whence = SEEK_SET;
|
|
|
|
+ fl.l_len = 0;
|
|
|
|
+ if (fcntl(fd, F_GETLK, &fl) == -1 || fl.l_type == F_UNLCK)
|
|
|
|
+ return;
|
|
|
|
+ sigqueue(fl.l_pid, SIGRTMIN, sv);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void
|
|
|
|
spawn(const Arg *arg)
|
|
|
|
{
|
|
|
|
if (arg->v == dmenucmd)
|
2020-12-29 20:55:22 +00:00
|
|
|
@@ -1805,7 +1879,7 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
XSetWindowAttributes wa = {
|
|
|
|
.override_redirect = True,
|
|
|
|
.background_pixmap = ParentRelative,
|
|
|
|
- .event_mask = ButtonPressMask|ExposureMask
|
|
|
|
+ .event_mask = ButtonPressMask|ExposureMask|PointerMotionMask
|
|
|
|
};
|
|
|
|
XClassHint ch = {"dwm", "dwm"};
|
|
|
|
for (m = mons; m; m = m->next) {
|
2020-12-29 20:55:22 +00:00
|
|
|
@@ -1847,6 +1921,41 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
(unsigned char *) &(c->win), 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
+void
|
2020-09-23 15:07:49 +00:00
|
|
|
+updatedwmblockssig(int x)
|
2020-07-03 21:04:11 +00:00
|
|
|
+{
|
2020-12-29 20:55:22 +00:00
|
|
|
+ char *sts = stexts;
|
|
|
|
+ char *stp = stexts;
|
|
|
|
+ char tmp;
|
2020-07-03 21:04:11 +00:00
|
|
|
+
|
2020-12-30 10:57:28 +00:00
|
|
|
+ while (*sts != '\0') {
|
2020-12-29 20:55:22 +00:00
|
|
|
+ if ((unsigned char)*sts >= ' ') {
|
|
|
|
+ sts++;
|
2020-07-03 21:04:11 +00:00
|
|
|
+ continue;
|
|
|
|
+ }
|
2020-12-29 20:55:22 +00:00
|
|
|
+ tmp = *sts;
|
|
|
|
+ *sts = '\0';
|
|
|
|
+ x += TTEXTW(stp);
|
|
|
|
+ *sts = tmp;
|
|
|
|
+ if (x > 0) {
|
|
|
|
+ if (tmp == DELIMITERENDCHAR)
|
|
|
|
+ break;
|
2020-12-28 16:23:17 +00:00
|
|
|
+ if (!selmon->statushandcursor) {
|
|
|
|
+ selmon->statushandcursor = 1;
|
2020-09-23 15:07:49 +00:00
|
|
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurHand]->cursor);
|
|
|
|
+ }
|
2020-12-29 20:55:22 +00:00
|
|
|
+ dwmblockssig = tmp;
|
2020-07-03 21:04:11 +00:00
|
|
|
+ return;
|
|
|
|
+ }
|
2020-12-29 20:55:22 +00:00
|
|
|
+ stp = ++sts;
|
2020-12-30 10:57:28 +00:00
|
|
|
+ }
|
2020-12-28 16:23:17 +00:00
|
|
|
+ if (selmon->statushandcursor) {
|
|
|
|
+ selmon->statushandcursor = 0;
|
2020-09-23 15:07:49 +00:00
|
|
|
+ XDefineCursor(dpy, selmon->barwin, cursor[CurNormal]->cursor);
|
|
|
|
+ }
|
2020-07-03 21:04:11 +00:00
|
|
|
+ dwmblockssig = 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
int
|
|
|
|
updategeom(void)
|
|
|
|
{
|
2020-12-29 20:55:22 +00:00
|
|
|
@@ -1987,9 +2096,27 @@
|
2020-07-03 21:04:11 +00:00
|
|
|
void
|
|
|
|
updatestatus(void)
|
|
|
|
{
|
|
|
|
- if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
|
|
|
|
- strcpy(stext, "dwm-"VERSION);
|
|
|
|
- drawbar(selmon);
|
2020-12-04 22:35:16 +00:00
|
|
|
+ char rawstext[STATUSLENGTH];
|
2020-07-03 21:04:11 +00:00
|
|
|
+
|
|
|
|
+ if (gettextprop(root, XA_WM_NAME, rawstext, sizeof rawstext)) {
|
2020-12-04 22:35:16 +00:00
|
|
|
+ char stextp[STATUSLENGTH];
|
|
|
|
+ char *stp = stextp, *stc = stextc, *sts = stexts;
|
2020-07-03 21:04:11 +00:00
|
|
|
+
|
2020-12-04 22:35:16 +00:00
|
|
|
+ for (char *rst = rawstext; *rst != '\0'; rst++)
|
|
|
|
+ if ((unsigned char)*rst >= ' ')
|
|
|
|
+ *(stp++) = *(stc++) = *(sts++) = *rst;
|
2020-12-27 15:29:38 +00:00
|
|
|
+ else if ((unsigned char)*rst > DELIMITERENDCHAR)
|
2020-12-04 22:35:16 +00:00
|
|
|
+ *(stc++) = *rst;
|
2020-07-03 21:04:11 +00:00
|
|
|
+ else
|
2020-12-04 22:35:16 +00:00
|
|
|
+ *(sts++) = *rst;
|
|
|
|
+ *stp = *stc = *sts = '\0';
|
|
|
|
+ wstext = TEXTW(stextp);
|
2020-07-03 21:04:11 +00:00
|
|
|
+ } else {
|
|
|
|
+ strcpy(stextc, "dwm-"VERSION);
|
|
|
|
+ strcpy(stexts, stextc);
|
|
|
|
+ wstext = TEXTW(stextc);
|
|
|
|
+ }
|
|
|
|
+ drawbar(selmon);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|