[wiki] [sites] wiki updated

From: <hg_AT_suckless.org>
Date: Sun, 13 Sep 2009 16:57:46 +0000 (UTC)

changeset: 249:91df7ac7b329
tag: tip
user: pancake_AT_localhost.localdomain
date: Sun Sep 13 18:57:36 2009 +0200
files: dwm.suckless.org/patches/clientspertag.md dwm.suckless.org/patches/dwm-5.6.1-cpt.diff
description:
* Initial import of the stable 'clientspertag' patch for dwm


diff -r 1ab2acf3dca6 -r 91df7ac7b329 dwm.suckless.org/patches/clientspertag.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/clientspertag.md Sun Sep 13 18:57:36 2009 +0200
_AT_@ -0,0 +1,47 @@
+# CLIENTS PER TAG
+
+## Description
+
+This patch modifies the tile() layout to limit the maximum number of visible
+clients per tag. Out-of-limit windows are arranged.
+
+
+ +-----------------------+ +-----------------------+
+ | -1/3 | | 2/3 |
+ +-----------+-----------+ +-----------+-----------+
+ | | | | | |
+ | | 2 | | | |
+ | | | | | |
+ | 1 +-----------+ | 1 | 2 |
+ | | | | | |
+ | | 3 | | | |
+ | | | | | |
+ +-----------+-----------+ +-----------+-----------+
+ cpt=-1 cpt=2
+
+## Usage
+
+ 1. Download the patch and apply according to the [general instructions](.).
+ 2. The patch adds two new keybindings (META-q/a) which set cpt to ^2 and ^3:
+
+If the argument to 'clientspertag' starts with '^' pressing twice the key
+will result on swapping between the defined value and -1.
+
+ * To show all windows put "-1" as argument value.
+ * To only display floating windows put "0" as argument.
+ * For a toggling pair put "^2".
+
+ static Key keys[] = {
+ /* modifier key function argument */
+ ...
+ { MODKEY, XK_q, clientspertag, {.v="^2"} },
+ { MODKEY, XK_a, clientspertag, {.v="^3"} },
+ };
+
+## Download
+
+ * [dwm-5.6.1-cpt.diff][dwm-5.6.1-cpt.diff] (2.9k) (20090913)
+
+## Maintainer
+
+ * pancake - <pancake_AT_nopcode.org>
diff -r 1ab2acf3dca6 -r 91df7ac7b329 dwm.suckless.org/patches/dwm-5.6.1-cpt.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/dwm-5.6.1-cpt.diff Sun Sep 13 18:57:36 2009 +0200
_AT_@ -0,0 +1,88 @@
+Only in dwm-5.6.1-cpt: ch
+diff -ru dwm-5.6.1/config.def.h dwm-5.6.1-cpt/config.def.h
+--- dwm-5.6.1/config.def.h 2009-09-13 18:11:32.000000000 +0200
++++ dwm-5.6.1-cpt/config.def.h 2009-07-26 15:01:50.000000000 +0200
+_AT_@ -80,8 +80,6 @@
+ TAGKEYS( XK_7, 6)
+ TAGKEYS( XK_8, 7)
+ TAGKEYS( XK_9, 8)
+- { MODKEY, XK_q, clientspertag, {.v="^2"} },
+- { MODKEY, XK_a, clientspertag, {.v="^3"} },
+ { MODKEY|ShiftMask, XK_q, quit, {0} },
+ };
+
+Only in dwm-5.6.1-cpt: config.h
+Only in dwm-5.6.1-cpt: dwm
+diff -ru dwm-5.6.1/dwm.c dwm-5.6.1-cpt/dwm.c
+--- dwm-5.6.1/dwm.c 2009-07-26 15:01:50.000000000 +0200
++++ dwm-5.6.1-cpt/dwm.c 2009-09-13 18:08:50.000000000 +0200
+_AT_@ -268,12 +268,23 @@
+ static Window root;
+
+ /* configuration, allows nested code to access above variables */
++static int cpt = -1;
++static void clientspertag(const Arg *arg) {
++ const char *cmd = (const char *)arg->v;
++ if (cmd[0]=='^') {
++ if (cpt==-1) cpt = atoi(cmd+1);
++ else if (cpt==atoi(cmd+1)) cpt = -1;
++ else cpt = atoi(cmd+1);
++ } else cpt = atoi(cmd);
++ arrange();
++}
+ #include "config.h"
+
+ /* compile-time check if all tags fit into an unsigned int bit array. */
+ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
+
+ /* function implementations */
++
+ void
+ applyrules(Client *c) {
+ const char *class, *instance;
+_AT_@ -674,7 +685,7 @@
+ drawtext(m->lt[m->sellt]->symbol, dc.norm, False);
+ dc.x += dc.w;
+ }
+- snprintf(ntext, sizeof ntext, "%u", n);
++ snprintf(ntext, sizeof ntext, "%d/%u", cpt, n);
+ dc.w = TEXTW(ntext);
+ drawtext(ntext, dc.norm, False);
+ x = (dc.x += dc.w);
+_AT_@ -1435,6 +1446,7 @@
+ sw = DisplayWidth(dpy, screen);
+ sh = DisplayHeight(dpy, screen);
+ bh = dc.h = dc.font.height + 2;
++ cpt = -1;
+ updategeom();
+ /* init atoms */
+ wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
+_AT_@ -1549,6 +1561,7 @@
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if(n == 0)
+ return;
++ if (cpt!=-1 && n>cpt) n = cpt;
+ /* master */
+ c = nexttiled(m->clients);
+ mw = m->mfact * m->ww;
+_AT_@ -1563,10 +1576,15 @@
+ if(h < bh)
+ h = m->wh;
+ for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
+- resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
+- ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
+- if(h != m->wh)
+- y = c->y + HEIGHT(c);
++ if (cpt!=-1 && i>=cpt) {
++ resize(c, x, m->wy, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
++ ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
++ } else {
++ resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
++ ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
++ if(h != m->wh)
++ y = c->y + HEIGHT(c);
++ }
+ }
+ }
+
+Only in dwm-5.6.1-cpt: dwm.o
Received on Sun Sep 13 2009 - 18:57:46 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 13 2012 - 19:30:49 CEST