Skip to content

Instantly share code, notes, and snippets.

@mdpuma
Last active November 19, 2024 09:41
Show Gist options
  • Select an option

  • Save mdpuma/c7151b1c9f5bf73f778320456e406a38 to your computer and use it in GitHub Desktop.

Select an option

Save mdpuma/c7151b1c9f5bf73f778320456e406a38 to your computer and use it in GitHub Desktop.
raspberry pi automate tv
#!/bin/bash
# .config/lxsession/LXDE-pi/autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
chromium-browser --app=https://grafana.iphost.md/d/7gv6kakMz/tv?orgId=1\&refresh=1m\&kiosk --start-fullscreen
chromium-browser --app=https://grafana.iphost.md/d/DzTc96zGk/tv2?orgId=1\&refresh=1m\&kiosk --start-fullscreen --window-position=1920,0
xset -display :0 -dpms
xset -display :0 s off
0 8 * * 1-5 /home/pi/tv.sh on >/dev/null
0 18 * * 1-5 /home/pi/tv.sh off >/dev/null
#!/bin/bash
DEVICE=0
if [ $1 = "on" ]; then
echo "on $DEVICE" | cec-client -s -d 1
# enable monitors
su pi -s /bin/bash -c 'xset -display :0 -dpms'
elif [ $1 = "off" ]; then
echo "standby $DEVICE" | cec-client -s -d 1
# disable monitors
su pi -s /bin/bash -c 'xset -display :0 dpms force standby'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment