beep-evdev

Crates.iobeep-evdev
lib.rsbeep-evdev
version0.3.2
sourcesrc
created_at2023-07-04 16:55:19.407852
updated_at2023-08-26 02:07:45.986669
descriptionBeep the PC speaker using evdev
homepagehttps://github.com/conqp/beep-evdev/
repositoryhttps://github.com/conqp/beep-evdev/
max_upload_size
id908185
size8,728
Richard Neumann (conqp)

documentation

https://docs.rs/beep-evdev

README

beep-evdev

Beep the PC speaker using evdev.

Prerequisites

The current user must be allowed to r/w to the speaker device:

$ cat /etc/udev/rules.d/70-pcspkr-beep.rules
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="PC Speaker", ENV{DEVNAME}!="", GROUP="beep", MODE="0660"

Examples:

extern crate beep_evdev;

use beep_evdev::beep;
use std::{thread, time};

fn main() {
    beep(440).expect("could not beep");
    thread::sleep(time::Duration::from_millis(500));
    beep(880).expect("could not beep");
    thread::sleep(time::Duration::from_millis(500));
    beep(0).expect("could not beep");
}
Commit count: 24

cargo fmt