Skip to content

Instantly share code, notes, and snippets.

@rntz
Last active January 23, 2021 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rntz/2d66fd4adca308b3c3ea05686c1e011a to your computer and use it in GitHub Desktop.
Save rntz/2d66fd4adca308b3c3ea05686c1e011a to your computer and use it in GitHub Desktop.
sleep or wake
@mod.action_class
class Actions:
def welcome_back():
"Wakes talon up."
logging.info("Waking Talon up.")
actions.user.mouse_wake()
actions.user.history_enable()
actions.user.talon_mode()
def sleep_all():
"Sends talon to sleep."
logging.info("Sending Talon to sleep.")
actions.user.switcher_hide_running()
actions.user.history_disable()
actions.user.homophones_hide()
actions.user.help_hide()
actions.user.mouse_sleep()
actions.speech.disable()
#actions.user.engine_sleep()
def sleep_or_wake():
"Sleeps talon if it is waking or wakes it if it is sleeping."
if actions.speech.enabled():
actions.user.sleep_all()
else:
actions.user.welcome_back()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment