diff --git a/systemd/cec-active-source.service b/systemd/cec-active-source.service new file mode 100644 index 00000000..fee56da2 --- /dev/null +++ b/systemd/cec-active-source.service @@ -0,0 +1,8 @@ +[Unit] +Description=Set this device to the CEC Active Source + +[Service] +Type=oneshot +ExecStartPre=/bin/echo 'on 0' | /usr/bin/cec-client -s +ExecStart=/bin/echo 'as' | /usr/bin/cec-client -s + diff --git a/systemd/cec-active-source.timer b/systemd/cec-active-source.timer new file mode 100644 index 00000000..bc7a3c73 --- /dev/null +++ b/systemd/cec-active-source.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Trigger cec-active-source at boot + +[Timer] +OnBootSec=1 +OnStartupSec=1 + +[Install] +WantedBy=timers.target diff --git a/systemd/cec-poweroff-tv.service b/systemd/cec-poweroff-tv.service new file mode 100644 index 00000000..80d0b549 --- /dev/null +++ b/systemd/cec-poweroff-tv.service @@ -0,0 +1,10 @@ +[Unit] +Description=Use CEC to power off TV + +[Service] +Type=oneshot +ExecStart=/bin/echo 'standby 0' | /usr/bin/cec-client -s +ExecStop=/bin/echo 'standby 0' | /usr/bin/cec-client -s + +[Install] +WantedBy=poweroff.target