def test_execute_cmd(): bak_primary = cb.read_primary() # text = 'arbitrary text' cb.to_primary(text) assert cb.read_primary() == text process.execute_cmd('xsel -pc') # clear primary assert cb.read_primary() == '' # cb.to_primary(bak_primary)
def clear_clipboard(): """Clear clipboard.""" process.execute_cmd('xsel -bc')
def clear_primary(): """Clear primary.""" process.execute_cmd('xsel -pc')