changeset: 2474:f5295cc0d4bc
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Jun 11 19:46:01 2009 -0400
files: alternative_wmiircs/python/pygmi/fs.py cmd/menu/keys.txt cmd/wmii/client.c cmd/wmii/key.c mk/common.mk mk/hdr.mk
description:
Add 'make tags'. Fix ^[ binding in wimenu.
diff -r 141755859b1a -r f5295cc0d4bc alternative_wmiircs/python/pygmi/fs.py
--- a/alternative_wmiircs/python/pygmi/fs.py Fri May 29 18:54:38 2009 -0400
+++ b/alternative_wmiircs/python/pygmi/fs.py Thu Jun 11 19:46:01 2009 -0400
@@ -1,4 +1,5 @@
import collections
+from datetime import datetime, timedelta
from pyxp import *
from pyxp.client import *
@@ -6,6 +7,13 @@
__all__ = ('wmii', 'Tags', 'Tag', 'Area', 'Frame', 'Client',
'Button', 'Colors', 'Color')
+
+def constrain(min, max, val):
+ if val < min:
+ return min
+ if val > max:
+ return max
+ return val
class Ctl(object):
sentinel = {}
@@ -530,6 +538,7 @@
self.sel = None
self.normcol = normcol or wmii['normcolors']
self.focuscol = focuscol or wmii['focuscolors']
+ self.lastselect = datetime.now()
for t in wmii.tags:
self.add(t.id)
for b in wmii.lbuttons:
@@ -577,12 +586,19 @@
tag = tag.id
wmii['view'] = tag
- if tag != self.mru[-1] and tag not in self.ignore:
- self.mru.append(tag)
- self.mru = self.mru[-10:]
+ if tag not in self.ignore:
+ if self.idx < -1:
+ self.mru = self.mru[:self.idx + 1]
+ self.idx = -1
+ if self.mru and datetime.now() - self.lastselect < timedelta(seconds=.5):
+ self.mru[self.idx] = tag
+ elif tag != self.mru[-1]:
+ self.mru.append(tag)
+ self.mru = self.mru[-10:]
+ self.lastselect = datetime.now()
return
- self.idx = min(-1, max(-len(self.mru), self.idx))
+ self.idx = constrain(-len(self.mru), -1, self.idx)
wmii['view'] = self.mru[self.idx]
# vim:se sts=4 sw=4 et:
diff -r 141755859b1a -r f5295cc0d4bc cmd/menu/keys.txt
--- a/cmd/menu/keys.txt Fri May 29 18:54:38 2009 -0400
+++ b/cmd/menu/keys.txt Thu Jun 11 19:46:01 2009 -0400
@@ -5,8 +5,8 @@
Control-Shift-m Accept literal
Shift-Return Accept literal
-Escape Reject
-Control-[ Reject
+Escape Reject
+Control-Bracketleft Reject
Left Backward char
Control-b Backward char
diff -r 141755859b1a -r f5295cc0d4bc cmd/wmii/client.c
--- a/cmd/wmii/client.c Fri May 29 18:54:38 2009 -0400
+++ b/cmd/wmii/client.c Thu Jun 11 19:46:01 2009 -0400
@@ -634,6 +634,7 @@
char *cfrom, *cnot;
Frame *f, *ff;
Area *a;
+ int s;
if(urgent == Toggle)
urgent = c->urgent ^ On;
@@ -651,9 +652,8 @@
for(f=c->frame; f; f=f->cnext) {
SET(ff);
if(!urgent)
- for(a=f->view->floating; a; a=a->next)
- for(ff=a->frame; ff; ff=ff->anext)
- if(ff->client->urgent) break;
+ foreach_frame(f->view, s, a, ff)
+ if(ff->client->urgent) break;
if(urgent || ff == nil)
event("%sUrgentTag %s %s\n",
cnot, cfrom, f->view->name);
diff -r 141755859b1a -r f5295cc0d4bc cmd/wmii/key.c
--- a/cmd/wmii/key.c Fri May 29 18:54:38 2009 -0400
+++ b/cmd/wmii/key.c Thu Jun 11 19:46:01 2009 -0400
@@ -211,7 +211,6 @@
flushevents(FocusChangeMask, true);
kpress_seq(w, found);
XUngrabKeyboard(display, CurrentTime);
- sync();
}
}
@@ -241,6 +240,5 @@
if((k = getkey(l)))
grabkey(k);
}
- sync();
}
diff -r 141755859b1a -r f5295cc0d4bc mk/common.mk
--- a/mk/common.mk Fri May 29 18:54:38 2009 -0400
+++ b/mk/common.mk Thu Jun 11 19:46:01 2009 -0400
@@ -13,8 +13,16 @@
echo CLEANDEP
rm .depend 2>/dev/null || true
+tags:
+ files=; \
+ for f in $(OBJ); do \
+ [ -f "$$f.c" ] && files="$$files $$f.c"; \
+ done; \
+ echo CTAGS $$files $(TAGFILES) || \
+ ctags $$files $(TAGFILES)
+
DEP:=${shell if test -f .depend;then echo .depend;else echo /dev/null; fi}
DEP!=echo /dev/null
include $(DEP)
-.PHONY: all options clean dist install uninstall depend cleandep
+.PHONY: all options clean dist install uninstall depend cleandep tags
diff -r 141755859b1a -r f5295cc0d4bc mk/hdr.mk
--- a/mk/hdr.mk Fri May 29 18:54:38 2009 -0400
+++ b/mk/hdr.mk Thu Jun 11 19:46:01 2009 -0400
@@ -6,6 +6,8 @@
LINKSO= LD="$(LD)" LDFLAGS="$(SOLDFLAGS) $(SHARED) $$(pkg-config --libs $(PACKAGES))" $(ROOT)/util/link
CLEANNAME=$(ROOT)/util/cleanname
SOEXT=so
+TAGFILES=
+CTAGS=ctags
PACKAGES = 2>/dev/null
Received on Thu Jun 11 2009 - 23:46:06 UTC
This archive was generated by hypermail 2.2.0 : Thu Jun 11 2009 - 23:48:04 UTC