mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Fix: force Anime power/wakeup disabled to prevent idiotic random wakes
This commit is contained in:
@@ -4,6 +4,7 @@ use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use log::{info, warn};
|
||||
use udev::Device;
|
||||
|
||||
use crate::error::{PlatformError, Result};
|
||||
|
||||
@@ -88,4 +89,10 @@ impl HidRaw {
|
||||
file.write_all(message)
|
||||
.map_err(|e| PlatformError::IoPath(path.to_string_lossy().to_string(), e))
|
||||
}
|
||||
|
||||
pub fn set_wakeup_disabled(&self) -> Result<()> {
|
||||
let path = unsafe { &*(self.path.get()) };
|
||||
let mut dev = Device::from_syspath(path)?;
|
||||
Ok(dev.set_attribute_value("power/wakeup", "disabled")?)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user