new_user_message
This directory contains a utility plugin designed to welcome new Talon users with a friendly interactive GUI. The GUI guides them through voice control basics and provides links to key community resources like the Talon Wiki, Slack workspace, and interactive practice tools.
Core Logic
The brains of the plugin reside in new_user_message.py. It handles:
- Startup Verification: When Talon starts up, the plugin registers a listener on the
readyevent. It checks for the existence of an empty marker file namednew_user_message_dismissedin the same directory. If this file does not exist, the plugin assumes a new user and displays the welcome interface immediately. - The Interactive GUI: Built using Talon's native
imguilibrary, the interface teaches users how buttons map to voice commands. It includes links to crucial resources and buttons to close or permanently dismiss the startup message. - State Management: It defines custom Talon actions and manages a context tag called
user.new_user_message_showing. This tag is active only when the GUI window is visible, ensuring context-specific voice commands are scoped appropriately.
Voice Commands
Two Talon files define the voice interactions for managing this GUI:
- new_user_message_global.talon: Registers the global voice command
new user message [show]. This command allows any user to manually summon the GUI helper window at any time, even if they previously dismissed it on startup. - new_user_message_showing.talon: Activates only when the
user.new_user_message_showingtag is enabled. It exposes commands to temporarily hide the panel (message hide) or permanently prevent it from showing up on subsequent restarts (message dismiss).
Workflow Summary
┌──────────────────────────────┐
│ Talon Starts / User Commands │
└──────────────┬───────────────┘
│
┌───────────────┴───────────────┐
│ new_user_message.py │
│ Checks for dismissed file │
└───────────────┬───────────────┘
│ (if missing or requested)
▼
┌──────────────────────────────┐
│ Show Welcome GUI │
│ Applies 'showing' tag │
└──────────────┬───────────────┘
│
┌───────────────────────┴───────────────────────┐
▼ ▼
[Click "message dismiss" button] [Say "message dismiss" voice command]
│ │
└───────────────────────┬───────────────────────┘
▼
┌──────────────────────────────┐
│ Writes 'dismissed' marker │
│ Closes GUI & removes tag │
└──────────────────────────────┘