Skip to content

Commit

Permalink
Example systemd units for common use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
riehecky committed May 4, 2020
1 parent 4ef0486 commit e246ea7
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 e246ea7

Please # to comment.