def set_X_window_properties(win_id, **properties):
 import xcb, xcb.xproto
 conn = xcb.connect()
 atoms = {name: conn.core.InternAtom(False, len(name), name) for name in properties}
 utf8_string_atom = None
 for (name, val) in properties.iteritems():
  atom = atoms[name].reply().atom
  type_atom = xcb.xproto.Atom.STRING
  if isinstance(val, unicode):
   if (utf8_string_atom is None):
    utf8_string_atom = conn.core.InternAtom(True, len('UTF8_STRING'), 'UTF8_STRING').reply().atom
   type_atom = utf8_string_atom
   val = val.encode(u'utf-8')
  conn.core.ChangePropertyChecked(xcb.xproto.PropMode.Replace, win_id, atom, type_atom, 8, len(val), val)
 conn.flush()
 conn.disconnect()

def set_X_window_properties ( win_id , ** properties ) : import xcb , xcb . xproto conn = xcb . connect ( ) atoms = { name : conn . core . InternAtom ( False , len ( name ) , name ) for name in properties } utf8_string_atom = None for ( name , val ) in properties . iteritems ( ) : atom = atoms [ name ] . reply ( ) . atom type_atom = xcb . xproto . Atom . STRING if isinstance ( val , unicode ) : if ( utf8_string_atom is None ) : utf8_string_atom = conn . core . InternAtom ( True , len ( 'UTF8_STRING' ) , 'UTF8_STRING' ) . reply ( ) . atom type_atom = utf8_string_atom val = val . encode ( u'utf-8' ) conn . core . ChangePropertyChecked ( xcb . xproto . PropMode . Replace , win_id , atom , type_atom , 8 , len ( val ) , val ) conn . flush ( ) conn . disconnect ( )
set x window properties on the window with the specified id .