forked from talonhub/community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatril.py
39 lines (31 loc) · 763 Bytes
/
atril.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from talon import Context, Module, actions
# --- App definition ---
mod = Module()
mod.apps.atril = """
os: linux
and app.name: Atril
"""
# Context matching
ctx = Context()
ctx.matches = r"""
app: atril
"""
# --- Implement actions ---
@ctx.action_class("user")
class UserActions:
# user.pages
def page_current():
actions.key("ctrl-l")
page = actions.edit.selected_text()
actions.key("right escape")
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-l")
actions.insert(str(number))
actions.key("enter")
def page_final():
actions.key("ctrl-end")