Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manio/cec-dpms
Simple program to power on/off TV by simulating DPMS feature using HDMI CEC
https://github.com/manio/cec-dpms
cec dpms hdmi libcec rust
Last synced: about 7 hours ago
JSON representation
Simple program to power on/off TV by simulating DPMS feature using HDMI CEC
- Host: GitHub
- URL: https://github.com/manio/cec-dpms
- Owner: manio
- License: gpl-2.0
- Created: 2022-02-21T14:31:34.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T04:05:36.000Z (about 1 year ago)
- Last Synced: 2024-10-31T11:28:37.388Z (16 days ago)
- Topics: cec, dpms, hdmi, libcec, rust
- Language: Rust
- Homepage: https://manio.github.io/cec-dpms/
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🔘 cec-dpms
[![Crates.io](https://img.shields.io/crates/v/cec-dpms.svg)](https://crates.io/crates/cec-dpms)
[![Crates.io](https://img.shields.io/crates/l/cec-dpms.svg)](https://crates.io/crates/cec-dpms)## Description
This small linux tool is intended to emulate DPMS using [HDMI-CEC](https://en.wikipedia.org/wiki/Consumer_Electronics_Control) interface.
It is using the [libcec](https://github.com/Pulse-Eight/libcec) library via [cec-rs](https://crates.io/crates/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 CECUSAGE:
cec-dpms [OPTIONS]OPTIONS:
-d, --debug Enable debug info
-h, --help Print help information
-i, --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](https://swaywm.org/):
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](https://github.com/manio/cec-dpms/blob/master/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`