init commit

This commit is contained in:
unknown
2025-08-19 08:06:37 -04:00
commit 2957b5515a
743 changed files with 45495 additions and 0 deletions
@@ -0,0 +1,7 @@
list: user.search_engine
-
amazon: https://www.amazon.com/s/?field-keywords=%s
google: https://www.google.com/search?q=%s
map: https://maps.google.com/maps?q=%s
scholar: https://scholar.google.com/scholar?q=%s
wiki: https://en.wikipedia.org/w/index.php?search=%s
@@ -0,0 +1,18 @@
list: user.website
-
talon home page: http://talonvoice.com
talon slack: http://talonvoice.slack.com/messages/help
talon wiki: https://talon.wiki/
talon practice: https://chaosparrot.github.io/talon_practice/
talon repository search: https://search.talonvoice.com/search/
amazon: https://www.amazon.com/
dropbox: https://dropbox.com/
google: https://www.google.com/
google calendar: https://calendar.google.com
google maps: https://maps.google.com/
google scholar: https://scholar.google.com/
gmail: https://mail.google.com/
github: https://github.com/
gist: https://gist.github.com/
wikipedia: https://en.wikipedia.org/
youtube: https://www.youtube.com/
@@ -0,0 +1,33 @@
import webbrowser
from urllib.parse import quote_plus
from talon import Context, Module
mod = Module()
mod.list("website", desc="A website.")
mod.list(
"search_engine",
desc="A search engine. Any instance of %s will be replaced by query text",
)
ctx_browser = Context()
ctx_browser.matches = r"""
tag: browser
"""
@mod.action_class
class Actions:
def open_url(url: str):
"""Visit the given URL."""
webbrowser.open(url)
def search_with_search_engine(search_template: str, search_text: str):
"""Search a search engine for given text"""
url = search_template.replace("%s", quote_plus(search_text))
webbrowser.open(url)
@ctx_browser.capture("user.address", rule="{user.website}")
def address(m) -> str:
return m.website
@@ -0,0 +1,10 @@
open {user.website}: user.open_url(website)
open that: user.open_url(edit.selected_text())
open paste: user.open_url(clip.text())
{user.search_engine} hunt <user.text>$:
user.search_with_search_engine(search_engine, user.text)
{user.search_engine} (that | this):
text = edit.selected_text()
user.search_with_search_engine(search_engine, text)
{user.search_engine} paste: user.search_with_search_engine(search_engine, clip.text())