Skip to content

Commit

Permalink
fix rfkill feature
Browse files Browse the repository at this point in the history
  • Loading branch information
id3v1669 committed Jul 6, 2024
1 parent 552100d commit 6d1a115
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions swhkd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ tokio = { version = "1.38.0", features = ["full"] }
tokio-stream = "0.1.15"
tokio-udev = "0.9.1"

[features]
rfkill = []

[[bin]]
name = "swhkd"
path = "src/daemon.rs"
11 changes: 8 additions & 3 deletions swhkd/src/uinput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ use evdev::{
AttributeSet, Key, RelativeAxisType, SwitchType,
};

//use nix::ioctl_none;
//use std::fs::File;
//use std::os::unix::io::AsRawFd;
#[cfg(feature = "rfkill")]
use nix::ioctl_none;

#[cfg(feature = "rfkill")]
use std::fs::File;

#[cfg(feature = "rfkill")]
use std::os::unix::io::AsRawFd;

#[cfg(feature = "rfkill")]
ioctl_none!(rfkill_noinput, b'R', 1);
Expand Down

0 comments on commit 6d1a115

Please sign in to comment.