Skip to content

Instantly share code, notes, and snippets.

@OKsign
Created October 13, 2019 07:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OKsign/720472d30ff5fcab1dd6ba86c27836a3 to your computer and use it in GitHub Desktop.
Save OKsign/720472d30ff5fcab1dd6ba86c27836a3 to your computer and use it in GitHub Desktop.
# 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