Skip to content

Commit 6d1a115

Browse files
committed
fix rfkill feature
1 parent 552100d commit 6d1a115

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

swhkd/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ tokio = { version = "1.38.0", features = ["full"] }
2121
tokio-stream = "0.1.15"
2222
tokio-udev = "0.9.1"
2323

24+
[features]
25+
rfkill = []
26+
2427
[[bin]]
2528
name = "swhkd"
2629
path = "src/daemon.rs"

swhkd/src/uinput.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ use evdev::{
33
AttributeSet, Key, RelativeAxisType, SwitchType,
44
};
55

6-
//use nix::ioctl_none;
7-
//use std::fs::File;
8-
//use std::os::unix::io::AsRawFd;
6+
#[cfg(feature = "rfkill")]
7+
use nix::ioctl_none;
8+
9+
#[cfg(feature = "rfkill")]
10+
use std::fs::File;
11+
12+
#[cfg(feature = "rfkill")]
13+
use std::os::unix::io::AsRawFd;
914

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

0 commit comments

Comments
 (0)