def simple_key_binder(mod, keynames=None):
 def func(dgroup):
  for key in dgroup.keys[:]:
   dgroup.qtile.unmapKey(key)
   dgroup.keys.remove(key)
  if keynames:
   keys = keynames
  else:
   keys = list(map(str, (list(range(1, 10)) + [0])))
  for (keyname, group) in zip(keys, dgroup.qtile.groups):
   name = group.name
   key = Key([mod], keyname, lazy.group[name].toscreen())
   key_s = Key([mod, 'shift'], keyname, lazy.window.togroup(name))
   key_c = Key([mod, 'control'], keyname, lazy.group.switch_groups(name))
   dgroup.keys.append(key)
   dgroup.keys.append(key_s)
   dgroup.keys.append(key_c)
   dgroup.qtile.mapKey(key)
   dgroup.qtile.mapKey(key_s)
   dgroup.qtile.mapKey(key_c)
 return func

def simple_key_binder ( mod , keynames = None ) : def func ( dgroup ) : for key in dgroup . keys [ : ] : dgroup . qtile . unmapKey ( key ) dgroup . keys . remove ( key ) if keynames : keys = keynames else : keys = list ( map ( str , ( list ( range ( 1 , 10 ) ) + [ 0 ] ) ) ) for ( keyname , group ) in zip ( keys , dgroup . qtile . groups ) : name = group . name key = Key ( [ mod ] , keyname , lazy . group [ name ] . toscreen ( ) ) key_s = Key ( [ mod , 'shift' ] , keyname , lazy . window . togroup ( name ) ) key_c = Key ( [ mod , 'control' ] , keyname , lazy . group . switch_groups ( name ) ) dgroup . keys . append ( key ) dgroup . keys . append ( key_s ) dgroup . keys . append ( key_c ) dgroup . qtile . mapKey ( key ) dgroup . qtile . mapKey ( key_s ) dgroup . qtile . mapKey ( key_c ) return func
bind keys to mod+group position or to the keys specified as second argument .