def __init__(self, name='volume', colors=None, channel='Master', device=None): self.channel = channel self.device = device self.button = Button('right', name, colors) keys.bind('main', ( "Volume control", ('XF86AudioMute', "Toggle mute volume", lambda k: self.toggle()), ('XF86AudioRaiseVolume', "Raise the volume", lambda k: self.up()), ('XF86AudioLowerVolume', "Lower the volume", lambda k: self.down()), )) def click_event(button): return Match('RightBarClick', button, self.button.real_name) events.bind({ click_event('1'): lambda *a: self.toggle(), click_event('3'): lambda *a: self.set_using_menu(), click_event('4'): lambda *a: self.up(), click_event('5'): lambda *a: self.down() }) self.refresh()
def registerKeyBindings(): from pygmi import keys keys.bind('main', ( "Screen Locking", ('Mod4-grave', "Lock Screen Now", lambda k: locknow()), ('Mod4-shift-grave', "Toggle automatic locking", lambda k: toggleAutoLock()), ))
def addresize(mod, desc, cmd, *args): keys.bind('main', ("Quick Resize", (mod + '%(left)s', "%s selected client to the left" % desc, lambda k: Tag('sel').ctl(cmd, 'sel sel', 'left', *args)), (mod + '%(right)s', "%s selected client to the right" % desc, lambda k: Tag('sel').ctl(cmd, 'sel sel', 'right', *args)), (mod + '%(up)s', "%s selected client up" % desc, lambda k: Tag('sel').ctl(cmd, 'sel sel', 'up', *args)), (mod + '%(down)s', "%s selected client down" % desc, lambda k: Tag('sel').ctl(cmd, 'sel sel', 'down', *args)), ))
def register_corner_resize_keys(): keys.bind('main', ("Quick Resize", ('%(mod)s-Control-%(left)s', "Shrink from right", lambda k: Tag('sel').ctl('grow', 'sel sel', 'right', '-1')), ('%(mod)s-Control-%(right)s', "Grow to right", lambda k: Tag('sel').ctl('grow', 'sel sel', 'right')), ('%(mod)s-Control-%(up)s', "Shrink from bottom", lambda k: Tag('sel').ctl('grow', 'sel sel', 'down', '-1')), ('%(mod)s-Control-%(down)s', "Grow to bottom", lambda k: Tag('sel').ctl('grow', 'sel sel', 'down')), ('%(mod)s-Control-Shift-%(left)s', "Grow to left", lambda k: Tag('sel').ctl('grow', 'sel sel', 'left')), ('%(mod)s-Control-Shift-%(right)s', "Shrink from left", lambda k: Tag('sel').ctl('grow', 'sel sel', 'left', '-1')), ('%(mod)s-Control-Shift-%(up)s', "Grow to top", lambda k: Tag('sel').ctl('grow', 'sel sel', 'up')), ('%(mod)s-Control-Shift-%(down)s', "Shrink from up", lambda k: Tag('sel').ctl('grow', 'sel sel', 'up', '-1')), ));
def register_swapped_resize_keys(): keys.bind('main', ("Quick Resize", ('%(mod)s-Control-%(left)s', "Grow selected client to the left", lambda k: Tag('sel').ctl('grow', 'sel sel', 'left')), ('%(mod)s-Control-%(right)s', "Grow selected client to the right", lambda k: Tag('sel').ctl('grow', 'sel sel', 'right')), ('%(mod)s-Control-%(up)s', "Grow selected client up", lambda k: Tag('sel').ctl('grow', 'sel sel', 'up')), ('%(mod)s-Control-%(down)s', "Grow selected client down", lambda k: Tag('sel').ctl('grow', 'sel sel', 'down')), ('%(mod)s-Control-Shift-%(left)s', "Shrink selected client to the right", lambda k: Tag('sel').ctl('grow', 'sel sel', 'right', '-1')), ('%(mod)s-Control-Shift-%(right)s', "Shrink selected client to the left", lambda k: Tag('sel').ctl('grow', 'sel sel', 'left', '-1')), ('%(mod)s-Control-Shift-%(up)s', "Shrink selected client down", lambda k: Tag('sel').ctl('grow', 'sel sel', 'down', '-1')), ('%(mod)s-Control-Shift-%(down)s', "Shrink selected client up", lambda k: Tag('sel').ctl('grow', 'sel sel', 'up', '-1')), ))