Skip to content

Commit 5650353

Browse files
authored
Merge pull request #506 from jcpunk/systemd-units
Example systemd units for common use cases
2 parents b42fad0 + e246ea7 commit 5650353

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

systemd/cec-active-source.service

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Unit]
2+
Description=Set this device to the CEC Active Source
3+
4+
[Service]
5+
Type=oneshot
6+
ExecStartPre=/bin/echo 'on 0' | /usr/bin/cec-client -s
7+
ExecStart=/bin/echo 'as' | /usr/bin/cec-client -s
8+

systemd/cec-active-source.timer

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=Trigger cec-active-source at boot
3+
4+
[Timer]
5+
OnBootSec=1
6+
OnStartupSec=1
7+
8+
[Install]
9+
WantedBy=timers.target

systemd/cec-poweroff-tv.service

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=Use CEC to power off TV
3+
4+
[Service]
5+
Type=oneshot
6+
ExecStart=/bin/echo 'standby 0' | /usr/bin/cec-client -s
7+
ExecStop=/bin/echo 'standby 0' | /usr/bin/cec-client -s
8+
9+
[Install]
10+
WantedBy=poweroff.target

0 commit comments

Comments
 (0)