-
Hi,
but I guess I added it to the wrong file (core/modes.py) or maybe this approach is wrong at all. I'm not very familiar with python so please bear with me. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Managed to get this working, so I post it as answer, just in case one would like to add this too. I' using Added from talon import Module, app, actions
import os
mod = Module()
@mod.action_class
class Actions:
def tts_enabled():
"""Sends tts listening"""
os.system("mimic -t 'listening' -voice slt_hts")
app.notify(body="Talon listening")
def tts_disabled():
"""Sends tts talon disabled"""
os.system("mimic -t 'sleeping' -voice slt_hts")
app.notify(body="Talon sleeping")
def talon_quit():
"""Exits talon and sends tts exit message"""
os.system("mimic -t 'exiting' -voice slt_hts")
app.notify(body="Talon exiting")
os.system("killall talon")
def talon_status():
"""Sends tts talon status"""
if actions.speech.enabled():
os.system("mimic -t 'listening' -voice slt_hts")
app.notify(body="Talon listening")
else:
os.system("mimic -t 'sleeping' -voice slt_hts")
app.notify(body="Talon sleeping") Modified the ^talon sleep [<phrase>]$:
user.tts_disabled()
speech.disable()
^talon wake$:
user.tts_enabled()
speech.enable()
^talon status$:
user.talon_status()
^talon exit$:
user.talon_quit()
^talon quit$:
user.talon_quit()
^talon close$:
user.talon_quit() New commands are |
Beta Was this translation helpful? Give feedback.
Managed to get this working, so I post it as answer, just in case one would like to add this too.
I' using
mimic
for text-to-speech output, so make sure this is installed or modify to use your preferred engine.Added
~/.talon/user/tts.py
which handles the text-to-speech output and display app notifications as well.