This file contains hidden or 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
import ast | |
import os.path | |
from talon import Context, Module, actions, ui | |
ctx = Context() | |
mod = Module() | |
# Stores the original AST elements so we can refer to specific properties of them | |
REFERENCE = {} |
This file contains hidden or 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
from talon import Context, Module, actions, app, ui | |
ctx = Context() | |
mod = Module() | |
mod.list("window_titles", desc="All window titles") | |
APPLICATION_MATCH_REGEX = re.compile("PyCharm|IntelliJ.*|TextEdit") | |
This file contains hidden or 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
from talon import ui | |
from talon.mac.ui import App | |
from talon.ui import UIErr | |
APPS = [ | |
"Slack", | |
"Google Chrome", | |
] | |
This file contains hidden or 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
import ollama | |
from talon.types import Span | |
OLLAMA_MODEL = "gemma2:2b" | |
def process_text(text, template): | |
print(f"Sending text to model: {text[:50]}...") | |
prompt = template.replace("$text", text) | |
try: |
This file contains hidden or 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
from talon import Module, actions, ui | |
mod = Module() | |
@mod.action_class | |
class Actions: | |
def dock_handoff_accept(): | |
"""Accept a Handoff from another device via the dock""" | |
handoff_items = ui.apps(bundle="com.apple.dock")[0].element.children.find( | |
AXRole="AXDockItem", AXSubrole="AXHandoffDockItem" |
OlderNewer