Skip to content

slack

This directory contains the Talon configuration files that enable rich voice control for the Slack messaging client. It supports Slack across Windows, macOS, Linux, and web browser-based interfaces, exposing commands for workspace navigation, chat messaging, formatting, and call management.

The integration is built around a platform-agnostic set of actions that are automatically mapped to the appropriate keyboard shortcuts depending on your operating system.

Core Architecture

The Slack integration is split into a declaration file, platform-specific keyboard mappings, and a voice command definition file:

  • slack.py: This file defines how Talon detects Slack. It matches the Windows desktop executable (slack.exe), the macOS bundle identifier (com.tinyspeck.slackmacgap), and web browsers navigating to app.slack.com. It also defines a new Module containing custom Slack action declarations (such as opening threads, toggling sidebars, or starting huddles).
  • slack_mac.py: Implements the custom Slack actions as well as standard messaging actions (user.messaging) for macOS. It translates abstract concepts like "open direct messages" into Mac-specific keystrokes (e.g., cmd-shift-k).
  • slack_win.py: Implements the exact same actions for Windows and Linux environments, translating them into control-key equivalents (e.g., ctrl-shift-k).
  • slack.talon: The main voice command file that maps spoken phrases to the actions declared in the Python files.

How It Works

When Slack is the active window (or the active browser tab), the rules defined in slack.talon become active. This file activates two key tag-based action sets: user.messaging and user.emoji.

The voice commands enable rapid navigation through Slack's dense interface:

  • Workspaces & Channels: Commands like workspace <number> map to OS-specific quick-switching shortcuts (cmd-<number> on Mac, ctrl-<number> on Windows). Other commands handle moving to previous/next channels or showing the channel information pane.
  • Sections & UI Toggles: Voice controls like section next and section last use keyboard focus cycling (f6 / shift-f6) to jump between the sidebar, main message pane, and search. You can also hide or show UI elements using commands like toggle left sidebar or toggle right sidebar.
  • History: Quick back and forth navigation is handled by slack history or slack forward.

Message Formatting and Rich Text

The voice commands make it easy to format text inside the message box without relying on mouse clicks:

  • Styling: Standard styling commands like bold, italic, and strikethrough map directly to the corresponding text formatting shortcuts.
  • Lists & Code Blocks: Commands like insert code, slack bullet list, and slack numbered list automate the block syntax formatting.
  • Snippets & Quotations: Complex actions such as opening the snippet creation dialog (slack snippet) or inserting block quotes (slack quotation) are wrapped in custom platform actions.

Audio and Calls

For Slack Huddles and calls, the configuration maps common call controls:

  • slack huddle starts or joins a huddle.
  • mute / unmute toggles audio using the default m key inside calls.
  • slack video and slack invite toggle the camera and pull up the invitation panel, respectively.