Pi66

Home | Repos | About | Blog | Gaza

pind
Simple Rust hotkey daemon.
git clone https://git.pi66.xyz/pind

About | Files | Commits | Refs | License


fix: fix some pull request glitches problems

Author: pi66
Date: 2025-09-04 19:27
commit: 7d9e2518

Stat

M src/main.rs 7 +3 -4

Diff

diff --git a/src/main.rs b/src/main.rs
index 511d3f2..5471787 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -27,7 +27,7 @@ use evdev::{AttributeSet, Device, KeyCode, enumerate, EventType, uinput::Virtual
 use std::{env::{var,args},fs::{read_to_string,canonicalize}, path::PathBuf, process::{exit,Command, Stdio}, sync::{Arc, OnceLock}, thread};

const DELAY :u64 = 25; // 25ms -const CONFIG :&str = "~/etc/pind/pindrc"; // You can use ~/ for user path +const CONFIG :&str = "/etc/pind/pindrc"; // You can use ~/ for user path // like ~/.config/pind/pindrc static BINDINGS: OnceLock<Arc<Vec<(AttributeSet<KeyCode>, String)>>> = OnceLock::new();

@@ -168,7 +168,7 @@ fn read_keys(kc: &[(AttributeSet<KeyCode>, String)], kbs: PathBuf, delay: u64, u // First, get all supported keys from the physical device to set up the virtual device properly let supported_keys = match device.supported_keys() { Some(keys) => keys, - None => { + _ => { eprintln!("Failed to get supported keys from device"); ...

Show all

diff --git a/src/main.rs b/src/main.rs
index 511d3f2..5471787 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -27,7 +27,7 @@ use evdev::{AttributeSet, Device, KeyCode, enumerate, EventType, uinput::Virtual
 use std::{env::{var,args},fs::{read_to_string,canonicalize}, path::PathBuf, process::{exit,Command, Stdio}, sync::{Arc, OnceLock}, thread};

const DELAY :u64 = 25; // 25ms -const CONFIG :&str = "~/etc/pind/pindrc"; // You can use ~/ for user path +const CONFIG :&str = "/etc/pind/pindrc"; // You can use ~/ for user path // like ~/.config/pind/pindrc static BINDINGS: OnceLock<Arc<Vec<(AttributeSet<KeyCode>, String)>>> = OnceLock::new();

@@ -168,7 +168,7 @@ fn read_keys(kc: &[(AttributeSet<KeyCode>, String)], kbs: PathBuf, delay: u64, u // First, get all supported keys from the physical device to set up the virtual device properly let supported_keys = match device.supported_keys() { Some(keys) => keys, - None => { + _ => { eprintln!("Failed to get supported keys from device"); return; } @@ -253,13 +253,12 @@ fn read_keys(kc: &[(AttributeSet<KeyCode>, String)], kbs: PathBuf, delay: u64, u let (since, last) = &mut state[i]; if pressed { if *since == 0 { - run(cmd, &user); *since = tick; *last = tick; } else if tick - *since >= init && tick > *last { - run(cmd, &user); *last = tick; } + run(cmd, &user); } else { *since = 0; }

// Created by Pi66

// Copyright ©Pi66 2026