commit fac8780e4b1632e8ede500a97d26b033caa12c80
parent e8cb0b7a8797cd5cc62751db8acce82ab88d4204
Author: Kris Maglione <jg@suckless.org>
Date: Wed, 13 May 2009 12:57:22 -0400
Update copyright dates, allow space indents in wmiirc key/event specs, fix 'Urgent toggle'.
Diffstat:
38 files changed, 92 insertions(+), 74 deletions(-)
diff --git a/LICENSE b/LICENSE
@@ -1,4 +1,4 @@
-© 2006-2007 Kris Maglione <fbsdaemon@gmail.com>
+© 2006-2009 Kris Maglione <fbsdaemon@gmail.com>
© 2003-2006 Anselm R. Garbe <garbeam at suckless dot org>
Permission is hereby granted, free of charge, to any person obtaining a
diff --git a/cmd/click/_util.c b/cmd/click/_util.c
@@ -1,4 +1,4 @@
-/* Copyright ©2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2008-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/click/main.c b/cmd/click/main.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2006-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#define EXTERN
@@ -9,7 +9,7 @@
#include <string.h>
#include "fns.h"
-static const char version[] = "click-"VERSION", ©2008 Kris Maglione\n";
+static const char version[] = "click-"VERSION", ©2009 Kris Maglione\n";
static void
usage(void) {
diff --git a/cmd/menu/event.c b/cmd/menu/event.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2006-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/menu/main.c b/cmd/menu/main.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2006-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#define IXP_NO_P9_
@@ -13,7 +13,7 @@
#include "fns.h"
#define link _link
-static const char version[] = "wimenu-"VERSION", ©2008 Kris Maglione\n";
+static const char version[] = "wimenu-"VERSION", ©2009 Kris Maglione\n";
static IxpClient* client;
static IxpCFid* ctlfid;
static Biobuf* inbuf;
diff --git a/cmd/menu/menu.c b/cmd/menu/menu.c
@@ -272,6 +272,14 @@ kdown_event(Window *w, XKeyEvent *e) {
case XK_E:
menu_cmd(FORWARD, LINE);
return;
+ case XK_b:
+ case XK_B:
+ menu_cmd(BACKWARD, CHAR);
+ return;
+ case XK_f:
+ case XK_F:
+ menu_cmd(FORWARD, CHAR);
+ return;
case XK_n:
case XK_N:
menu_cmd(HIST, FORWARD);
@@ -325,6 +333,14 @@ kdown_event(Window *w, XKeyEvent *e) {
case XK_G:
menu_cmd(CMPL_LAST, 0);
return;
+ case XK_b:
+ case XK_B:
+ menu_cmd(BACKWARD, WORD);
+ return;
+ case XK_f:
+ case XK_F:
+ menu_cmd(FORWARD, WORD);
+ return;
}
}
switch(ksym) {
diff --git a/cmd/strut/_util.c b/cmd/strut/_util.c
@@ -1,4 +1,4 @@
-/* Copyright ©2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2008-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/strut/event.c b/cmd/strut/event.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2006-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/strut/ewmh.c b/cmd/strut/ewmh.c
@@ -1,4 +1,4 @@
-/* Copyright ©2007-2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2007-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/strut/main.c b/cmd/strut/main.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2006-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#define EXTERN
diff --git a/cmd/strut/win.c b/cmd/strut/win.c
@@ -1,4 +1,4 @@
-/* Copyright ©2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyright ©2008-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/_util.c b/cmd/wmii/_util.c
@@ -1,4 +1,4 @@
-/* Copyright ©2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2008-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
@@ -239,9 +239,8 @@ char**
comm(int cols, char **toka, char **tokb) {
Vector_ptr vec;
char **ret;
- int cmp, len;
+ int cmp;
- len = 0;
vector_pinit(&vec);
while(*toka || *tokb) {
if(!*toka)
@@ -251,22 +250,16 @@ comm(int cols, char **toka, char **tokb) {
else
cmp = strcmp(*toka, *tokb);
if(cmp < 0) {
- if(cols & CLeft) {
+ if(cols & CLeft)
vector_ppush(&vec, *toka);
- len += strlen(*toka) + 1;
- }
toka++;
}else if(cmp > 0) {
- if(cols & CRight) {
+ if(cols & CRight)
vector_ppush(&vec, *tokb);
- len += strlen(*tokb) + 1;
- }
tokb++;
}else {
- if(cols & CCenter) {
+ if(cols & CCenter)
vector_ppush(&vec, *toka);
- len += strlen(*toka) + 1;
- }
toka++;
tokb++;
}
diff --git a/cmd/wmii/area.c b/cmd/wmii/area.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/bar.c b/cmd/wmii/bar.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/client.c b/cmd/wmii/client.c
@@ -1,5 +1,5 @@
/* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
- * Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+ * Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
@@ -629,7 +629,7 @@ fullscreen(Client *c, int fullscreen) {
}
void
-client_seturgent(Client *c, bool urgent, int from) {
+client_seturgent(Client *c, int urgent, int from) {
XWMHints *wmh;
char *cfrom, *cnot;
Frame *f, *ff;
diff --git a/cmd/wmii/column.c b/cmd/wmii/column.c
@@ -1,5 +1,5 @@
/* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
- * Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+ * Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/div.c b/cmd/wmii/div.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/event.c b/cmd/wmii/event.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/ewmh.c b/cmd/wmii/ewmh.c
@@ -1,4 +1,4 @@
-/* Copyright ©2007-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2007-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/float.c b/cmd/wmii/float.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/fns.h b/cmd/wmii/fns.h
@@ -84,7 +84,7 @@ void client_prop(Client*, Atom);
void client_reparent(Client*, Window*, Point);
void client_resize(Client*, Rectangle);
void client_setcursor(Client*, Cursor);
-void client_seturgent(Client*, bool, int);
+void client_seturgent(Client*, int, int);
void client_setviews(Client*, char**);
void client_unmap(Client*, int state);
Frame* client_viewframe(Client *c, View *v);
diff --git a/cmd/wmii/frame.c b/cmd/wmii/frame.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/fs.c b/cmd/wmii/fs.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
@@ -212,8 +212,10 @@ dostat(Stat *s, IxpFileId *f) {
s->muid = user;
}
-/* All lookups and directory organization should be performed through
- * lookup_file, mostly through the dirtabs[] tree. */
+/*
+ * All lookups and directory organization should be performed through
+ * lookup_file, mostly through the dirtab[] tree.
+ */
static IxpFileId*
lookup_file(IxpFileId *parent, char *name)
{
@@ -249,12 +251,15 @@ lookup_file(IxpFileId *parent, char *name)
file->p.client = c;
file->id = c->w.w;
file->index = c->w.w;
- }if(name) goto LastItem;
+ }
+ if(name)
+ goto LastItem;
}
SET(id);
if(name) {
id = (uint)strtol(name, &name, 16);
- if(*name) goto NextItem;
+ if(*name)
+ goto NextItem;
}
for(c=client; c; c=c->next) {
if(!name || c->w.w == id) {
@@ -264,7 +269,8 @@ lookup_file(IxpFileId *parent, char *name)
file->id = c->w.w;
file->index = c->w.w;
assert(file->tab.name);
- if(name) goto LastItem;
+ if(name)
+ goto LastItem;
}
}
break;
@@ -273,7 +279,8 @@ lookup_file(IxpFileId *parent, char *name)
if(!name || !strcmp(name, debugtab[i])) {
push_file(debugtab[i]);
file->id = i;
- if(name) goto LastItem;
+ if(name)
+ goto LastItem;
}
break;
case FsDTags:
@@ -283,7 +290,9 @@ lookup_file(IxpFileId *parent, char *name)
file->volatil = true;
file->p.view = selview;
file->id = selview->id;
- }if(name) goto LastItem;
+ }
+ if(name)
+ goto LastItem;
}
for(v=view; v; v=v->next) {
if(!name || !strcmp(name, v->name)) {
@@ -291,7 +300,8 @@ lookup_file(IxpFileId *parent, char *name)
file->volatil = true;
file->p.view = v;
file->id = v->id;
- if(name) goto LastItem;
+ if(name)
+ goto LastItem;
}
}
break;
@@ -302,7 +312,8 @@ lookup_file(IxpFileId *parent, char *name)
file->volatil = true;
file->p.bar = b;
file->id = b->id;
- if(name) goto LastItem;
+ if(name)
+ goto LastItem;
}
}
break;
@@ -329,7 +340,8 @@ lookup_file(IxpFileId *parent, char *name)
file->p.rule = &def.tagrules;
break;
}
- if(name) goto LastItem;
+ if(name)
+ goto LastItem;
}
NextItem:
continue;
@@ -466,7 +478,8 @@ fs_read(Ixp9Req *r) {
return;
}
r->ofcall.io.data = smprint("%C", f->p.client);
- r->ofcall.io.count = strlen(r->ofcall.io.data); /* will die if nil */
+ /* Will (and should) die if result is nil */
+ r->ofcall.io.count = strlen(r->ofcall.io.data);
respond(r, nil);
return;
case FsFTindex:
@@ -483,10 +496,7 @@ fs_read(Ixp9Req *r) {
return;
}
}
- /*
- * This is an assert because this should this should not be called if
- * the file is not open for reading.
- */
+ /* This should not be called if the file is not open for reading. */
die("Read called on an unreadable file");
}
@@ -566,9 +576,7 @@ fs_write(Ixp9Req *r) {
return;
}
/*
- * This is an assert because this function should not be called if
- * the file is not open for writing.
- */
+ /* This should not be called if the file is not open for writing. */
die("Write called on an unwritable file");
}
diff --git a/cmd/wmii/geom.c b/cmd/wmii/geom.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/key.c b/cmd/wmii/key.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <fbsdaemon at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <fbsdaemon at Gmail>
* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
*/
diff --git a/cmd/wmii/layout.c b/cmd/wmii/layout.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c
@@ -1,5 +1,5 @@
/* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
- * Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+ * Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#define EXTERN
@@ -16,7 +16,7 @@
#include "fns.h"
static const char
- version[] = "wmii-"VERSION", ©2008 Kris Maglione\n";
+ version[] = "wmii-"VERSION", ©2009 Kris Maglione\n";
static char* address;
static char* ns_path;
diff --git a/cmd/wmii/message.c b/cmd/wmii/message.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/mouse.c b/cmd/wmii/mouse.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/root.c b/cmd/wmii/root.c
@@ -1,4 +1,4 @@
-/* Copyright ©2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2008-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/screen.c b/cmd/wmii/screen.c
@@ -1,4 +1,4 @@
-/* Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/view.c b/cmd/wmii/view.c
@@ -1,5 +1,5 @@
/* Copyright ©2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
- * Copyright ©2006-2008 Kris Maglione <maglione.k at Gmail>
+ * Copyright ©2006-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/x11.c b/cmd/wmii/x11.c
@@ -1,4 +1,4 @@
-/* Copyright ©2007-2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2007-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#define _X11_VISIBLE
diff --git a/cmd/wmii/xdnd.c b/cmd/wmii/xdnd.c
@@ -1,4 +1,4 @@
-/* Copyright ©2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2008-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include "dat.h"
diff --git a/cmd/wmii/xext.c b/cmd/wmii/xext.c
@@ -1,4 +1,4 @@
-/* Copyright ©2008 Kris Maglione <maglione.k at Gmail>
+/* Copyright ©2008-2009 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#define _X11_VISIBLE
diff --git a/cmd/wmiir.c b/cmd/wmiir.c
@@ -1,4 +1,4 @@
-/* Copyight ©2007-2008 Kris Maglione <fbsdaemon@gmail.com>
+/* Copyight ©2007-2009 Kris Maglione <fbsdaemon@gmail.com>
* See LICENSE file for license details.
*/
#define IXP_NO_P9_
@@ -384,7 +384,7 @@ main(int argc, char *argv[]) {
ARGBEGIN{
case 'v':
- print("%s-" VERSION ", ©2008 Kris Maglione\n", argv0);
+ print("%s-" VERSION ", ©2009 Kris Maglione\n", argv0);
exit(0);
case 'a':
address = EARGF(usage());
diff --git a/img/mkfile b/img/mkfile
@@ -2,11 +2,12 @@ MKSHELL=rc
path=$PLAN9/bin $path
eps = wmii.eps
+calc = rc -c 'hoc -e $"*'
epsbox = `{sed -n '/^%%BoundingBox:/{s/.*://p; q;}' $eps}
iconwidth = 154
-iconscale = `{*=$epsbox; hoc -e $iconwidth/'('$3-' '$1')'}
-iconheight = `{*=$epsbox; hoc -e '('$4-' '$2')*'$iconscale}
+iconscale = `{*=$epsbox; $calc $iconwidth / '('$3 - $1')'}
+iconheight = `{*=$epsbox; $calc '('$4 - $2') *' $iconscale}
%.png: %.eps
* = `{hoc -e'-('$epsbox')'}
diff --git a/rc/wmiirc.sh b/rc/wmiirc.sh
@@ -51,7 +51,7 @@ echo $WMII_NORMCOLORS | wmiir create $noticebar
# Event processing
events() {
- sed 's/^ //' <<'!'
+ cat <<'!'
# Events
Event CreateTag
echo "$WMII_NORMCOLORS" "$@" | wmiir create "/lbar/$@"
@@ -186,7 +186,7 @@ events() {
wmiir xwrite /tag/sel/ctl send sel up
!
for i in 0 1 2 3 4 5 6 7 8 9; do
- sed 's/^ //' <<!
+ cat <<'!'
Key $MODKEY-$i
wmiir xwrite /ctl view "$i"
Key $MODKEY-Shift-$i
@@ -195,7 +195,7 @@ events() {
done
}
wi_events <<!
-$(events)
+$(events | sed 's/^ \|^ //')
$(local_events)
!
unset events local_events