init commit
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
from talon import Context, Module, actions
|
||||
|
||||
mod = Module()
|
||||
apps = mod.apps
|
||||
apps.discord = "app.bundle: com.hnc.Discord"
|
||||
apps.discord = "app.name: Discord"
|
||||
apps.discord = "app.name: Discord.exe"
|
||||
apps.discord = """
|
||||
tag: browser
|
||||
browser.host: discord.com
|
||||
"""
|
||||
|
||||
mod.list("discord_destination", desc="discord destination")
|
||||
|
||||
ctx = Context()
|
||||
ctx.matches = r"""
|
||||
app: discord
|
||||
"""
|
||||
|
||||
ctx.lists["user.discord_destination"] = {
|
||||
"user": "@",
|
||||
"voice": "!",
|
||||
"server": "*",
|
||||
}
|
||||
|
||||
|
||||
@mod.action_class
|
||||
class discord_actions:
|
||||
def discord_mentions_last():
|
||||
"""Go up to channel with unread mentions"""
|
||||
|
||||
def discord_mentions_next():
|
||||
"""Go down to channel with unread mentions"""
|
||||
|
||||
def discord_oldest_unread():
|
||||
"""Go to oldest unread message"""
|
||||
|
||||
def discord_toggle_pins():
|
||||
"""Toggle pins popout"""
|
||||
|
||||
def discord_toggle_inbox():
|
||||
"""Toggle inbox popout"""
|
||||
|
||||
def discord_toggle_members():
|
||||
"""Toggle channel member list"""
|
||||
|
||||
def discord_emoji_picker():
|
||||
"""Toggle emoji picker"""
|
||||
|
||||
def discord_gif_picker():
|
||||
"""Toggle gif picker"""
|
||||
|
||||
def discord_sticker_picker():
|
||||
"""Toggle sticker picker"""
|
||||
|
||||
def discord_mark_inbox_read():
|
||||
"""Mark top inbox channel read"""
|
||||
|
||||
def discord_mute():
|
||||
"""Toggle mute"""
|
||||
|
||||
def discord_deafen():
|
||||
"""Toggle deafen"""
|
||||
|
||||
def discord_answer_call():
|
||||
"""Answer incoming call"""
|
||||
|
||||
def discord_decline_call():
|
||||
"""Decline incoming call"""
|
||||
|
||||
def discord_quick_switcher(dest_type: str, dest_search: str):
|
||||
"""Open up the quick switcher, optionally specifying a type of destination"""
|
||||
|
||||
def discord_go_current_call():
|
||||
"""Go to current call"""
|
||||
|
||||
def discord_toggle_dms():
|
||||
"""Toggle between dms and your most recent server"""
|
||||
|
||||
|
||||
@ctx.action_class("user")
|
||||
class UserActions:
|
||||
# Navigation: Channels
|
||||
def messaging_open_channel_picker():
|
||||
actions.user.discord_quick_switcher("#", "")
|
||||
@@ -0,0 +1,34 @@
|
||||
app: discord
|
||||
-
|
||||
tag(): user.messaging
|
||||
tag(): user.emoji
|
||||
|
||||
# Navigation: QuickSwitcher
|
||||
{user.discord_destination} [<user.text>]:
|
||||
user.discord_quick_switcher(user.discord_destination, user.text or "")
|
||||
switcher: user.discord_quick_switcher("", "")
|
||||
|
||||
# Navigation: Channels
|
||||
[channel] mentions last: user.discord_mentions_last()
|
||||
[channel] mentions next: user.discord_mentions_next()
|
||||
oldest unread: user.discord_oldest_unread()
|
||||
current call: user.discord_go_current_call()
|
||||
|
||||
# UI
|
||||
toggle pins: user.discord_toggle_pins()
|
||||
toggle inbox: user.discord_toggle_inbox()
|
||||
toggle (members | member list): user.discord_toggle_members()
|
||||
toggle (dee ems | dims): user.discord_toggle_dms()
|
||||
pick emoji: user.discord_emoji_picker()
|
||||
pick (jif | gif | gift): user.discord_gif_picker()
|
||||
pick sticker: user.discord_sticker_picker()
|
||||
|
||||
# Misc
|
||||
mark inbox channel read: user.discord_mark_inbox_read()
|
||||
[toggle] (mute | unmute): user.discord_mute()
|
||||
(mute | unmute) and sleep:
|
||||
user.discord_mute()
|
||||
speech.disable()
|
||||
[toggle] (deafen | undeafen): user.discord_deafen()
|
||||
answer call: user.discord_answer_call()
|
||||
decline call: user.discord_decline_call()
|
||||
@@ -0,0 +1,96 @@
|
||||
from talon import Context, actions
|
||||
|
||||
ctx = Context()
|
||||
ctx.matches = r"""
|
||||
os: mac
|
||||
app: discord
|
||||
"""
|
||||
|
||||
|
||||
@ctx.action_class("user")
|
||||
class UserActions:
|
||||
# Navigation: QuickSwitcher
|
||||
def discord_quick_switcher(dest_type: str, dest_search: str):
|
||||
actions.key("cmd-k")
|
||||
actions.insert(dest_type)
|
||||
if dest_search:
|
||||
actions.insert(dest_search)
|
||||
|
||||
# Navigation: Servers
|
||||
def messaging_workspace_previous():
|
||||
actions.key("cmd-alt-up")
|
||||
|
||||
def messaging_workspace_next():
|
||||
actions.key("cmd-alt-down")
|
||||
|
||||
# Navigation: Channels
|
||||
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")
|
||||
|
||||
def discord_mentions_last():
|
||||
actions.key("cmd-alt-shift-up")
|
||||
|
||||
def discord_mentions_next():
|
||||
actions.key("cmd-alt-shift-down")
|
||||
|
||||
def discord_oldest_unread():
|
||||
actions.key("shift-pageup")
|
||||
|
||||
# UI
|
||||
def discord_toggle_pins():
|
||||
actions.key("cmd-p")
|
||||
|
||||
def discord_toggle_inbox():
|
||||
actions.key("cmd-i")
|
||||
|
||||
def discord_toggle_members():
|
||||
actions.key("cmd-u")
|
||||
|
||||
def discord_emoji_picker():
|
||||
actions.key("cmd-e")
|
||||
|
||||
def discord_gif_picker():
|
||||
actions.key("cmd-g")
|
||||
|
||||
def discord_sticker_picker():
|
||||
actions.key("cmd-s")
|
||||
|
||||
# Misc
|
||||
def messaging_mark_workspace_read():
|
||||
actions.key("shift-esc")
|
||||
|
||||
def messaging_mark_channel_read():
|
||||
actions.key("esc")
|
||||
|
||||
def messaging_upload_file():
|
||||
actions.key("cmd-shift-u")
|
||||
|
||||
def discord_mark_inbox_read():
|
||||
actions.key("cmd-shift-e")
|
||||
|
||||
def discord_mute():
|
||||
actions.key("cmd-shift-m")
|
||||
|
||||
def discord_deafen():
|
||||
actions.key("cmd-shift-d")
|
||||
|
||||
def discord_answer_call():
|
||||
actions.key("cmd-enter")
|
||||
|
||||
def discord_decline_call():
|
||||
actions.key("esc")
|
||||
|
||||
def discord_go_current_call():
|
||||
actions.key("cmd-alt-a")
|
||||
|
||||
def discord_toggle_dms():
|
||||
actions.key("cmd-alt-right")
|
||||
@@ -0,0 +1,97 @@
|
||||
from talon import Context, actions
|
||||
|
||||
ctx = Context()
|
||||
ctx.matches = r"""
|
||||
os: windows
|
||||
os: linux
|
||||
app: discord
|
||||
"""
|
||||
|
||||
|
||||
@ctx.action_class("user")
|
||||
class UserActions:
|
||||
# Navigation: QuickSwitcher
|
||||
def discord_quick_switcher(dest_type: str, dest_search: str):
|
||||
actions.key("ctrl-k")
|
||||
actions.insert(dest_type)
|
||||
if dest_search:
|
||||
actions.insert(dest_search)
|
||||
|
||||
# Navigation: Servers
|
||||
def messaging_workspace_previous():
|
||||
actions.key("ctrl-alt-up")
|
||||
|
||||
def messaging_workspace_next():
|
||||
actions.key("ctrl-alt-down")
|
||||
|
||||
# Navigation: Channels
|
||||
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")
|
||||
|
||||
def discord_mentions_last():
|
||||
actions.key("ctrl-alt-shift-up")
|
||||
|
||||
def discord_mentions_next():
|
||||
actions.key("ctrl-alt-shift-down")
|
||||
|
||||
def discord_oldest_unread():
|
||||
actions.key("shift-pageup")
|
||||
|
||||
# UI
|
||||
def discord_toggle_pins():
|
||||
actions.key("ctrl-p")
|
||||
|
||||
def discord_toggle_inbox():
|
||||
actions.key("ctrl-i")
|
||||
|
||||
def discord_toggle_members():
|
||||
actions.key("ctrl-u")
|
||||
|
||||
def discord_emoji_picker():
|
||||
actions.key("ctrl-e")
|
||||
|
||||
def discord_gif_picker():
|
||||
actions.key("ctrl-g")
|
||||
|
||||
def discord_sticker_picker():
|
||||
actions.key("ctrl-s")
|
||||
|
||||
# Misc
|
||||
def messaging_mark_workspace_read():
|
||||
actions.key("shift-esc")
|
||||
|
||||
def messaging_mark_channel_read():
|
||||
actions.key("esc")
|
||||
|
||||
def messaging_upload_file():
|
||||
actions.key("ctrl-shift-u")
|
||||
|
||||
def discord_mark_inbox_read():
|
||||
actions.key("ctrl-shift-e")
|
||||
|
||||
def discord_mute():
|
||||
actions.key("ctrl-shift-m")
|
||||
|
||||
def discord_deafen():
|
||||
actions.key("ctrl-shift-d")
|
||||
|
||||
def discord_answer_call():
|
||||
actions.key("ctrl-enter")
|
||||
|
||||
def discord_decline_call():
|
||||
actions.key("esc")
|
||||
|
||||
def discord_go_current_call():
|
||||
actions.key("ctrl-shift-alt-v")
|
||||
|
||||
def discord_toggle_dms():
|
||||
actions.key("ctrl-alt-right")
|
||||
Reference in New Issue
Block a user