Coder Social home page Coder Social logo

manio / cec-dpms Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 17 KB

Simple program to power on/off TV by simulating DPMS feature using HDMI CEC

Home Page: https://manio.github.io/cec-dpms/

License: GNU General Public License v2.0

Rust 100.00%
rust cec libcec hdmi dpms

cec-dpms's Introduction

๐Ÿ”˜ cec-dpms

Crates.io Crates.io

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

cec-dpms's People

Contributors

manio avatar trinitronx avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

trinitronx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.