init commit
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
from talon import Context, Module, actions, app
|
||||
|
||||
ctx = Context()
|
||||
mod = Module()
|
||||
|
||||
mod.apps.vivaldi = "app.name: Vivaldi"
|
||||
mod.apps.vivaldi = "app.name: Vivaldi-stable"
|
||||
mod.apps.vivaldi = r"""
|
||||
os: windows
|
||||
and app.exe: /^vivaldi\.exe$/i
|
||||
os: linux
|
||||
and app.exe: vivaldi-bin
|
||||
os: mac
|
||||
and app.bundle: com.vivaldi.Vivaldi
|
||||
"""
|
||||
ctx.matches = r"""
|
||||
app: vivaldi
|
||||
"""
|
||||
|
||||
|
||||
@mod.action_class
|
||||
class Actions:
|
||||
def vivaldi_history_panel():
|
||||
"""Toggles the Vivaldi history panel"""
|
||||
actions.key("ctrl-shift-h")
|
||||
|
||||
def vivaldi_bookmarks_panel():
|
||||
"""Toggles the Vivaldi bookmarks panel"""
|
||||
actions.user.command_search("Bookmarks Panel")
|
||||
actions.key("enter")
|
||||
|
||||
def vivaldi_downloads_panel():
|
||||
"""Toggles the Vivaldi downloads panel"""
|
||||
actions.key("ctrl-shift-d")
|
||||
|
||||
def vivaldi_notes_panel():
|
||||
"""Toggles the Vivaldi notes panel"""
|
||||
actions.key("ctrl-shift-o")
|
||||
|
||||
|
||||
@ctx.action_class("user")
|
||||
class UserActions:
|
||||
def tab_close_wrapper():
|
||||
actions.sleep("180ms")
|
||||
actions.app.tab_close()
|
||||
|
||||
def tab_jump(number: int):
|
||||
actions.key(f"ctrl-{number}")
|
||||
|
||||
def command_search(command: str = ""):
|
||||
actions.key("ctrl-e")
|
||||
if command != "":
|
||||
actions.sleep("180ms")
|
||||
actions.insert(command)
|
||||
|
||||
|
||||
@ctx.action_class("browser")
|
||||
class BrowserActions:
|
||||
def show_extensions():
|
||||
actions.key("ctrl-shift-e")
|
||||
|
||||
def focus_address():
|
||||
actions.key("ctrl-l")
|
||||
|
||||
def focus_page():
|
||||
actions.key("f9")
|
||||
|
||||
def bookmarks():
|
||||
actions.key("ctrl-b")
|
||||
|
||||
def bookmark_tabs():
|
||||
raise NotImplementedError("Vivaldi doesn't support this functionality")
|
||||
|
||||
def show_downloads():
|
||||
# There is no default shortcut for showing the downloads page. You can
|
||||
# configure one.
|
||||
actions.app.tab_open()
|
||||
actions.sleep("180ms")
|
||||
actions.browser.go("vivaldi://downloads")
|
||||
|
||||
def go(url: str):
|
||||
actions.browser.focus_address()
|
||||
actions.sleep("150ms")
|
||||
actions.insert(url)
|
||||
actions.key("enter")
|
||||
@@ -0,0 +1,10 @@
|
||||
app: vivaldi
|
||||
-
|
||||
tag(): browser
|
||||
tag(): user.tabs
|
||||
tag(): user.command_search
|
||||
|
||||
(sidebar | panel) history: user.vivaldi_history_panel()
|
||||
(sidebar | panel) downloads: user.vivaldi_downloads_panel()
|
||||
(sidebar | panel) bookmarks: user.vivaldi_bookmarks_panel()
|
||||
(sidebar | panel) notes: user.vivaldi_notes_panel()
|
||||
@@ -0,0 +1,49 @@
|
||||
from talon import Context, actions, app
|
||||
|
||||
ctx = Context()
|
||||
|
||||
ctx.matches = r"""
|
||||
os: mac
|
||||
app: vivaldi
|
||||
"""
|
||||
|
||||
|
||||
@ctx.action_class("user")
|
||||
class UserActions:
|
||||
def vivaldi_history_panel():
|
||||
actions.key("cmd-alt-y")
|
||||
|
||||
def vivaldi_downloads_panel():
|
||||
actions.key("cmd-alt-l")
|
||||
|
||||
def vivaldi_notes_panel():
|
||||
# This shortcut didn't work for me. You might need to change it to a
|
||||
# different one.
|
||||
actions.key("cmd-alt-n")
|
||||
|
||||
def vivaldi_toggle_quick_commands():
|
||||
actions.key("cmd-e")
|
||||
|
||||
def tab_jump(number: int):
|
||||
actions.key(f"cmd-{number}")
|
||||
|
||||
|
||||
@ctx.action_class("app")
|
||||
class AppActions:
|
||||
def tab_next():
|
||||
actions.key("cmd-shift-]")
|
||||
|
||||
def tab_previous():
|
||||
actions.key("cmd-shift-[")
|
||||
|
||||
|
||||
@ctx.action_class("browser")
|
||||
class BrowserActions:
|
||||
def show_extensions():
|
||||
actions.key("ctrl-cmd-e")
|
||||
|
||||
def bookmarks():
|
||||
actions.key("cmd-ctrl-b")
|
||||
|
||||
def focus_address():
|
||||
actions.key("cmd-l")
|
||||
Reference in New Issue
Block a user