-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch redundant sleep/wake commands, and notify the user that Talon is already in the requested mode #1327
Merged
knausj85
merged 15 commits into
talonhub:main
from
SkepticMystic:catch-redundant-sleep-wake
Apr 6, 2024
Merged
Catch redundant sleep/wake commands, and notify the user that Talon is already in the requested mode #1327
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
89641a0
Catch redundant sleep/wake commands, and notify the user that Talon i…
SkepticMystic 3eb5560
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2471d08
Merge new commands in core/modes/modes.talon
SkepticMystic ee5e271
Merge new commands in core/modes/sleep_mode.talon
SkepticMystic d7d782a
Use better terminology in new comments in core/modes/modes.talon
SkepticMystic a458e49
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c823480
Clarify comment in core/modes/modes.talon
SkepticMystic d86e351
Capitalise app.notify message
SkepticMystic 90ead5c
Capitalise app.notify message
SkepticMystic 28d7966
Move all sleep and wake commands ino common files
knausj85 698a3b5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 238a5cc
Merge branch 'talonhub:main' into catch-redundant-sleep-wake
SkepticMystic 749bff2
fix comment about phrase
knausj85 5406ef2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 74b28e8
use not mode: sleep
knausj85 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
mode: sleep | ||
not mode: sleep | ||
not speech.engine: dragon | ||
- | ||
# The optional <phrase> afterwards allows these to match even if you say arbitrary text | ||
# after this command, without having to wait for the speech timeout. | ||
|
||
# This is handy because you often need to put Talon asleep in order to immediately | ||
# talk to humans, and it's annoying to have to say "sleep all", wait for the timeout, | ||
# and then resume your conversation. | ||
|
||
# With this, you can say "sleep all hey bob" and Talon will immediately go to | ||
# sleep and ignore "hey bob". Note that subtitles will show "sleep all hey bob", | ||
# because it's part of the rule definition, but "hey bob" will be ignored, because | ||
# we don't do anything with the <phrase> in the body of the command. | ||
|
||
^talon wake [<phrase>]$: speech.enable() | ||
|
||
# We define this *only* if the speech engine isn't Dragon, because if you're using Dragon, | ||
# "wake up" is used to specifically control Dragon, and not affect Talon. | ||
# | ||
# It's a useful and well known command, though, so if you're using any other speech | ||
# engine, this controls Talon. | ||
^(wake up)+$: speech.enable() | ||
pokey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# We define this *only* if the speech engine isn't Dragon, because if you're using Dragon, | ||
# "go to sleep" is used to specifically control Dragon, and not affect Talon. | ||
# | ||
# It's a useful and well known command, though, so if you're using any other speech | ||
# engine, this controls Talon. | ||
^go to sleep [<phrase>]$: speech.disable() | ||
^talon sleep [<phrase>]$: speech.disable() | ||
|
||
^sleep all [<phrase>]$: | ||
user.switcher_hide_running() | ||
user.history_disable() | ||
user.homophones_hide() | ||
user.help_hide() | ||
user.mouse_sleep() | ||
speech.disable() | ||
user.engine_sleep() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,5 +34,3 @@ settings(): | |
user.mouse_wake() | ||
user.history_enable() | ||
user.talon_mode() | ||
|
||
^(talon wake)+$: speech.enable() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this saying "mode sleep or not mode sleep"? That is always true, right? Can't we just remove both of these lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without any modes specified, a talon file will be implicitly in command mode only. I don't think there's another way to accomplish this other than mode: all, which would be coming full circle