[wiki] [sites] add emptyview patch for dwm. || Markus Teich

From: <git_AT_suckless.org>
Date: Sat, 30 Mar 2013 14:26:14 +0100

commit 9b14e95c80e952c160203ff7b3cf368c6f66ba9a
Author: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Sat Mar 30 14:25:26 2013 +0100

    add emptyview patch for dwm.
    
    This patch allows for no tag to be selected in dwm.

diff --git a/dwm.suckless.org/patches/dwm-6.0-emptyview.diff b/dwm.suckless.org/patches/dwm-6.0-emptyview.diff
new file mode 100644
index 0000000..e211a17
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.0-emptyview.diff
_AT_@ -0,0 +1,61 @@
+diff --git a/dwm.c b/dwm.c
+index 1d78655..a526e57 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -322,7 +322,9 @@ applyrules(Client *c) {
+ XFree(ch.res_class);
+ if(ch.res_name)
+ XFree(ch.res_name);
+- c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
++ if(c->tags & TAGMASK) c->tags = c->tags & TAGMASK;
++ else if(c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags];
++ else c->tags = 1;
+ }
+
+ Bool
+_AT_@ -649,7 +651,7 @@ createmon(void) {
+
+ if(!(m = (Monitor *)calloc(1, sizeof(Monitor))))
+ die("fatal: could not malloc() %u bytes
", sizeof(Monitor));
+- m->tagset[0] = m->tagset[1] = 1;
++ m->tagset[0] = m->tagset[1] = 0;
+ m->mfact = mfact;
+ m->nmaster = nmaster;
+ m->showbar = showbar;
+_AT_@ -1479,7 +1481,7 @@ sendmon(Client *c, Monitor *m) {
+ detach(c);
+ detachstack(c);
+ c->mon = m;
+- c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
++ c->tags = (m->tagset[m->seltags] ? m->tagset[m->seltags] : 1);
+ attach(c);
+ attachstack(c);
+ focus(NULL);
+_AT_@ -1763,12 +1765,9 @@ toggletag(const Arg *arg) {
+ void
+ toggleview(const Arg *arg) {
+ unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
+-
+- if(newtagset) {
+- selmon->tagset[selmon->seltags] = newtagset;
+- focus(NULL);
+- arrange(selmon);
+- }
++ selmon->tagset[selmon->seltags] = newtagset;
++ focus(NULL);
++ arrange(selmon);
+ }
+
+ void
+_AT_@ -2043,7 +2042,7 @@ updatewmhints(Client *c) {
+
+ void
+ view(const Arg *arg) {
+- if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
++ if(arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
+ return;
+ selmon->seltags ^= 1; /* toggle sel tagset */
+ if(arg->ui & TAGMASK)
+--
+1.8.2
+
diff --git a/dwm.suckless.org/patches/emptyview.md b/dwm.suckless.org/patches/emptyview.md
new file mode 100644
index 0000000..7d3f4ed
--- /dev/null
+++ b/dwm.suckless.org/patches/emptyview.md
_AT_@ -0,0 +1,17 @@
+emptyview
+=========
+
+Description
+-----------
+I like my wallpapers. Also i found it kind of unintuitive that you can not toggle the last tag out of view. So i created a patch to allow no tag at all to be selected.
+
+With this patch, dwm will start with no tag selected. When you start a client with no tag rule and no tag selected, it gets opened in the first tag.
+
+Download
+--------
+
+ * [dwm-6.0-emptyview.diff](dwm-6.0-emptyview.diff) (1753b) (20130330)
+
+Authors
+-------
+ * Markus Teich - `<teichm at in dot tum dot de>`
Received on Sat Mar 30 2013 - 14:26:14 CET

This archive was generated by hypermail 2.3.0 : Sat Mar 30 2013 - 14:36:10 CET