#!/bin/bash

# omarchy:summary=Record dictation using Superwhisper
# omarchy:args=<start|stop|toggle>

case "${1:-}" in
  start) superwhisper start ;;
  stop)
    if omarchy-cmd-missing superwhisper || ! systemctl --user is-active --quiet superwhisper.service; then
      exit 0
    else
      superwhisper stop
    fi
    ;;
  toggle) superwhisper record ;;
  *) echo "Usage: omarchy dictation superwhisper <start|stop|toggle>" >&2; exit 1 ;;
esac
