~geb/numen

5 3

Pausing/unpausing numen

Étienne BERSAC <etienne.bersac@dalibo.com>
Details
Message ID
<55fe1488feeb1cee2627d61b9b7e16a74ef5fca0.camel@dalibo.com>
Sender timestamp
1688484135
DKIM signature
missing
Download raw message
Hi John,

Thanks for numen, its awesome !

Is it possible to pause/unpause numen ? Either from the voice or from a
shortcut ?

Regards,
Étienne
Details
Message ID
<CTTHFXW3H5PS.3CCBJXR1ZIJ8Q@localhost>
In-Reply-To
<55fe1488feeb1cee2627d61b9b7e16a74ef5fca0.camel@dalibo.com> (view parent)
Sender timestamp
1688487240
DKIM signature
missing
Download raw message
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
Étienne BERSAC <etienne.bersac@dalibo.com>
Details
Message ID
<06375fe7a8e2fa56a9922be38d733d466d9cfdd8.camel@dalibo.com>
In-Reply-To
<CTTHFXW3H5PS.3CCBJXR1ZIJ8Q@localhost> (view parent)
Sender timestamp
1688494624
DKIM signature
missing
Download raw message
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
Details
Message ID
<ZUYtG-HO4JiS7zDL@f>
In-Reply-To
<CTTHFXW3H5PS.3CCBJXR1ZIJ8Q@localhost> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<CWQ1POME5GNO.1LLY1OSMAO2X6@johngebbie.com>
In-Reply-To
<ZUYtG-HO4JiS7zDL@f> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<ZUZujIPycTLKICvH@f>
In-Reply-To
<CWQ1POME5GNO.1LLY1OSMAO2X6@johngebbie.com> (view parent)
DKIM signature
missing
Download raw message
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
Reply to thread Export thread (mbox)