PJ/cec.sh
2025-06-18 13:26:52 -07:00

23 lines
334 B
Bash
Executable file

#!/bin/bash
tv_on() {
cec-ctl --to 0 --image-view-on
echo "on">~/scripts/PJ/tv_state
}
tv_off() {
cec-ctl --to 0 --standby
echo "off">~/scripts/PJ/tv_state
}
if [[ -z "$1" ]]; then
if grep -q off ~/scripts/PJ/tv_state; then
tv_on
else
tv_off
fi
elif [[ $1 = "on" ]]; then
tv_on
elif [[ $1 = "off" ]]; then
tv_off
fi