mirror of
https://github.com/0intro/wmii
synced 2024-11-22 05:42:05 +03:00
Allow client to follow tag change in python wmiirc.
This commit is contained in:
parent
5c506656f5
commit
ea79a8c1b9
@ -575,7 +575,17 @@ class Tags(object):
|
||||
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 @@ class Tags(object):
|
||||
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 @@ class Tags(object):
|
||||
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:
|
||||
|
@ -227,10 +227,20 @@ keys.bind('main', (
|
||||
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', (
|
||||
|
Loading…
Reference in New Issue
Block a user