[hackers] [wmii] Allow client to follow tag change in python wmiirc. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Sun, 11 Oct 2009 09:36:09 +0000 (UTC)

changeset: 2523:7f5efccf6aee
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Oct 09 16:40:33 2009 -0400
files: alternative_wmiircs/python/pygmi/fs.py alternative_wmiircs/python/wmiirc.py
description:
Allow client to follow tag change in python wmiirc.

diff -r 08961b5d8662 -r 7f5efccf6aee alternative_wmiircs/python/pygmi/fs.py
--- a/alternative_wmiircs/python/pygmi/fs.py Fri Oct 09 16:40:33 2009 -0400
+++ b/alternative_wmiircs/python/pygmi/fs.py Fri Oct 09 16:40:33 2009 -0400
@@ -575,7 +575,17 @@
                 return tags[i+1]
         return self.sel
 
- def select(self, tag):
+ def select(self, tag, take_client=None):
+ def goto(tag):
+ if take_client:
+ sel = Tag('sel').id
+ take_client.tags = '+%s' % tag
+ wmii['view'] = tag
+ if tag != sel:
+ take_client.tags = '-%s' % sel
+ else:
+ wmii['view'] = tag
+
         if tag is self.PREV:
             if self.sel.id not in self.ignore:
                 self.idx -= 1
@@ -584,7 +594,7 @@
         else:
             if isinstance(tag, Tag):
                 tag = tag.id
- wmii['view'] = tag
+ goto(tag)
 
             if tag not in self.ignore:
                 if self.idx < -1:
@@ -599,6 +609,6 @@
             return
 
         self.idx = constrain(-len(self.mru), -1, self.idx)
- wmii['view'] = self.mru[self.idx]
+ goto(self.mru[self.idx])
 
 # vim:se sts=4 sw=4 et:
diff -r 08961b5d8662 -r 7f5efccf6aee alternative_wmiircs/python/wmiirc.py
--- a/alternative_wmiircs/python/wmiirc.py Fri Oct 09 16:40:33 2009 -0400
+++ b/alternative_wmiircs/python/wmiirc.py Fri Oct 09 16:40:33 2009 -0400
@@ -227,10 +227,20 @@
         lambda k: tags.select(tags.next())),
     ('%(mod)s-b', "Move to the view to the right",
         lambda k: tags.select(tags.next(True))),
+ ('%(mod)s-Shift-n', "Move to the view to the left, take along current client",
+ lambda k: tags.select(tags.next(), take_client=Client('sel'))),
+ ('%(mod)s-Shift-b', "Move to the view to the right, take along current client",
+ lambda k: tags.select(tags.next(True), take_client=Client('sel'))),
+
     ('%(mod)s-i', "Move to the newer tag in the tag stack",
         lambda k: tags.select(tags.NEXT)),
     ('%(mod)s-o', "Move to the older tag in the tag stack",
         lambda k: tags.select(tags.PREV)),
+ ('%(mod)s-Shift-i', "Move to the newer tag in the tag stack, take along current client",
+ lambda k: tags.select(tags.NEXT, take_client=Client('sel'))),
+ ('%(mod)s-Shift-o', "Move to the older tag in the tag stack, take along current client",
+ lambda k: tags.select(tags.PREV, take_client=Client('sel'))),
+
 ))
 def bind_num(i):
     keys.bind('main', (
Received on Sun Oct 11 2009 - 09:36:09 UTC

This archive was generated by hypermail 2.2.0 : Sun Oct 11 2009 - 09:48:15 UTC