cec-dpms

Crates.iocec-dpms
lib.rscec-dpms
version0.1.1
sourcesrc
created_at2022-02-21 15:00:15.680339
updated_at2022-02-22 07:52:16.794074
descriptionSimple program to power on/off TV by simulating DPMS feature using HDMI CEC
homepagehttps://github.com/manio/cec-dpms
repositoryhttps://github.com/manio/cec-dpms
max_upload_size
id536499
size40,310
Mariusz Białończyk (manio)

documentation

https://github.com/manio/cec-dpms

README

🔘 cec-dpms

Description

This small linux tool is intended to emulate DPMS using HDMI-CEC interface. It is using the libcec library via cec-rs. This way it allows to emulate DPMS but for the TV connected to the CEC bus, as the result the TV behaves similar to a regular monitor. The user however has to run own scripts for controlling it.

Usage

cec-dpms 0.1.0
Simple program to power on/off TV by simulating DPMS feature using HDMI CEC

USAGE:
    cec-dpms [OPTIONS]

OPTIONS:
    -d, --debug            Enable debug info
    -h, --help             Print help information
    -i, --input <INPUT>    input device path/name of CEC device
    -V, --version          Print version information

The program is designed to be continuously running in background (Eg. started from systemd service).
It is listening to USR1 and USR2 signals:

  • USR1 is powering ON the TV,
  • USR2 is powering OFF the TV

Example

An example of using this tool along with Sway:
In the sway config file configure the swayidle like this:

exec swayidle \
    timeout 600 'swaymsg "output * dpms off"' \
       resume 'swaymsg "output * dpms on"' \
    timeout 600 'sudo pkill -USR2 cec-dpms' \
       resume 'sudo pkill -USR1 cec-dpms'

systemd integration

A sample service file for systemd is here:
systemd/cec-dpms.service
You need to adjust it for your needs (eg. check the binary path).
After placing the unit file in correct location and reloading systemd, the unit can be started as usual:
systemctl start cec-dpms.service

Commit count: 3

cargo fmt