Hi Étienne,
The `load` action can be used to switch phrases or pause numen. These commands
will pause and unpause numen:
$ echo load | numenc
...
$ echo load /etc/numen/phrases/*.phrases | numenc
And you could of course have these run on keyboard shortcuts.
Glad you're liking numen :)
John
Hi John,
Thanks John, I missed this in the man. I created a "numctl" script with
notify-send to have a visual feedback of numen status, bound to a
shortcut. That's perfect.
Regards,
Étienne
Hi John!
I wanted to pause/unpause by voice, so I added a "hibernate" command to the list of default phrases and a separate file with only the word "initialize" to have as only available command when in "hibernate mode":
# /etc/numen/phrases/hibernate.phrases (or simply as addition to voice.phrases)
hibernate: run echo load /etc/numen/phrases/initialize.word | numenc & \
run notify-send -u low -i ✖️ "✖️ Voice commands paused"
# /etc/numen/phrases/initialize.word (different suffix so it won't be loaded by `load *.phrases`)
initialize: run echo load /etc/numen/phrases/*.phrases | numenc & \
run notify-send -u low -i 👂 "👂 Voice commands activated"
There's an issue with "initialize" though:
Apparently Numen selects the best match and, well, when there's only one word registered it will always be the "best" match - even for "plex yank".
As a workaround I am thinking of loading the default phrases with all commands emptied, but maybe there's a better way?
Could this be solved by activating some sort of strict(er) matching for cases like this?
Numen rocks!
f
Hi f!
You're right, Numen currently selects the best match.
Pretty recently I made a git branch called "unk" for people that were
trying to use Numen like a virtual assistant. It should abort unkown
phrases, which you can see using: --phraselog=/dev/stderr
If you'd like to try it: git pull && git switch unk
and reinstall numen: ./build.sh && sudo ./build.sh install
It will probably be next year before I get round to bringing it into
the master branch.
Other than that, you could try, maybe in addition, something hacky with
multiple phrases and environment variables:
please: set a echo 1
wake: eval [ "$a" ] && echo set b echo 1
up: run [ "$b" ] && echo hello
<complete>: set a : \
set b :
similar to having a phrase, "please wake up", but without giving a hint
of the order of the words to the speech recognition. Untested though.
Hope something's of use,
John
Hi!
The hack is actually not that ugly and works pretty well!
I've implemented both variants:
One without the sequencing-hack, where "initialize" activates the full
set of commands and another where the "wake up now" sequence triggers it.
I'm attaching the files in case anyone's interested:
One can decide which variant to use by simply setting the corresponding
file in "hibernate.phrases".
Feel free to include this in Numen if you consider it a good fit for the
general audience.
Another thing: I was looking for ways to DRY the commands up without
having to use external scripts. Are there any tricks to define something
like macros?
Best,
f