'Get pickled state for restarting qtile'

def cmd_get_state(self):

    buf = io.BytesIO()
    pickle.dump(QtileState(self), buf, protocol=0)
    state = buf.getvalue().decode()
    logger.info('State    =    ')
    logger.info(''.join(state.split('\n')))
    return state
