Last active
November 19, 2024 09:41
-
-
Save mdpuma/c7151b1c9f5bf73f778320456e406a38 to your computer and use it in GitHub Desktop.
raspberry pi automate tv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0 8 * * 1-5 /home/pi/tv.sh on >/dev/null | |
| 0 18 * * 1-5 /home/pi/tv.sh off >/dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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