Skip to content

Instantly share code, notes, and snippets.

@henrik
Last active October 26, 2022 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrik/437257c1346a33db6dc10a72c61ca807 to your computer and use it in GitHub Desktop.
Save henrik/437257c1346a33db6dc10a72c61ca807 to your computer and use it in GitHub Desktop.
Bash script to toggle the Sonos subwoofer via soco-cli.
# Uses https://github.com/avantrec/soco-cli via https://pypa.github.io/pipx/.
# I map this to a HTPC keyboard key via Alfred.app.
if [ `soco -l "Front room" sub_enabled` == "on" ]; then
soco -l "Front room" sub_enabled off : "Front room" light off
say -vDaniel "Sub off"
else
soco -l "Front room" sub_enabled on : "Front room" light on
say -vDaniel "Sub on"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment