housekeeping

This commit is contained in:
Penelope Gwen 2026-04-04 00:33:24 -07:00
parent 9a9594b2e7
commit 4a40cf473e

View file

@ -1,13 +1,11 @@
use clap::Parser;
use evdev::*;
use regex::Regex;
use std::io::{Read, Write};
use std::{
fs::{File, OpenOptions},
path::Path,
};
const DEVICES_PATH: &str = "/proc/bus/input/devices";
const HAPTIC_PATH: &str = "/sys/class/timed_output/vibrator/enable";
#[derive(Parser, Debug)]
@ -47,25 +45,6 @@ fn main() {
HAPTIC_PATH
));
/*let devices_list: String = {
let mut str = String::new();
File::open(Path::new(DEVICES_PATH))
.expect(&format!(
"Unable to open {} to read devices list!",
DEVICES_PATH
))
.read_to_string(&mut str)
.expect(&format!("Unable to read devices list at {}!", DEVICES_PATH));
str
};
let kbd_regex = Regex::new(r"(?ms)Integrated keyboard(.*?)kbd (?<event>.*?) \n").unwrap();
let event_num = &kbd_regex.captures(&devices_list).expect(&format!(
"No valid keyboard devices found in {}",
DEVICES_PATH
))["event"];*/
let device_path = enumerate()
.find(|x| {
x.1.name()
@ -75,7 +54,6 @@ fn main() {
.expect("No valid keyboard device found")
.0;
//let device_path = format!("/dev/input/{}", event_num);
let mut device =
Device::open(&device_path).expect(&format!("Unable to open device at {:?}", &device_path));
loop {