Skip to content

Commit 2ed4ce9

Browse files
authored
Clarify and correct grammar and spelling
I thought the phrase "paste this code into the terminal window" would be clearer if it instead said "talon console" because it specifies which terminal to use. I also noticed several grammatical and spelling errors which were simple to fix while I was here.
1 parent 1b32612 commit 2ed4ce9

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/Customization/basic_customization.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ So why do we have two kinds of configuration/scripting files (`.py` and `.talon`
1414

1515
- `.talon` files provide a succinct way of mapping spoken commands to behaviour. `.talon` files are written in a language that is only used by Talon.
1616
- `.talon` files are designed to be simple and to provide good feedback if you make mistakes.
17-
- `.py` files are Python scripts which provide the implementation of behaviour and other functionality used by `.talon` files.
17+
- `.py` files are Python scripts that provide the implementation of behaviour and other functionality used by `.talon` files.
1818
- You do not need to customize Python or know how to code to use Talon
1919

2020
## Managing your customizations
2121

2222
Talon is built to be a flexible and customizable system. This means that in addition to being able to add new voice commands you can also override the behavior of existing commands reasonably easily.
2323

24-
Given this flexibility there are two ways you could approach customizing your Talon setup:
24+
Given this flexibility, there are two ways you could approach customizing your Talon setup:
2525

2626
- Option A: Edit the `.talon` and `.py` files from the [Talon Community](https://github.com/talonhub/community) directly.
2727
- Can be easier to begin with, but may be difficult to keep up-to-date with upstream.
2828
- You need to work out what you modified and how to re-apply it to the [Talon Community](https://github.com/talonhub/community) user file set every time you update it.
2929
- Option B: Maintain your own separate directory with your customizations that sits alongside the [Talon Community](https://github.com/talonhub/community). (**Recommended**)
30-
- The screenshot below shows a Talon user directory with multiple user file sets. The `community` directory contains the [Talon Community](https://github.com/talonhub/community) unchanged from the version on Github. The rest of the folders are other file sets that supplement the Talon Community file set.
30+
- The screenshot below shows a Talon user directory with multiple user file sets. The `community` directory contains the [Talon Community](https://github.com/talonhub/community) unchanged from the version on GitHub. The rest of the folders are other file sets that supplement the Talon Community file set.
3131
- For example, `my_talon` contains personal customizations, and `curserless-talon` contains the [Cursorless](https://github.com/cursorless-dev/cursorless).
3232

3333
![Screen shot of Talon user directory](/img/talon_user_folders.png)
@@ -40,7 +40,7 @@ You will probably want to update your Talon Community user file set occasionally
4040

4141
Let's make a new voice command that presses the key combination `cmd+a` or `control+a` when you say "select everything".
4242

43-
Open up a text editor and save an empty file called `simple_test.talon` somewhere in your Talon user directory. Next, right click on the Talon icon in your status bar, choose scripting, and then 'View log'. This will show a list of log messages from Talon, and in particular will be where Talon tells us if there's a problem with what we write in `simple_test.talon`.
43+
Open up a text editor and save an empty file called `simple_test.talon` somewhere in your Talon user directory. Next, right-click on the Talon icon in your status bar, choose 'Scripting', and then 'View log'. This will show a list of log messages from Talon, and in particular, will be where Talon tells us if there's a problem with what we write in `simple_test.talon`.
4444

4545
OK, let's get to defining the command. If you're running MacOS, copy/paste the following into your editor and save the file (ensure you have the spaces at the start of the 'key' line):
4646

@@ -56,7 +56,7 @@ select everything:
5656
key(ctrl-a)
5757
```
5858

59-
You should see a line like `2021-09-02 17:33:36 DEBUG [+] /home/normal/.talon/user/mystuff/simple_test.talon` printed in your Talon log. This indicates that Talon has picked up your new/updated file and has loaded it. In general Talon will automatically pick up and apply any changes to `.talon` or `.py` files in your Talon user directory, so you don't have to restart Talon each time you make a change. If you don't see a line like that and can't figure it out, then you might want to ask for help on the [Talon slack](https://talonvoice.com/chat) in the #help channel.
59+
You should see a line like `2021-09-02 17:33:36 DEBUG [+] /home/normal/.talon/user/mystuff/simple_test.talon` printed in your Talon log. This indicates that Talon has picked up your new/updated file and has loaded it. In general, Talon will automatically pick up and apply any changes to `.talon` or `.py` files in your Talon user directory, so you don't have to restart Talon each time you make a change. If you don't see a line like that and can't figure it out, then you might want to ask for help on the [Talon slack](https://talonvoice.com/chat) in the #help channel.
6060

6161
Your command should now be defined, so if you focus your text editor and say "select everything" it should indeed select everything.
6262

@@ -150,7 +150,7 @@ The part above the '-' line is called the "context header" and the part below is
150150

151151
The context header defines when the rest of the file will be active.
152152

153-
In this example our context header says that the file is only active when the word 'Gmail' is in the window title. The context header is optional; if it is not included (as in our simple_test.talon example) then the file is always active.
153+
In this example, our context header says that the file is only active when the word 'Gmail' is in the window title. The context header is optional; if it is not included (as in our simple_test.talon example) then the file is always active.
154154

155155
### Body
156156

@@ -162,9 +162,9 @@ Voice commands start with the actual words you want to speak followed by a ':' c
162162

163163
You might have noticed that we've been using the key() and insert() actions in the example files so far. There are a number of built in actions, and extra actions can be defined in `.py` files. To get a complete list of defined actions you can do the following:
164164

165-
1. Right click on the Talon icon in your status bar, choose scripting, and then 'Console (REPL)'. This will open a terminal window where you type Python commands and the result of those commands are printed out.
165+
1. Right click on the Talon icon in your status bar, choose scripting, and then 'Console (REPL)'. This will open a terminal window where you type Python commands and the results of those commands are printed out.
166166
2. Type `actions.list()` and press enter. This will list out all the available actions.
167-
3. You might like to look at this list of actions in your text editor (so you can search them, for example). To put the full list into your clipboard, copy and paste this code into the terminal window and press enter:
167+
3. You might like to look at this list of actions in your text editor (so you can search them, for example). To put the full list into your clipboard, copy and paste this code into the talon console and press enter:
168168

169169
```python
170170
import io;old=sys.stdout;sys.stdout = io.StringIO();actions.list();clip.set_text(sys.stdout.getvalue());sys.stdout = old
@@ -185,7 +185,7 @@ If you've read the above you should have some idea of how to make customizations
185185

186186
### Add new keyboard shortcuts
187187

188-
Often you will want to add a new voice command to press an application specific keyboard shortcut. Let's choose the YouTube webpage as our example. The following `.talon` file defines two new voice commands:
188+
Often you will want to add a new voice command to press an application-specific keyboard shortcut. Let's choose the YouTube webpage as our example. The following `.talon` file defines two new voice commands:
189189

190190
```talon
191191
title: /YouTube/
@@ -220,7 +220,7 @@ Note the use of app.exe as the context matcher to match the filename of the acti
220220

221221
settings() blocks can be put in any `.talon` file and are used to change the value of settings given a matching context header. You can have multiple settings by putting each on its own indented line underneath the "settings():" line. You can include voice commands in the same file as a settings block.
222222

223-
You can paste the following code into the REPL to see a full list of available settings: `settings.list()`. A list of some of the more useful ones are [included here](../Customization/talon-files.md#tags-settings-and-other-capabilities). [Talon Community](https://github.com/talonhub/community) also has a list of some extra settings it defines in the `settings.talon` file.
223+
You can paste the following code into the REPL to see a full list of available settings: `settings.list()`. A list of some of the more useful ones is [included here](../Customization/talon-files.md#tags-settings-and-other-capabilities). [Talon Community](https://github.com/talonhub/community) also has a list of some extra settings it defines in the `settings.talon` file.
224224

225225
### Keyboard shortcuts
226226

@@ -234,21 +234,21 @@ The shortcut is global since there's no context matcher in this `.talon` file re
234234

235235
One thing that may not be immediately obvious is that re-using voice commands is perfectly acceptable. You can just create a new `.talon` file with a new context header and redefine the command.
236236

237-
This also provides a simple way of overriding the behaviour of existing voice commands from the [Talon Community](https://github.com/talonhub/community) user file set. Lets say you wanted to change the behaviour of the `touch` command so that it didn't hide the mouse grid if it was open.
237+
This also provides a simple way of overriding the behaviour of existing voice commands from the [Talon Community](https://github.com/talonhub/community) user file set. Let's say you wanted to change the behaviour of the `touch` command so that it didn't hide the mouse grid if it was open.
238238

239239
The existing code is in a `.talon` file without a context header called `mouse.talon`:
240240

241241
```talon
242242
touch:
243243
mouse_click(0)
244-
# close the mouse grid if open
244+
# Close the mouse grid if open
245245
user.grid_close()
246246
# End any open drags
247247
# Touch automatically ends left drags so this is for right drags specifically
248248
user.mouse_drag_end()
249249
```
250250

251-
We can see the `user.grid_close()` action is called to close the grid after clicking the mouse. Also note the lines starting with '#' characters are called comments. They are just there for documentation and will not be otherwise processed by Talon.
251+
We can see the `user.grid_close()` action is called to close the grid after clicking the mouse. Also, note the lines starting with '#' characters are called comments. They are just there for documentation and will not be otherwise processed by Talon.
252252

253253
If we wanted to stop the `user.grid_close()` behaviour we could just create a new `.talon` file and put in the following contents:
254254

@@ -262,8 +262,8 @@ touch:
262262
user.mouse_drag_end()
263263
```
264264

265-
Notice that we've given it a context header. Because this context headar is more specific (i.e. it has more rules in it) this implementation of "touch" will take precedence over the original. The implementation just has the `user.grid_close()` line and associated comment removed.
265+
Notice that we've given it a context header. Because this context header is more specific (i.e. it has more rules in it) this implementation of "touch" will take precedence over the original. The implementation just has the `user.grid_close()` line and associated comment removed.
266266

267-
In general you can use this technique by just making a version of the `.talon` file you want to override and putting in more redundant rules to make it the more specific version. In addition to "os: " some other redundant filters you can add are "mode: command" (assuming you want to define the command in the default 'command' mode) and "speech.engine: wav2letter" (assuming you're not using Dragon).
267+
In general, you can use this technique by just making a version of the `.talon` file you want to override and putting in more redundant rules to make it the more specific version. In addition to "os: " some other redundant filters you can add are "mode: command" (assuming you want to define the command in the default 'command' mode) and "speech.engine: wav2letter" (assuming you're not using Dragon).
268268

269269
This is a simple way of overriding voice commands using `.talon` files. Many other parts of the system (such as the behaviour of actions) can also be overridden, but this requires editing `.py` files.

0 commit comments

Comments
 (0)