changeset 766:3f7c68a720b5

undone naming change: "group" is "tag" again (but without plural)
author meillo@marmaro.de
date Fri, 05 Dec 2008 19:43:56 +0100 (2008-12-05)
parents f1d4bc4afcd9
children 706991d15451
files aewl.c config.h
diffstat 2 files changed, 45 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/aewl.c	Fri Dec 05 19:13:24 2008 +0100
+++ b/aewl.c	Fri Dec 05 19:43:56 2008 +0100
@@ -18,10 +18,7 @@
  * Each child of the root window is called a client, except windows which have
  * set the override_redirect flag.  Clients are organized in a global
  * doubly-linked client list, the focus history is remembered through a global
- * stack list. Each client contains an array of Bools of the same size as the
- * global tags array to indicate the tags of a client.  For each client dwm
- * creates a small title window, which is resized whenever the (_NET_)WM_NAME
- * properties are updated or the client is moved/resized.
+ * stack list. [...]
  *
  * Keys and tagging rules are organized as arrays and defined in the config.h
  * file. These arrays are kept static in event.o and tag.o respectively,
@@ -30,8 +27,20 @@
  * domax() or dotile().
  *
  * To understand everything else, start reading main.c:main().
+ *
+ * -- and now about aewl --
+ *
+ * aewl is a stripped down dwm. It stated as a patchset, but finally forked off
+ * completely. The reason for this was the increasing gap between my wish to
+ * stay where dwm was, and dwm direction to go further. Further more did I
+ * always use only a small subset of dwm's features, so condencing dwm had been
+ * my wish for a long time.
+ *
+ * In aewl clients are either tagged or not (only one tag). Visible are either
+ * all tagged clients or all without the tag.
  */
 
+
 #include "config.h"
 #include <errno.h>
 #include <locale.h>
@@ -86,7 +95,7 @@
 	long flags;
 	unsigned int border;
 	Bool isfixed, isfloat, ismax;
-	Bool group;
+	Bool tag;
 	Client *next;
 	Client *prev;
 	Client *snext;
@@ -95,7 +104,7 @@
 
 typedef struct {
 	const char *clpattern;
-	int group;
+	int tag;
 	Bool isfloat;
 } Rule;
 
@@ -126,7 +135,7 @@
 void (*handler[LASTEvent])(XEvent *);	/* event handler */
 void (*arrange)(void);			/* arrange function, indicates mode  */
 Atom wmatom[WMLast], netatom[NetLast];
-Bool running, selscreen, selgroup;
+Bool running, selscreen, seltag;
 Client *clients, *sel, *stack;		/* global client list and stack */
 Cursor cursor[CurLast];
 DC dc;					/* global draw context */
@@ -177,7 +186,7 @@
 /* tag.c */
 void initrregs(void);			/* initialize regexps of rules defined in config.h */
 Client *getnext(Client *c);		/* returns next visible client */
-void setgroup(Client *c, Client *trans);	/* sets group of c */
+void settag(Client *c, Client *trans);	/* sets tag of c */
 
 /* util.c */
 void *emallocz(unsigned int size);	/* allocates zero-initialized memory, exits on error */
@@ -191,7 +200,7 @@
 void restack(void);			/* restores z layers of all clients */
 
 
-void toggleview(void);			/* toggle the viewed group */
+void toggleview(void);			/* toggle the view */
 void focusnext(void);		/* focuses next visible client  */
 void zoom(void);			/* zooms the focused client to master area */
 void killclient(void);		/* kill c nicely */
@@ -200,7 +209,7 @@
 void togglefloat(void);		/* toggles focusesd client between floating/non-floating state */
 void incnmaster(void);		/* increments nmaster */
 void decnmaster(void);		/* decrements nmaster */
-void togglegroup(void);		/* toggles c group */
+void toggletag(void);		/* toggles tag of c */
 void spawn(const char* cmd);			/* forks a new subprocess with cmd */
 
 
@@ -388,7 +397,7 @@
 
 Bool
 isvisible(Client *c) {
-	return (c->group == selgroup);
+	return (c->tag == seltag);
 }
 
 void
@@ -444,7 +453,7 @@
 
 void
 toggleview() {
-	selgroup = !selgroup;
+	seltag = !seltag;
 	arrange();
 }
 
@@ -578,7 +587,7 @@
 }
 
 void
-setgroup(Client *c, Client *trans) {
+settag(Client *c, Client *trans) {
 	char prop[512];
 	unsigned int i;
 	regmatch_t tmp;
@@ -586,7 +595,7 @@
 	XClassHint ch = { 0 };
 
 	if(matched) {
-		c->group = trans->group;
+		c->tag = trans->tag;
 	} else {
 		XGetClassHint(dpy, c->win, &ch);
 		snprintf(prop, sizeof prop, "%s:%s:%s",
@@ -595,12 +604,12 @@
 		for(i = 0; i < len && !matched; i++)
 			if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {
 				c->isfloat = rule[i].isfloat;
-				if (rule[i].group < 0) {
-					c->group = selgroup;
-				} else if (rule[i].group == 0) {
-					c->group = True;
+				if (rule[i].tag < 0) {
+					c->tag = seltag;
+				} else if (rule[i].tag) {
+					c->tag = True;
 				} else {
-					c->group = False;
+					c->tag = False;
 				}
 				matched = True;
 			}
@@ -610,15 +619,15 @@
 			XFree(ch.res_name);
 	}
 	if(!matched) {
-		c->group = selgroup;
+		c->tag = seltag;
 	}
 }
 
 void
-togglegroup() {
+toggletag() {
 	if(!sel)
 		return;
-	sel->group = !sel->group;
+	sel->tag = !sel->tag;
 	toggleview();
 }
 
@@ -1047,11 +1056,11 @@
 	int x;
 
 	dc.x = dc.y = 0;
-	dc.w = textw(NAMESEL);
-	drawtext(NAMESEL, ( selgroup ? dc.sel : dc.norm ));
+	dc.w = textw(NAMETAGGED);
+	drawtext(NAMETAGGED, ( seltag ? dc.sel : dc.norm ));
 	dc.x += dc.w + 1;
-	dc.w = textw(NAMENSEL);
-	drawtext(NAMENSEL, ( selgroup ? dc.norm : dc.sel ));
+	dc.w = textw(NAMEUNTAGGED);
+	drawtext(NAMEUNTAGGED, ( seltag ? dc.norm : dc.sel ));
 	dc.x += dc.w + 1;
 	dc.w = bmw;
 	drawtext("", dc.norm);
@@ -1283,7 +1292,7 @@
 	Window trans;
 
 	c = emallocz(sizeof(Client));
-	c->group = True;
+	c->tag = True;
 	c->win = w;
 	c->x = wa->x;
 	c->y = wa->y;
@@ -1311,7 +1320,7 @@
 	grabbuttons(c, False);
 	XSetWindowBorder(dpy, c->win, dc.norm[ColBG]);
 	updatetitle(c);
-	setgroup(c, getclient(trans));
+	settag(c, getclient(trans));
 	if(!c->isfloat)
 		c->isfloat = trans || c->isfixed;
 	if(clients)
@@ -1584,7 +1593,7 @@
 	XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
 	grabkeys();
 	initrregs();
-	selgroup = True;
+	seltag = True;
 	/* style */
 	dc.norm[ColBG] = getcolor(NORMBGCOLOR);
 	dc.norm[ColFG] = getcolor(NORMFGCOLOR);
--- a/config.h	Fri Dec 05 19:13:24 2008 +0100
+++ b/config.h	Fri Dec 05 19:43:56 2008 +0100
@@ -3,8 +3,8 @@
  * See LICENSE file for license details.
  */
 
-#define NAMESEL "Das Alles"
-#define NAMENSEL "Das Nichts"
+#define NAMETAGGED "Das Alles"
+#define NAMEUNTAGGED "Das Nichts"
 
 #define BORDERPX		1
 #define DEFMODE			domax		/* dotile */
@@ -36,17 +36,17 @@
 	{ MODKEY|ShiftMask,		XK_space,	togglefloat,	"" }, \
 	{ MODKEY,			XK_plus,		incnmaster,	"" }, \
 	{ MODKEY,			XK_minus,		decnmaster,	"" }, \
-	{ MODKEY,		XK_F3,		togglegroup,		"" }, \
+	{ MODKEY,		XK_F3,		toggletag,		"" }, \
 };
 
 /* Query class:instance:title for regex matching info with following command:
  * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
 #define RULES \
 static Rule rule[] = { \
-	/* class:instance:title regex, group (0=first/1=second/-1=curr), isfloat */ \
-	{ "URxvt.*",	  	  	1,	    	False }, \
+	/* class:instance:title regex, tag (1=tag/0=untag/-1=curr), isfloat */ \
+	{ "URxvt.*",	  	  	0,	    	False }, \
 	{ "MPlayer.*",		  	-1,	    	True }, \
 	{ "qiv.*",		  	    -1,	    	False }, \
-	{ "Gimp.*",	      		0,		True }, \
-	{ ".*",		          	0,	    	False }, \
+	{ "Gimp.*",	      		1,		True }, \
+	{ ".*",		          	1,	    	False }, \
 };