-
Notifications
You must be signed in to change notification settings - Fork 780
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Talon v0.4 support: common commands for talon python / talon files / …
….talon-list files (#1240) Splitting #1234 into a few pull requests for convenience. This is not fully vetted yet, opening a draft for convenience and initial discussion. - Support for common commands when composing talon-list, .talon, and talon .py - Support for the talon debug window, with commands consistent with other existing commands --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nicholas Riley <com-github@sabi.net>
- Loading branch information
1 parent
1464ace
commit 4c1c9af
Showing
12 changed files
with
168 additions
and
53 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# this functionality is only available in the talon beta | ||
from talon import Module | ||
|
||
mod = Module() | ||
mod.apps.talon_debug_window = """ | ||
os: mac | ||
and app.bundle: com.talonvoice.Talon | ||
win.title: Talon Debug | ||
""" | ||
mod.apps.talon_debug_window = """ | ||
os: windows | ||
and app.name: Talon | ||
os: windows | ||
and app.exe: talon.exe | ||
win.title: Talon Debug | ||
""" |
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,24 @@ | ||
# this functionality is only available in the talon beta | ||
# note: these commands are only useful when the search box is focused | ||
app: talon_debug_window | ||
- | ||
# uncomment user.talon_populate_lists tag to activate talon-specific lists of actions, scopes, modes etcetera. | ||
# Do not enable this tag with dragon, as it will be unusable. | ||
# with conformer, the latency increase may also be unacceptable depending on your cpu | ||
# see https://github.com/talonhub/community/issues/600 | ||
# tag(): user.talon_populate_lists | ||
|
||
tag {user.talon_tags}: "{talon_tags}" | ||
|
||
#commands for dictating key combos | ||
key <user.keys> over: "{keys}" | ||
key <user.modifiers> over: "{modifiers}" | ||
|
||
action {user.talon_actions}: "{talon_actions}" | ||
# requires user.talon_populate_lists tag. do not use with dragon | ||
list {user.talon_lists}: "{talon_lists}" | ||
|
||
# requires user.talon_populate_lists tag. do not use with dragon | ||
capture {user.talon_captures}: "{talon_captures}" | ||
set {user.talon_settings}: "{talon_settings}" | ||
application {user.talon_apps}: "{talon_apps}" |
File renamed without changes.
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,5 @@ | ||
code.language: talonlist | ||
- | ||
# requires user.talon_populate_lists tag. do not use with dragon | ||
list [require] {user.talon_lists}: "list: {talon_lists}" | ||
list [require]: "list: " |
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,7 @@ | ||
list: user.code_common_function | ||
code.language: talon | ||
- | ||
insert | ||
key | ||
repeat |
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,22 @@ | ||
#Defines commands common to both python and talon files | ||
code.language: talon | ||
code.language: python | ||
and tag: user.talon_python | ||
- | ||
tag set [{user.talon_tags}]: | ||
tag = talon_tags or "" | ||
user.talon_code_enable_tag(tag) | ||
|
||
# requires user.talon_populate_lists tag. do not use with dragon | ||
list {user.talon_lists}: "{{{talon_lists}}}" | ||
# requires user.talon_populate_lists tag. do not use with dragon | ||
capture {user.talon_captures}: "<{talon_captures}>" | ||
|
||
setting {user.talon_settings}: user.talon_code_enable_setting(talon_settings) | ||
|
||
#commands for dictating key combos | ||
key <user.keys> over: "{keys}" | ||
key <user.modifiers> over: "{modifiers}" | ||
|
||
action {user.talon_actions}: | ||
user.talon_code_insert_action_call(talon_actions, edit.selected_text()) |
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,22 @@ | ||
code.language: talon | ||
code.language: talonlist | ||
code.language: python | ||
and tag: user.talon_python | ||
- | ||
#context requirements | ||
win require: insert("os: windows\n") | ||
mac require: insert("os: mac\n") | ||
linux require: insert("os: linux\n") | ||
title require: insert("win.title: ") | ||
application [require] [{user.talon_apps}]: | ||
app = "{talon_apps}\n" or "" | ||
insert("app: {app}") | ||
mode require [{user.talon_modes}]: | ||
mode = "{talon_modes}\n" or "" | ||
insert("mode: {mode}") | ||
tag require [{user.talon_tags}]: | ||
tag = "{talon_tags}\n" or "" | ||
insert("tag: {tag}") | ||
host require: | ||
hostname = user.talon_get_hostname() | ||
insert("hostname: {hostname}\n") |
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,14 @@ | ||
# This file activates talon-specific python commands | ||
# by default, it simply looks for the python tag to be active | ||
# lines 7-11 provide examples to make the activation more specific | ||
# which may be preferred by people who code in other python projects | ||
# app: vscode | ||
# Mac VSCode uses an em-dash | ||
# win.title: /— user/ | ||
# win.title: /— community/ | ||
# windows VSCode uses an en-dash | ||
# win.title: / - user - Visual Studio Code/ | ||
# win.title: / - community - Visual Studio Code/ | ||
code.language: python | ||
- | ||
tag(): user.talon_python |