Skip to content

Instantly share code, notes, and snippets.

@bhargavgv

bhargavgv/tv.sh Secret

Created December 29, 2017 22:17
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 bhargavgv/8fafa1948551f5394cacc14f8a837566 to your computer and use it in GitHub Desktop.
Save bhargavgv/8fafa1948551f5394cacc14f8a837566 to your computer and use it in GitHub Desktop.
Control your TV using CEC (for Raspberry Pi)
#!/bin/bash
echo "$1" >> tvlog
case "$1"
in
on) echo on 0 | cec-client -s -d 1;;
off) echo standby 0 | cec-client -s -d 1;;
*) echo "invalid command";;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment