-
Notifications
You must be signed in to change notification settings - Fork 780
/
thunderbird.py
97 lines (85 loc) · 1.76 KB
/
thunderbird.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
from talon import Context, Module
# --- App definitions ---
# Main app TODO: mac context
mod = Module()
mod.apps.thunderbird = r"""
os: windows
and app.name: Thunderbird
os: windows
and app.exe: /^thunderbird\.exe$/i
"""
mod.apps.thunderbird = """
os: linux
and app.name: Thunderbird
"""
# Inbox tab TODO: also matches emails opened in new tab
mod.apps.thunderbird_inbox = """
app: thunderbird
title: /@/
"""
# Calendar tab (lightning)
months = [
"January", # English
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
"Januar", # German
"Februar",
"März",
"Mai",
"Juni",
"Juli",
"Oktober",
"Dezember",
]
mod.apps.thunderbird_calendar = f"""
app: thunderbird
title: Calendar - Mozilla Thunderbird
title: Kalender - Mozilla Thunderbird
title: /({"|".join(map(lambda m: m + " ", months))})/
"""
# Tasks tab
mod.apps.thunderbird_tasks = """
app: thunderbird
title: Tasks - Mozilla Thunderbird
title: Aufgaben - Mozilla Thunderbird
"""
# Mail composer window
mod.apps.thunderbird_composer = """
app: thunderbird
title: /Write: /
title: /Verfassen: /
"""
# Address book popup window
mod.apps.thunderbird_contacts = """
app: thunderbird
title: Address Book
title: Adressbuch
"""
# Context matching
ctx = Context()
ctx.matches = r"""
app: thunderbird
"""
# --- Define actions ---
@mod.action_class
class UserActions:
def thunderbird_mod(keys: str):
"""Press keys with modifier ctrl or cmd"""
def thunderbird_calendar_view(number: int):
"""Select between calendar view tabs"""
# --- Implement actions ---
@ctx.action_class("app")
class AppActions:
# app.tabs
# not possible in thunderbird
def tab_open():
pass