New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sonos-simple-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sonos-simple-cli

Control Sonos from CLI with pause|play mute toggle and more, with Alfred support for keyboard shortcuts

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Sonos Simple CLI

There are many better projects out there.

But this is one I am working on to play with Node CLI and to use personally for the control of my own Sonos speakers.

Features

  • configuration file to setup which roomName you want to use
  • acts only only the configured device
  • caches a found/configured device (faster startup)
  • supports pause/play toggle, and prev/next, vol +/-
  • built in support for Alfred Workflow (and thus a global hotkey shortcut)

Thanks

A big thanks to the Sonos API implementation Lib I'm using:

https://github.com/bencevans/node-sonos

Install

$ npm install sonos-simple-cli -g

Manual Crappy Install

cd ~
mkdir bin
git clone https://github.com/zeroasterisk/sonos-simple-cli.git
cd sonos-simple-cli
npm install
cd ..
ln -s sonos-simple-cli/sonos.js ./

Manual Script Running

$ node ~/bin/sonos.js help
-----------------------------
----- Sonos Simple CLI ------
-----------------------------
node sonos.js playpause
node sonos.js play
node sonos.js pause
node sonos.js next
node sonos.js prev
node sonos.js volup
node sonos.js voldown
node sonos.js mute
node sonos.js unmute
node sonos.js mutetoggle
node sonos.js clearCache
-----------------------------

$ node ~/bin/sonos.js playpause
  > SONOS set to PAUSED
  Beastie Boys "I Don't Know"
    @ 58/180 sec

Configure for Alfred

Install Alfred if not already installed.

To get the workflow, just double-click on sonos-simple-cli.alfredworkflow and install it.

You will recognise Alfred workflows by their .alfredworkflow file extension and their icon.

To install a workflow, simply double-click the workflow file on your Mac. Alfred will show you a preview of the name and description of the workflow as well as the details for the developer, if available. Click the "Import" button to add the workflow to the sidebar on the left.

http://support.alfredapp.com/workflows:installing/

  • CMD+F7 -> prev
  • CMD+F8 -> play/pause
  • CMD+F9 -> next
  • CMD+F10 -> mutetoggle
  • CMD+F11 -> volume down
  • CMD+F12 -> volume up

Manual Setup in Alfred

here's how I created the Alfred Worflow

Alfred > Workflows

Click + (bottom left) to add a new Workflow

Click + (top right) to add an trigger > hotkey

Then choose your hotkey and save.

Click + (top right) to add an action -> run script

select /bin/bash at the top, then enter the following

source ~/.profile
/usr/local/bin/node ~/bin/sonos.js pauseplay

ss

then click save.

Finally, drag a line between them.

ss

Bonus Points, output when done

Add an output > notification and setup as follows

ss

then connect and you're all set

Keywords

FAQs

Package last updated on 02 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc