forked from talonhub/community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
247 changed files
with
8,846 additions
and
2,757 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Dev stuff | ||
__pycache__ | ||
*.sw? | ||
# Locally generated | ||
/settings | ||
.vscode/settings.json |
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,23 @@ | ||
from talon import Context, actions | ||
ctx = Context() | ||
|
||
#i don't see a need to restrict the app here, this just defines the actions | ||
#each app can support appropriate voice commands as needed | ||
#the below are for 1password, redefine as needed | ||
ctx.matches = r""" | ||
os: mac | ||
""" | ||
@ctx.action_class('user') | ||
class UserActions: | ||
def password_fill(): | ||
actions.key('cmd-\\') | ||
def password_show(): | ||
actions.key('cmd-alt-\\') | ||
def password_new(): | ||
actions.key('cmd-i') | ||
def password_duplicate(): | ||
actions.key('cmd-d') | ||
def password_edit(): | ||
actions.key('cmd-e') | ||
def password_delete(): | ||
actions.key('cmd-backspace') |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
from talon import Context, actions | ||
ctx = Context() | ||
|
||
#i don't see a need to restrict the app here, this just defines the actions | ||
#each app can support appropriate voice commands as needed | ||
#the below are for 1password, redefine as needed | ||
ctx.matches = r""" | ||
os: windows | ||
""" | ||
|
||
@ctx.action_class('user') | ||
class UserActions: | ||
def password_fill(): | ||
actions.key('ctrl-\\\\') | ||
def password_show(): | ||
actions.key('alt-ctrl-\\\\') | ||
def password_new(): | ||
actions.key('ctrl-n') | ||
def password_duplicate(): | ||
actions.key('ctrl-d') | ||
def password_edit(): | ||
actions.key('ctrl-e') | ||
def password_delete(): | ||
actions.key('ctrl-delete') |
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,15 @@ | ||
from talon import Module | ||
|
||
# --- App definition --- | ||
mod = Module() | ||
mod.apps.adobe_acrobat_reader_dc = """ | ||
os: windows | ||
and app.name: Adobe Acrobat DC | ||
os: windows | ||
and app.exe: Acrobat.exe | ||
os: windows | ||
and app.name: Adobe Acrobat Reader DC | ||
os: windows | ||
and app.exe: AcroRd32.exe | ||
""" | ||
# TODO: mac context and implementation |
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 @@ | ||
app: adobe_acrobat_reader_dc | ||
- | ||
# Set tags | ||
tag(): user.tabs | ||
tag(): user.pages |
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,40 @@ | ||
from talon import Context, actions | ||
|
||
# Context matching | ||
ctx = Context() | ||
ctx.matches = """ | ||
os: windows | ||
app: adobe_acrobat_reader_dc | ||
""" | ||
|
||
|
||
# --- Implement actions --- | ||
@ctx.action_class('app') | ||
class AppActions: | ||
# app.tabs | ||
def tab_next(): actions.key('ctrl-tab') | ||
def tab_previous(): actions.key('ctrl-shift-tab') | ||
|
||
|
||
@ctx.action_class('edit') | ||
class EditActions: | ||
def zoom_in(): actions.key("ctrl-0") # in german version | ||
def zoom_out(): actions.key("ctrl-1") # in german version TODO: differentiate languages | ||
def zoom_reset(): actions.key("ctrl-2") | ||
|
||
|
||
@ctx.action_class("user") | ||
class UserActions: | ||
# user.pages | ||
def page_current(): | ||
actions.key("ctrl-shift-n") | ||
page = actions.edit.selected_text() | ||
actions.key("tab:2 enter") | ||
return int(page) | ||
def page_next(): actions.key("ctrl-pagedown") | ||
def page_previous(): actions.key("ctrl-pageup") | ||
def page_jump(number: int): | ||
actions.key("ctrl-shift-n") | ||
actions.insert(str(number)) | ||
actions.key("enter") | ||
def page_final(): actions.key("end") |
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,19 @@ | ||
from talon import Module | ||
|
||
# --- App definition --- | ||
mod = Module() | ||
mod.apps.calibre = """ | ||
os: windows | ||
and app.name: calibre.exe | ||
os: windows | ||
and app.exe: calibre.exe | ||
os: windows | ||
and app.name: calibre-parallel.exe | ||
os: windows | ||
and app.exe: calibre-parallel.exe | ||
""" | ||
mod.apps.calibre = """ | ||
os: linux | ||
app.name: calibre | ||
""" | ||
# TODO: mac context |
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,30 @@ | ||
from talon import Module, Context, actions | ||
|
||
# --- App definition --- | ||
mod = Module() | ||
mod.apps.calibre_viewer = """ | ||
app: calibre | ||
title: /E-book viewer$/ | ||
title: /eBook-Betrachter$/ | ||
""" | ||
|
||
# Context matching | ||
ctx = Context() | ||
ctx.matches = """ | ||
os: windows | ||
os: linux | ||
app: calibre_viewer | ||
""" | ||
# TODO: mac implementation | ||
|
||
|
||
# --- Implement actions --- | ||
@ctx.action_class("user") | ||
class UserActions: | ||
# user.pages | ||
def page_next(): actions.key("pagedown") | ||
def page_previous(): actions.key("pageup") | ||
def page_final(): actions.key("ctrl-end") | ||
# user.chapters | ||
def chapter_next(): actions.key("ctrl-pagedown") | ||
def chapter_previous(): actions.key("ctrl-pageup") |
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 @@ | ||
app: calibre_viewer | ||
- | ||
# Set tags | ||
tag(): user.pages | ||
tag(): user.chapters |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.