init commit
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
from talon import Context, Module, actions
|
||||
|
||||
ctx = Context()
|
||||
mod = Module()
|
||||
apps = mod.apps
|
||||
apps.slack = "app.name: Slack"
|
||||
mod.apps.slack = r"""
|
||||
os: windows
|
||||
and app.name: Slack
|
||||
os: windows
|
||||
and app.exe: /^slack\.exe$/i
|
||||
"""
|
||||
apps.slack = """
|
||||
os: mac
|
||||
and app.bundle: com.tinyspeck.slackmacgap
|
||||
"""
|
||||
apps.slack = """
|
||||
tag: browser
|
||||
browser.host: app.slack.com
|
||||
"""
|
||||
ctx.matches = r"""
|
||||
app: slack
|
||||
"""
|
||||
|
||||
|
||||
@ctx.action_class("edit")
|
||||
class EditActions:
|
||||
def line_insert_down():
|
||||
actions.edit.line_end()
|
||||
actions.key("shift-enter")
|
||||
|
||||
|
||||
@mod.action_class
|
||||
class Actions:
|
||||
def slack_open_workspace(number: int):
|
||||
"""Opens the specified Slack workspace"""
|
||||
|
||||
def slack_show_channel_info():
|
||||
"""Shows the current channel's information"""
|
||||
|
||||
def slack_section_next():
|
||||
"""Selects the next Slack section"""
|
||||
actions.key("f6")
|
||||
|
||||
def slack_section_previous():
|
||||
"""Selects the previous Slack section"""
|
||||
actions.key("shift-f6")
|
||||
|
||||
def slack_open_direct_messages():
|
||||
"""Opens direct messages in Slack"""
|
||||
|
||||
def slack_open_threads():
|
||||
"""Opens threads in Slack"""
|
||||
|
||||
def slack_go_back():
|
||||
"""Navigates back in Slack"""
|
||||
|
||||
def slack_go_forward():
|
||||
"""Navigates forward in Slack"""
|
||||
|
||||
def slack_open_activity():
|
||||
"""Opens Activity in Slack"""
|
||||
|
||||
def slack_open_directory():
|
||||
"""Opens Directory in Slack"""
|
||||
|
||||
def slack_open_unread_messages():
|
||||
"""Opens Unread Messages in Slack"""
|
||||
|
||||
def slack_open_starred_items():
|
||||
"""Opens Starred Items in Slack"""
|
||||
|
||||
def slack_toggle_full_screen():
|
||||
"""Toggles full screen mode in Slack"""
|
||||
|
||||
def slack_add_reaction():
|
||||
"""Adds a reaction to the current message in Slack"""
|
||||
|
||||
def slack_insert_command():
|
||||
"""Inserts a command in Slack"""
|
||||
|
||||
def slack_insert_link():
|
||||
"""Inserts a link in Slack"""
|
||||
|
||||
def slack_insert_code():
|
||||
"""Inserts a code block in Slack"""
|
||||
|
||||
def slack_start_bulleted_list():
|
||||
"""Starts a bulleted list in Slack"""
|
||||
|
||||
def slack_start_numbered_list():
|
||||
"""Starts a numbered list in Slack"""
|
||||
|
||||
def slack_insert_quotation():
|
||||
"""Inserts a quotation in Slack"""
|
||||
|
||||
def slack_toggle_bold():
|
||||
"""Toggles bold formatting in Slack"""
|
||||
|
||||
def slack_toggle_italic():
|
||||
"""Toggles italic formatting in Slack"""
|
||||
|
||||
def slack_toggle_strikethrough():
|
||||
"""Toggles strikethrough formatting in Slack"""
|
||||
|
||||
def slack_create_snippet():
|
||||
"""Opens the menu for creating a snippet in Slack"""
|
||||
|
||||
def slack_huddle():
|
||||
"""Starts a huddle in Slack"""
|
||||
|
||||
def slack_open_keyboard_shortcuts():
|
||||
"""Opens the keyboard shortcuts menu in Slack"""
|
||||
|
||||
def slack_toggle_left_sidebar():
|
||||
"""Toggles the visibility of the left sidebar in Slack"""
|
||||
|
||||
def slack_toggle_right_sidebar():
|
||||
"""Toggles the visibility of the right sidebar in Slack"""
|
||||
@@ -0,0 +1,72 @@
|
||||
app: slack
|
||||
-
|
||||
tag(): user.messaging
|
||||
tag(): user.emoji
|
||||
|
||||
# Workspace
|
||||
workspace <number>: user.slack_open_workspace(number)
|
||||
# Channel
|
||||
(slack | lack) [channel] info: user.slack_show_channel_info()
|
||||
focus (move | next): key(ctrl-`)
|
||||
(section | zone) [next]: user.slack_section_next()
|
||||
(section | zone) (previous | last): user.slack_section_previous()
|
||||
(slack | lack) (starred [items] | stars): user.slack_open_starred_items()
|
||||
(slack | lack) [direct] messages: user.slack_open_direct_messages()
|
||||
(slack | lack) threads: user.slack_open_threads()
|
||||
(slack | lack) (history [next] | back | backward): user.slack_go_back()
|
||||
(slack | lack) forward: user.slack_go_forward()
|
||||
|
||||
# Messaging
|
||||
grab left: key(shift-up)
|
||||
grab right: key(shift-down)
|
||||
add line: key(shift-enter)
|
||||
|
||||
(slack | lack) (slap | slaw | slapper): edit.line_insert_down()
|
||||
(element | bit) [next]: key(tab)
|
||||
(element | bit) (previous | last): key(shift-tab)
|
||||
|
||||
(slack | lack) (my stuff | activity): user.slack_open_activity()
|
||||
(slack | lack) directory: user.slack_open_directory()
|
||||
|
||||
(slack | lack) unread [messages]: user.slack_open_unread_messages()
|
||||
|
||||
(go | undo | toggle) full: user.slack_toggle_full_screen()
|
||||
(slack | lack) (react | reaction): user.slack_add_reaction()
|
||||
(insert command | commandify): user.slack_insert_command()
|
||||
insert link: user.slack_insert_link()
|
||||
insert code: user.slack_insert_code()
|
||||
(slack | lack) (bull | bullet | bulleted) [list]: user.slack_start_bulleted_list()
|
||||
(slack | lack) (number | numbered) [list]: user.slack_start_numbered_list()
|
||||
(slack | lack) (quotes | quotation): user.slack_insert_quotation()
|
||||
bold: user.slack_toggle_bold()
|
||||
(italic | italicize): user.slack_toggle_italic()
|
||||
(strike | strikethrough): user.slack_toggle_strikethrough()
|
||||
(slack | lack) snippet: user.slack_create_snippet()
|
||||
# Calls
|
||||
(slack | lack) huddle: user.slack_huddle()
|
||||
([toggle] mute | unmute): key(m)
|
||||
(slack | lack) ([toggle] video): key(v)
|
||||
(slack | lack) invite: key(a)
|
||||
|
||||
# Miscellaneous
|
||||
emote <user.text>: ":{text}:"
|
||||
(slack | lack) shortcuts: user.slack_open_keyboard_shortcuts()
|
||||
toggle left sidebar: user.slack_toggle_left_sidebar()
|
||||
toggle right sidebar: user.slack_toggle_right_sidebar()
|
||||
|
||||
# DEPRECATED
|
||||
(move | next) focus:
|
||||
app.notify("please use the voice command 'focus next' instead of 'next focus'")
|
||||
key(ctrl-`)
|
||||
[next] (section | zone):
|
||||
app.notify("please use the voice command 'section next' instead of 'next section'")
|
||||
key(f6)
|
||||
(previous | last) (section | zone):
|
||||
app.notify("please use the voice command 'section last' instead of 'last section'")
|
||||
key(shift-f6)
|
||||
[next] (element | bit):
|
||||
app.notify("please use the voice command 'element next' instead of 'next element'")
|
||||
key(tab)
|
||||
(previous | last) (element | bit):
|
||||
app.notify("please use the voice command 'element last' instead of 'last element'")
|
||||
key(shift-tab)
|
||||
@@ -0,0 +1,125 @@
|
||||
from talon import Context, actions
|
||||
|
||||
ctx = Context()
|
||||
ctx.matches = r"""
|
||||
os: mac
|
||||
app: slack
|
||||
"""
|
||||
|
||||
|
||||
@ctx.action_class("user")
|
||||
class UserActions:
|
||||
def messaging_workspace_previous():
|
||||
actions.key("cmd-shift-[")
|
||||
|
||||
def messaging_workspace_next():
|
||||
actions.key("cmd-shift-]")
|
||||
|
||||
def messaging_open_channel_picker():
|
||||
actions.key("cmd-k")
|
||||
|
||||
def messaging_channel_previous():
|
||||
actions.key("alt-up")
|
||||
|
||||
def messaging_channel_next():
|
||||
actions.key("alt-down")
|
||||
|
||||
def messaging_unread_previous():
|
||||
actions.key("alt-shift-up")
|
||||
|
||||
def slack_open_starred_items():
|
||||
actions.key("cmd-shift-s")
|
||||
|
||||
def messaging_unread_next():
|
||||
actions.key("alt-shift-down")
|
||||
|
||||
def messaging_open_search():
|
||||
actions.key("cmd-f")
|
||||
|
||||
def messaging_mark_workspace_read():
|
||||
actions.key("shift-esc")
|
||||
|
||||
def messaging_mark_channel_read():
|
||||
actions.key("esc")
|
||||
|
||||
# Files and Snippets
|
||||
def messaging_upload_file():
|
||||
actions.key("cmd-u")
|
||||
|
||||
def slack_open_workspace(number: int):
|
||||
actions.key(f"cmd-{number}")
|
||||
|
||||
def slack_show_channel_info():
|
||||
actions.key("cmd-shift-i")
|
||||
|
||||
def slack_open_direct_messages():
|
||||
actions.key("cmd-shift-k")
|
||||
|
||||
def slack_open_threads():
|
||||
actions.key("cmd-shift-t")
|
||||
|
||||
def slack_go_back():
|
||||
actions.key("cmd-[")
|
||||
|
||||
def slack_go_forward():
|
||||
actions.key("cmd-]")
|
||||
|
||||
def slack_open_activity():
|
||||
actions.key("cmd-shift-m")
|
||||
|
||||
def slack_open_directory():
|
||||
actions.key("cmd-shift-e")
|
||||
|
||||
def slack_open_unread_messages():
|
||||
actions.key("cmd-shift-a")
|
||||
|
||||
def slack_toggle_full_screen():
|
||||
actions.key("ctrl-cmd-f")
|
||||
|
||||
def slack_add_reaction():
|
||||
actions.key("cmd-shift-\\")
|
||||
|
||||
def slack_insert_command():
|
||||
actions.key("cmd-shift-c")
|
||||
|
||||
def slack_insert_link():
|
||||
actions.key("cmd-shift-u")
|
||||
|
||||
def slack_insert_code():
|
||||
actions.key("cmd-shift-alt-c")
|
||||
|
||||
def slack_start_bulleted_list():
|
||||
actions.key("cmd-shift-8")
|
||||
|
||||
def slack_start_numbered_list():
|
||||
actions.key("cmd-shift-7")
|
||||
|
||||
def slack_insert_quotation():
|
||||
actions.key("cmd-shift->")
|
||||
|
||||
def slack_toggle_bold():
|
||||
actions.key("cmd-b")
|
||||
|
||||
def slack_toggle_italic():
|
||||
actions.key("cmd-i")
|
||||
|
||||
def slack_toggle_strikethrough():
|
||||
actions.key("cmd-shift-x")
|
||||
|
||||
def slack_create_snippet():
|
||||
actions.key("cmd-shift-enter")
|
||||
|
||||
def slack_huddle():
|
||||
actions.key("cmd-shift-h")
|
||||
|
||||
def slack_open_keyboard_shortcuts():
|
||||
"""Opens the keyboard shortcuts menu in Slack"""
|
||||
actions.key("cmd-/")
|
||||
|
||||
def slack_toggle_left_sidebar():
|
||||
"""Toggles the visibility of the left sidebar in Slack"""
|
||||
actions.key("cmd-shift-d")
|
||||
|
||||
def slack_toggle_right_sidebar():
|
||||
"""Toggles the visibility of the right sidebar in Slack"""
|
||||
actions.key("cmd-.")
|
||||
@@ -0,0 +1,127 @@
|
||||
from talon import Context, actions
|
||||
|
||||
ctx = Context()
|
||||
ctx.matches = r"""
|
||||
os: windows
|
||||
os: linux
|
||||
app: slack
|
||||
"""
|
||||
|
||||
|
||||
@ctx.action_class("user")
|
||||
class UserActions:
|
||||
def messaging_workspace_previous():
|
||||
actions.key("ctrl-shift-tab")
|
||||
|
||||
def messaging_workspace_next():
|
||||
actions.key("ctrl-tab")
|
||||
|
||||
def messaging_open_channel_picker():
|
||||
actions.key("ctrl-k")
|
||||
|
||||
def messaging_channel_previous():
|
||||
actions.key("alt-up")
|
||||
|
||||
def messaging_channel_next():
|
||||
actions.key("alt-down")
|
||||
|
||||
def messaging_unread_previous():
|
||||
actions.key("alt-shift-up")
|
||||
|
||||
def messaging_unread_next():
|
||||
actions.key("alt-shift-down")
|
||||
|
||||
# (go | undo | toggle) full: key(ctrl-cmd-f)
|
||||
def messaging_open_search():
|
||||
actions.key("ctrl-f")
|
||||
|
||||
def messaging_mark_workspace_read():
|
||||
actions.key("shift-esc")
|
||||
|
||||
def messaging_mark_channel_read():
|
||||
actions.key("esc")
|
||||
|
||||
# Files and Snippets
|
||||
def messaging_upload_file():
|
||||
actions.key("ctrl-u")
|
||||
|
||||
def slack_open_workspace(number: int):
|
||||
actions.key(f"ctrl-{number}")
|
||||
|
||||
def slack_show_channel_info():
|
||||
actions.key("ctrl-shift-i")
|
||||
|
||||
def slack_open_direct_messages():
|
||||
actions.key("ctrl-shift-k")
|
||||
|
||||
def slack_open_threads():
|
||||
actions.key("ctrl-shift-t")
|
||||
|
||||
def slack_go_back():
|
||||
actions.key("alt-left")
|
||||
|
||||
def slack_go_forward():
|
||||
actions.key("alt-right")
|
||||
|
||||
def slack_open_activity():
|
||||
actions.key("ctrl-shift-m")
|
||||
|
||||
def slack_open_directory():
|
||||
actions.key("ctrl-shift-e")
|
||||
|
||||
def slack_open_unread_messages():
|
||||
actions.key("ctrl-shift-a")
|
||||
|
||||
def slack_open_starred_items():
|
||||
actions.key("ctrl-shift-s")
|
||||
|
||||
def slack_toggle_full_screen():
|
||||
actions.key("ctrl-ctrl-f")
|
||||
|
||||
def slack_add_reaction():
|
||||
actions.key("ctrl-shift-\\")
|
||||
|
||||
def slack_insert_command():
|
||||
actions.key("ctrl-shift-c")
|
||||
|
||||
def slack_insert_link():
|
||||
actions.key("ctrl-shift-u")
|
||||
|
||||
def slack_insert_code():
|
||||
actions.insert("```")
|
||||
|
||||
def slack_start_bulleted_list():
|
||||
actions.key("ctrl-shift-8")
|
||||
|
||||
def slack_start_numbered_list():
|
||||
actions.key("ctrl-shift-7")
|
||||
|
||||
def slack_insert_quotation():
|
||||
actions.key("ctrl-shift-9")
|
||||
|
||||
def slack_toggle_bold():
|
||||
actions.key("ctrl-b")
|
||||
|
||||
def slack_toggle_italic():
|
||||
actions.key("ctrl-i")
|
||||
|
||||
def slack_toggle_strikethrough():
|
||||
actions.key("ctrl-shift-x")
|
||||
|
||||
def slack_create_snippet():
|
||||
actions.key("ctrl-shift-enter")
|
||||
|
||||
def slack_huddle():
|
||||
actions.key("ctrl-shift-h")
|
||||
|
||||
def slack_open_keyboard_shortcuts():
|
||||
"""Opens the keyboard shortcuts menu in Slack"""
|
||||
actions.key("ctrl-/")
|
||||
|
||||
def slack_toggle_left_sidebar():
|
||||
"""Toggles the visibility of the left sidebar in Slack"""
|
||||
actions.key("ctrl-shift-d")
|
||||
|
||||
def slack_toggle_right_sidebar():
|
||||
"""Toggles the visibility of the right sidebar in Slack"""
|
||||
actions.key("ctrl-.")
|
||||
Reference in New Issue
Block a user