Skip to content

Instantly share code, notes, and snippets.

@akash1810
Created November 7, 2015 00:30
Show Gist options
  • Save akash1810/e05a21132226c57899c6 to your computer and use it in GitHub Desktop.
Save akash1810/e05a21132226c57899c6 to your computer and use it in GitHub Desktop.
toggle the power of Lifx bulbs.
#!/bin/bash
: '
Toggle the power of Lifx bulbs.
Save to a directory on your PATH for simplicity - remember to give it execute permissions!
Requires a Lifx token (https://community.lifx.com/t/creating-a-lifx-http-api-token/25) to be stored in $HOME/.config/lifx/token
'
TOKEN=`cat $HOME/.config/lifx/token`
curl -XPOST -H "Authorization: Bearer $TOKEN" "https://api.lifx.com/v1/lights/all/toggle" --silent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment