summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-09-12 00:48:29 +0200
committerbakkeby <[email protected]>2019-09-12 00:48:29 +0200
commit9e17c55d959a1936eeae4e7cb43d30236f5bea61 (patch)
treeec72d684de79beb9192fb36e9068d1b74d6e8994 /patch
parent706e06be438ec9e20e1ebcfcfbb0ff00bc2d2cc1 (diff)
downloaddwm-flexipatch-9e17c55d959a1936eeae4e7cb43d30236f5bea61.tar.gz
dwm-flexipatch-9e17c55d959a1936eeae4e7cb43d30236f5bea61.zip
Adding ewmhtags patch
Diffstat (limited to 'patch')
-rw-r--r--patch/ewmhtags.c40
-rw-r--r--patch/ewmhtags.h7
-rw-r--r--patch/include.c4
-rw-r--r--patch/include.h4
4 files changed, 55 insertions, 0 deletions
diff --git a/patch/ewmhtags.c b/patch/ewmhtags.c
new file mode 100644
index 0000000..682d900
--- /dev/null
+++ b/patch/ewmhtags.c
@@ -0,0 +1,40 @@
+void
+setcurrentdesktop(void)
+{
+ long data[] = { 0 };
+ XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1);
+}
+
+void
+setdesktopnames(void)
+{
+ XTextProperty text;
+ Xutf8TextListToTextProperty(dpy, tags, TAGSLENGTH, XUTF8StringStyle, &text);
+ XSetTextProperty(dpy, root, &text, netatom[NetDesktopNames]);
+}
+
+void
+setnumdesktops(void)
+{
+ long data[] = { TAGSLENGTH };
+ XChangeProperty(dpy, root, netatom[NetNumberOfDesktops], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1);
+}
+
+void
+setviewport(void)
+{
+ long data[] = { 0, 0 };
+ XChangeProperty(dpy, root, netatom[NetDesktopViewport], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2);
+}
+
+void
+updatecurrentdesktop(void)
+{
+ long rawdata[] = { selmon->tagset[selmon->seltags] };
+ int i = 0;
+ while (*rawdata >> (i + 1)) {
+ i++;
+ }
+ long data[] = { i };
+ XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1);
+} \ No newline at end of file
diff --git a/patch/ewmhtags.h b/patch/ewmhtags.h
new file mode 100644
index 0000000..2ec890e
--- /dev/null
+++ b/patch/ewmhtags.h
@@ -0,0 +1,7 @@
+#define TAGSLENGTH (LENGTH(tags))
+
+static void setcurrentdesktop(void);
+static void setdesktopnames(void);
+static void setnumdesktops(void);
+static void setviewport(void);
+static void updatecurrentdesktop(void); \ No newline at end of file
diff --git a/patch/include.c b/patch/include.c
index 1ddc897..809a792 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -32,6 +32,10 @@
#include "cyclelayouts.c"
#endif
+#if EWMHTAGS_PATCH
+#include "ewmhtags.c"
+#endif
+
#if PERTAG_PATCH
#include "pertag.c"
#endif
diff --git a/patch/include.h b/patch/include.h
index 3e3027c..9226f4d 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -32,6 +32,10 @@
#include "cyclelayouts.h"
#endif
+#if EWMHTAGS_PATCH
+#include "ewmhtags.h"
+#endif
+
#if ROTATESTACK_PATCH
#include "rotatestack.h"
#endif