AudioPilot v0.9.1

A Hammerspoon Spoon that automatically switches audio devices based on a priority list.

Overview

Variables

AudioPilot.configPath Variable #

Path to the JSON config file (default: ~/.config/AudioPilot/config.json).

AudioPilot.notifyDelay Variable #

Seconds to wait before emitting a coalesced device-change notification (default: 5).

AudioPilot.mutedIcon Variable #

Shown instead of menuIcon while the default output is muted or at volume 0 (default: "🔇"). Same format as menuIcon.

Methods

AudioPilot:configure(opts) Method #

Set one or more of AudioPilot's spoon-level variables (configPath, notifyDelay, menuIcon, mutedIcon, iconPreset) from a table. Call before :start().

  • opts - a table with any of configPath, notifyDelay, menuIcon, mutedIcon, iconPreset ("color" = emoji, "bw" = monochrome template icons; explicit menuIcon/mutedIcon in the same call override the preset)
AudioPilot:init() Method #

Called automatically by hs.loadSpoon(). Logs the loaded version.

AudioPilot:start() Method #

Load config, create the menu bar icon, enforce audio priorities, and start monitoring device changes.

AudioPilot:stop() Method #

Stop the audio device watcher, flush any pending notifications, and remove the menu bar icon.