Skip to content

Commit

Permalink
Merge pull request #506 from jcpunk/systemd-units
Browse files Browse the repository at this point in the history
Example systemd units for common use cases
  • Loading branch information
opdenkamp authored Jul 13, 2020
2 parents b42fad0 + e246ea7 commit 5650353
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions systemd/cec-active-source.service
Original file line number Diff line number Diff line change
@@ -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

9 changes: 9 additions & 0 deletions systemd/cec-active-source.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Trigger cec-active-source at boot

[Timer]
OnBootSec=1
OnStartupSec=1

[Install]
WantedBy=timers.target
10 changes: 10 additions & 0 deletions systemd/cec-poweroff-tv.service
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5650353

Please sign in to comment.