Created
October 13, 2019 07:22
-
-
Save OKsign/720472d30ff5fcab1dd6ba86c27836a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app: Xdotool | |
# user input | |
direction = 'down' # 'up' or 'down' or 'left' or 'right' | |
# end of user input | |
time.sleep(1) | |
system.exec_command("xdotool key space") | |
time.sleep(1) | |
activeApp = window.get_active_class() | |
if activeApp == 'nemo.Nemo' or activeApp == 'nemo-desktop.Nemo-desktop': | |
if direction == 'up': | |
system.exec_command("xdotool key Up") | |
time.sleep(0.7) | |
system.exec_command("xdotool key space") | |
quit() | |
if direction == 'down': | |
system.exec_command("xdotool key Down") | |
time.sleep(.7) | |
system.exec_command("xdotool key space") | |
quit() | |
if direction == 'right': | |
system.exec_command("xdotool key Right") | |
time.sleep(.7) | |
system.exec_command("xdotool key space") | |
quit() | |
if direction == 'left': | |
system.exec_command("xdotool key Left") | |
time.sleep(.7) | |
system.exec_command("xdotool key space") | |
quit() | |
else: | |
time.sleep(1.5) | |
activeApp = window.get_active_class() | |
if activeApp == 'nemo.Nemo' or activeApp == 'nemo-desktop.Nemo-desktop': | |
if direction == 'up': | |
system.exec_command("xdotool key Up") | |
time.sleep(0.7) | |
system.exec_command("xdotool key space") | |
quit() | |
if direction == 'down': | |
system.exec_command("xdotool key Down") | |
time.sleep(.7) | |
system.exec_command("xdotool key space") | |
quit() | |
if direction == 'right': | |
system.exec_command("xdotool key Right") | |
time.sleep(.7) | |
system.exec_command("xdotool key space") | |
quit() | |
if direction == 'left': | |
system.exec_command("xdotool key Left") | |
time.sleep(.7) | |
system.exec_command("xdotool key space") | |
quit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment