Skip to content

Add config file support for custom voice commands #1

@turqoisehex

Description

@turqoisehex

Summary

hushtype has a hardcoded VOICE_COMMANDS dictionary in hushtype.py (line ~212) that maps spoken phrases to keyboard actions. Users who want custom commands must edit the source code directly. A config file would let users add their own commands without modifying hushtype.py.

The FAQ already mentions this: "Not yet via config file, but the VOICE_COMMANDS dictionary in hushtype.py is straightforward to edit. Custom command support via config file is planned."

Acceptance Criteria

  • hushtype reads a JSON or YAML config file (e.g., hushtype_commands.json) on startup
  • Config file maps spoken phrases to keyboard actions (e.g., {"bold": "ctrl+b"})
  • Built-in commands still work as defaults -- config file overrides/extends them
  • If no config file exists, hushtype works exactly as before
  • Update README FAQ to reflect the new capability

Relevant Code

  • VOICE_COMMANDS dict: hushtype.py line ~212
  • _MULTI_STEP dict: hushtype.py line ~257
  • _dispatch_command(): hushtype.py line ~271

Notes

This is a good first issue because the command table is already well-structured as a dict. The main work is reading an external file and merging it with the defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions