Skip to content

Commit

Permalink
Merge my main branch with knausj main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
pokey committed Apr 25, 2024
2 parents 17145e2 + 027d7d0 commit 4cf5872
Show file tree
Hide file tree
Showing 60 changed files with 918 additions and 159 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
minimum_pre_commit_version: "3.2.0"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -34,12 +34,12 @@ repos:
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.1.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: remove-tabs
types: [file]
Expand Down
6 changes: 5 additions & 1 deletion BREAKING_CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ applied given the delay between changes being submitted and the time they were r
and merged.

---
* 2023-06-06 Deprecate `go marks` command for VSCode. Use 'bar marks' instead.
* 2024-01-27 Deprecate '<user.number_string>' command without a spoken prefix like `numb`.
See `numbers.talon` and `numbers_unprefixed.talon.` If in the future you want to still use
unprefixed numbers, you will need to comment out the
`tag(): user.prefixed_numbers` line in your `settings.talon` file.
* 2023-06-06 Deprecate `go ` command for VSCode. Use 'bar marks' instead.
* 2023-02-04 Deprecate `murder` command for i3wm. Use 'win kill' instead.
* 2022-12-11 Deprecate user.insert_with_history. Just use `user.add_phrase_to_history(text);
insert(text)` instead. See #939.
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ https://github.com/talonhub/community/blob/main/core/text/text.talon#L8

### Mouse commands

See https://github.com/talonhub/community/blob/main/plugin/mouse/mouse.talon
See https://github.com/talonhub/community/blob/main/plugin/mouse/mouse.talon for commands to click, drag, scroll, and use an eye tracker. To use a grid to click at a certain location on the screen, see [mouse_grid](https://github.com/talonhub/community/tree/main/core/mouse_grid).

### Generic editing commands

Expand Down Expand Up @@ -245,6 +245,8 @@ tag(): user.tabs

For instance, kubectl commands (kubernetes) aren't relevant to everyone.

Note also that while some of the command sets associated with these tags are defined in talon files within [tags](https://github.com/talonhub/community/tree/main/tags), others, like git, are defined within [apps](https://github.com/talonhub/community/tree/main/apps). Additionally, the commands for tabs are defined in [tabs.talon](https://github.com/talonhub/community/blob/main/core/windows_and_tabs/tabs.talon).

### Unix utilities

If you have a Unix (e.g. OSX) or Linux computer, you can enable support for a number of
Expand All @@ -264,6 +266,16 @@ with community enabled.
For Jetbrains commands to work you must install https://plugins.jetbrains.com/plugin/10504-voice-code-idea
into each editor.

## Additional commands

There are other commands not described fully within this file. As an overview:

- The apps folder has command sets for use within different applications
- The core folder has various commands described [here](https://github.com/talonhub/community/blob/main/core/README.md)
- The lang folder has commands for writing [programming languages](https://github.com/talonhub/community?tab=readme-ov-file#programming-languages)
- The plugin folder has various commands described [here](https://github.com/talonhub/community/blob/main/plugin/README.md)
- The tags folder has various other commands, such as using a browser, navigating a filesystem in terminal, and managing multiple cursors

## Settings

Several options are configurable via a [single settings file](settings.talon) out of the box. Any setting can be made context specific as needed (e.g., per-OS, per-app, etc).
Expand Down
6 changes: 3 additions & 3 deletions apps/adobe/adobe_acrobat_reader_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

# --- App definition ---
mod = Module()
mod.apps.adobe_acrobat_reader_dc = """
mod.apps.adobe_acrobat_reader_dc = r"""
os: windows
and app.name: Adobe Acrobat DC
os: windows
and app.exe: Acrobat.exe
and app.exe: /^acrobat\.exe$/i
os: windows
and app.name: Adobe Acrobat Reader DC
os: windows
and app.exe: AcroRd32.exe
and app.exe: /^acrord32\.exe$/i
"""
# TODO: mac context and implementation
2 changes: 1 addition & 1 deletion apps/conemu/conemu.talon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
os: windows
app.exe: ConEmu64.exe
app.exe: /^conemu64\.exe$/i
-

tag(): terminal
Expand Down
1 change: 1 addition & 0 deletions apps/firefox/firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
apps.firefox = "app.name: Firefox Developer Edition"
apps.firefox = "app.name: firefox"
apps.firefox = "app.name: Firefox-esr"
apps.firefox = "app.name: firefox-esr"
apps.firefox = "app.name: LibreWolf"
apps.firefox = "app.name: waterfox"
apps.firefox = """
Expand Down
64 changes: 64 additions & 0 deletions apps/foxit_reader/foxit_reader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
from talon import Context, Module, actions

mod = Module()
ctx = Context()

# --- App definition ---
mod.apps.foxit_reader = r"""
os: windows
and app.name: /^Foxit Reader/
os: windows
and app.exe: /^foxitreader\.exe$/i
os: windows
and app.name: Foxit PDF Reader
os: windows
and app.exe: /^foxitpdfreader\.exe$/i
"""
# Context matching
ctx.matches = """
app: foxit_reader
"""


@ctx.action_class("app")
class AppActions:
# app.tabs
def tab_open():
actions.key("ctrl-o")

def tab_reopen():
actions.app.notify("Foxit does not support this action.")


@ctx.action_class("user")
class UserActions:
# user.tabs
def tab_jump(number):
actions.app.notify("Foxit does not support this action.")

def tab_final():
actions.app.notify("Foxit does not support this action.")

def tab_duplicate():
actions.app.notify("Foxit does not support this action.")

# user.pages
def page_current() -> int:
actions.key("ctrl-g")
page = actions.edit.selected_text()
return int(page)

def page_next():
actions.key("right")

def page_previous():
actions.key("left")

def page_jump(number: int):
actions.key("ctrl-g")
actions.insert(str(number))
actions.key("enter")

def page_final():
# actions.key("fn-right")
actions.key("end")
11 changes: 11 additions & 0 deletions apps/foxit_reader/foxit_reader.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
app: foxit_reader
-
tag(): user.tabs
tag(): user.pages

tab close all: key(ctrl-shift-w)

[page] rotate right: key("shift-ctrl-keypad_equals")
[page] rotate left: key("shift-ctrl-keypad_minus")

go back: key(alt-left)
3 changes: 1 addition & 2 deletions apps/jetbrains/jetbrains.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ def idea_commands(commands):
"""
# windows
mod.apps.jetbrains = "app.exe: idea64.exe"
mod.apps.jetbrains = "app.exe: PyCharm64.exe"
mod.apps.jetbrains = "app.exe: pycharm64.exe"
mod.apps.jetbrains = "app.exe: /^PyCharm64\.exe$/i"
mod.apps.jetbrains = "app.exe: webstorm64.exe"
mod.apps.jetbrains = """
os: mac
Expand Down
2 changes: 1 addition & 1 deletion apps/kindle/kindle.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
os: windows
and app.name: Kindle
os: windows
and app.exe: Kindle.exe
and app.exe: /^kindle\.exe$/i
"""
# TODO: mac context and implementation
44 changes: 44 additions & 0 deletions apps/meld/meld.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from talon import Context, Module, actions

mod = Module()
ctx = Context()

apps = mod.apps
apps.meld = """
os: windows
and app.name: Visual diff and merge tool
os: windows
and app.exe: meld.exe
"""

ctx.matches = r"""
app: meld
"""


@ctx.action_class("app")
class AppActions:
def tab_open():
actions.key("ctrl-n")

def tab_previous():
actions.key("ctrl-alt-pageup")

def tab_next():
actions.key("ctrl-alt-pagedown")

def tab_reopen():
print("Meld does not support this action.")


@ctx.action_class("user")
class UserActions:
def tab_jump(number):
if number < 10:
actions.key(f"alt-{number}")

def tab_final():
print("Meld does not support this action.")

def tab_duplicate():
print("Meld does not support this action.")
6 changes: 6 additions & 0 deletions apps/meld/meld.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app: meld
-
tag(): user.tabs

change next: key(alt-down)
change (previous | last): key(alt-up)
2 changes: 1 addition & 1 deletion apps/nitro_reader/nitro_reader_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
os: windows
and app.name: Nitro Reader 5
os: windows
and app.exe: NitroPDFReader.exe
and app.exe: /^nitropdfreader\.exe$/i
"""

# Context matching
Expand Down
2 changes: 1 addition & 1 deletion apps/sumatrapdf/sumatrapdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
os: windows
and app.name: SumatraPDF
os: windows
and app.exe: SumatraPDF.exe
and app.exe: /^sumatrapdf\.exe$/i
"""

# Context matching
Expand Down
16 changes: 16 additions & 0 deletions apps/talon/talon_debug_window/talon_debug_window.py
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
"""
24 changes: 24 additions & 0 deletions apps/talon/talon_debug_window/talon_debug_window.talon
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.
11 changes: 7 additions & 4 deletions apps/vscode/vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
os: linux
and app.name: Codium
"""
mod.apps.vscode = """
mod.apps.vscode = r"""
os: windows
and app.name: Visual Studio Code
os: windows
and app.name: Visual Studio Code Insiders
os: windows
and app.name: Visual Studio Code - Insiders
os: windows
and app.exe: Code.exe
and app.exe: /^code\.exe$/i
os: windows
and app.exe: Code-Insiders.exe
and app.exe: /^code-insiders\.exe$/i
os: windows
and app.name: VSCodium
os: windows
and app.exe: VSCodium.exe
and app.exe: /^vscodium\.exe$/i
os: windows
and app.name: Azure Data Studio
os: windows
Expand Down Expand Up @@ -159,6 +159,9 @@ def jump_line(n: int):
actions.key("enter")
actions.edit.line_start()

def zoom_reset():
actions.user.vscode("workbench.action.zoomReset")

def line_insert_down():
actions.user.vscode_and_wait("editor.action.insertLineAfter")

Expand Down
4 changes: 4 additions & 0 deletions apps/vscode/vscode.talon
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ please [<user.text>]:
user.vscode("workbench.action.showCommands")
insert(user.text or "")

go view [<user.text>]:
user.vscode("workbench.action.openView")
insert(user.text or "")

# Sidebar
bar explore: user.vscode("workbench.view.explorer")
bar extensions: user.vscode("workbench.view.extensions")
Expand Down
20 changes: 20 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# core

This folder contains `edit_settings.talon`, which has a command to open various [settings](https://github.com/talonhub/community?tab=readme-ov-file#settings) files. As an overview of what commands the subfolders contain:

- `abbreviate` has a command for the use of abbreviations
- `app_switcher` does not have commands but has the implementation of functions that allow for switching between applications
- `edit` has commands for navigating and editing text with copy, paste, etc., as well as commands for zooming in and out
- `file_extension` has a command for simpler spoken forms of file and website name extensions
- `help` has commands to open various help menus, as described in the top level [README](https://github.com/talonhub/community?tab=readme-ov-file#getting-started-with-talon)
- `homophones` has commands to replace words with their homophones
- `keys` has commands for [pressing keys](https://github.com/talonhub/community?tab=readme-ov-file#keys)
- `modes` has commands for switching between dictation, command, and sleep mode, as well as for forcing a certain [programming language](https://github.com/talonhub/community?tab=readme-ov-file#programming-languages) mode
- `mouse_grid` has commands to use a grid on the screen to click at a specific location
- `numbers` has the command for writing a number
- `screens` has a command for talon to show the index associated with each of your computer screens for the sake of moving windows to different screens
- `snippets` has commands for inserting snippets of code for various languages
- `text` has commands for inserting and reformatting text
- `vocabulary` has commands for adding new words to be recognized and for having certain words automatically by replaced by others
- `websites_and_search_engines` has commands for opening websites, following links, and making browser searches
- `windows_and_tabs` has commands for tab and [window management](https://github.com/talonhub/community?tab=readme-ov-file#window-management), launching and switching between different applications, and snapping application windows to different locations on the screen
1 change: 1 addition & 0 deletions core/app_switcher/app_name_overrides.linux.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Spoken form, App name (or list an app name by itself on a line to exclude it)
grip, DataGrip
py, jetbrains-pycharm-ce
terminal, Gnome-terminal
1 change: 1 addition & 0 deletions core/app_switcher/app_name_overrides.mac.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Spoken form, App name (or list an app name by itself on a line to exclude it)
grip, DataGrip
term, iTerm2
one note, ONENOTE
3 changes: 2 additions & 1 deletion core/app_switcher/app_name_overrides.windows.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Spoken form, App name/.exe (or list an app name/.exe by itself on a line to exclude it)
grip, DataGrip
term, iTerm2
term, WindowsTerminal.exe
one note, ONENOTE
lock, slack.exe
app, slack.exe
Expand Down
Loading

0 comments on commit 4cf5872

Please sign in to comment.