changeset: 557:7ce958c98b75
tag: tip
user: Andrew Antle <andrew_AT_antlechrist.org>
date: Tue Jun 15 22:25:29 2010 -0400
files: dwm.suckless.org/patches/dwm-5.8.2-pertag_without_bar.diff dwm.suckless.org/patches/pertag.md
description:
Added pertag_without_bar.diff to pertag.md .
diff -r 341bb3e8a6ff -r 7ce958c98b75 dwm.suckless.org/patches/dwm-5.8.2-pertag_without_bar.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/dwm-5.8.2-pertag_without_bar.diff Tue Jun 15 22:25:29 2010 -0400
_AT_@ -0,0 +1,193 @@
+diff -NU5 -r dwm-5.8.2/dwm.c dwm-5.8.2-pertag/dwm.c
+--- dwm-5.8.2/dwm.c 2010-06-04 12:39:15.000000000 +0200
++++ dwm-5.8.2-pertag/dwm.c 2010-06-15 17:59:56.000000000 +0200
+_AT_@ -120,30 +120,10 @@
+ typedef struct {
+ const char *symbol;
+ void (*arrange)(Monitor *);
+ } Layout;
+
+-struct Monitor {
+- char ltsymbol[16];
+- float mfact;
+- int num;
+- int by; /* bar geometry */
+- int mx, my, mw, mh; /* screen size */
+- int wx, wy, ww, wh; /* window area */
+- unsigned int seltags;
+- unsigned int sellt;
+- unsigned int tagset[2];
+- Bool showbar;
+- Bool topbar;
+- Client *clients;
+- Client *sel;
+- Client *stack;
+- Monitor *next;
+- Window barwin;
+- const Layout *lt[2];
+-};
+-
+ typedef struct {
+ const char *class;
+ const char *instance;
+ const char *title;
+ unsigned int tags;
+_AT_@ -276,10 +256,34 @@
+ static Window root;
+
+ /* configuration, allows nested code to access above variables */
+ #include "config.h"
+
++struct Monitor {
++ char ltsymbol[16];
++ float mfact;
++ int num;
++ int by; /* bar geometry */
++ int mx, my, mw, mh; /* screen size */
++ int wx, wy, ww, wh; /* window area */
++ unsigned int seltags;
++ unsigned int sellt;
++ unsigned int tagset[2];
++ Bool showbar;
++ Bool topbar;
++ Client *clients;
++ Client *sel;
++ Client *stack;
++ Monitor *next;
++ Window barwin;
++ const Layout *lt[2];
++ int curtag;
++ int prevtag;
++ const Layout *lts[LENGTH(tags) + 1];
++ double mfacts[LENGTH(tags) + 1];
++};
++
+ /* 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
+_AT_@ -1492,11 +1496,11 @@
+ void
+ setlayout(const Arg *arg) {
+ if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
+ selmon->sellt ^= 1;
+ if(arg && arg->v)
+- selmon->lt[selmon->sellt] = (Layout *)arg->v;
++ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag] = (Layout *)arg->v;
+ strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
+ if(selmon->sel)
+ arrange(selmon);
+ else
+ drawbar(selmon);
+_AT_@ -1510,17 +1514,19 @@
+ if(!arg || !selmon->lt[selmon->sellt]->arrange)
+ return;
+ f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
+ if(f < 0.1 || f > 0.9)
+ return;
+- selmon->mfact = f;
++ selmon->mfact = selmon->mfacts[selmon->curtag] = f;
+ arrange(selmon);
+ }
+
+ void
+ setup(void) {
+ XSetWindowAttributes wa;
++ Monitor *m;
++ unsigned int i;
+
+ /* clean up any zombies immediately */
+ sigchld(0);
+
+ /* init screen */
+_AT_@ -1553,11 +1559,25 @@
+ dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
+ dc.gc = XCreateGC(dpy, root, 0, NULL);
+ XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
+ if(!dc.font.set)
+ XSetFont(dpy, dc.gc, dc.font.xfont->fid);
+- /* init bars */
++ /* init tags */
++ for(m = mons; m; m = m->next)
++ m->curtag = m->prevtag = 1;
++ /* init mfacts */
++ for(m = mons; m; m = m->next) {
++ for(i=0; i < LENGTH(tags) + 1 ; i++) {
++ m->mfacts[i] = m->mfact;
++ }
++ }
++ /* init layouts */
++ for(m = mons; m; m = m->next) {
++ for(i=0; i < LENGTH(tags) + 1; i++) {
++ m->lts[i] = &layouts[0];
++ }
++ }
+ updatebars();
+ updatestatus();
+ /* EWMH support per view */
+ XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32,
+ PropModeReplace, (unsigned char *) netatom, NetLast);
+_AT_@ -1684,16 +1704,29 @@
+ }
+
+ void
+ toggletag(const Arg *arg) {
+ unsigned int newtags;
++ unsigned int i;
+
+ if(!selmon->sel)
+ return;
+ newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
+ if(newtags) {
+ selmon->sel->tags = newtags;
++ if(newtags == ~0) {
++ selmon->prevtag = selmon->curtag;
++ selmon->curtag = 0;
++ }
++ if(!(newtags & 1 << (selmon->curtag - 1))) {
++ selmon->prevtag = selmon->curtag;
++ for (i=0; !(newtags & 1 << i); i++);
++ selmon->curtag = i + 1;
++ }
++ selmon->sel->tags = newtags;
++ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag];
++ selmon->mfact = selmon->mfacts[selmon->curtag];
+ arrange(selmon);
+ }
+ }
+
+ void
+_AT_@ -1957,15 +1990,31 @@
+ }
+ }
+
+ void
+ view(const Arg *arg) {
++ unsigned int i;
++
+ if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
+ return;
+ selmon->seltags ^= 1; /* toggle sel tagset */
+- if(arg->ui & TAGMASK)
++ if(arg->ui & TAGMASK) {
+ selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
++ selmon->prevtag = selmon->curtag;
++ if(arg->ui == ~0)
++ selmon->curtag = 0;
++ else {
++ for (i=0; !(arg->ui & 1 << i); i++);
++ selmon->curtag = i + 1;
++ }
++ } else {
++ selmon->prevtag= selmon->curtag ^ selmon->prevtag;
++ selmon->curtag^= selmon->prevtag;
++ selmon->prevtag= selmon->curtag ^ selmon->prevtag;
++ }
++ selmon->lt[selmon->sellt]= selmon->lts[selmon->curtag];
++ selmon->mfact = selmon->mfacts[selmon->curtag];
+ arrange(selmon);
+ }
+
+ Client *
+ wintoclient(Window w) {
diff -r 341bb3e8a6ff -r 7ce958c98b75 dwm.suckless.org/patches/pertag.md
--- a/dwm.suckless.org/patches/pertag.md Tue Jun 15 22:13:27 2010 -0400
+++ b/dwm.suckless.org/patches/pertag.md Tue Jun 15 22:25:29 2010 -0400
_AT_@ -1,35 +1,39 @@
-# PERTAG #
+PERTAG
+======
-## Description ##
+Description
+-----------
+More general approach to [taglayouts patch][3]. This patch keeps layout,
+mwfact, barpos and nmaster (if installed) per tag.
-More general approach of [taglayouts patch][3]. The patch keeps layout, mwfact, barpos and nmaster (if
-installed) per tag.
+Download
+--------
+* [dwm-5.8.2-pertag_without_bar.diff][11]
+* [dwm-5.8.2-pertag.diff][10]
+* [dwm-5.7.2-pertag.diff][9]
+* [dwm-pertag-5.6.1.diff][8]
+* [dwm-5.4-pertag.diff][7]
+* [dwm-5.2-pertag.diff][6]
+* [dwm-5.1-pertag.diff][5]
+* [dwm-5.0-pertag.diff][4]
+* [dwm-4.6-pertag.diff][1]
+* [dwm-4.6-pertag_nmaster.diff][2]
-## Download ##
- * [dwm-5.8.2-pertag.diff][10]
- * [dwm-5.7.2-pertag.diff][9]
- * [dwm-pertag-5.6.1.diff][8]
- * [dwm-5.4-pertag.diff][7]
- * [dwm-5.2-pertag.diff][6]
- * [dwm-5.1-pertag.diff][5]
- * [dwm-5.0-pertag.diff][4]
- * [dwm-4.6-pertag.diff][1]
- * [dwm-4.6-pertag_nmaster.diff][2]
-
-## Author ##
-
- * Jan Christoph Ebersbach - <jceb_AT_e-jc.de>
- * Updated by V4hn - v4hn.de
- * Updated by Jerome Andrieux - <jerome_AT_gcu.info>
- * Updated by Sidney Amani - <seed AT uffs.org>
+Authors
+-------
+* Jan Christoph Ebersbach - `<jceb at e-jc dot de>`
+* Updated by V4hn - `v4hn.de`
+* Updated by Jerome Andrieux - `<jerome at gcu dot info>`
+* Updated by Sidney Amani - `<seed at uffs dot org>`
[1]:
http://www.e-jc.de/dwm/4.6/current/dwm-4.6-pertag.diff
[2]:
http://www.e-jc.de/dwm/4.6/current/dwm-4.6-pertag_nmaster.diff
[3]: historical/taglayouts
[4]:
http://www.e-jc.de/dwm/5.0/current/dwm-5.0-pertag.diff
[5]:
http://v4hn.de/patches/dwm-5.1-pertag.diff
-[6]:
http://dwm.suckless.org/patches/historical/dwm-5.2-pertag.diff
-[7]:
http://dwm.suckless.org/patches/historical/dwm-5.4-pertag.diff
-[8]:
http://dwm.suckless.org/patches/dwm-pertag-5.6.1.diff
-[9]:
http://dwm.suckless.org/patches/dwm-5.7.2-pertag.diff
-[10]:
http://dwm.suckless.org/patches/dwm-5.8.2-pertag.diff
+[6]: historical/dwm-5.2-pertag.diff
+[7]: historical/dwm-5.4-pertag.diff
+[8]: dwm-pertag-5.6.1.diff
+[9]: dwm-5.7.2-pertag.diff
+[10]: dwm-5.8.2-pertag.diff
+[11]: dwm-5.8.2-pertag_without_bar.diff
Received on Wed Jun 16 2010 - 04:26:45 CEST