mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
:sadface:
This commit is contained in:
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Changed
|
### Changed
|
||||||
- Notify through dbus if user changes profile manually
|
- Notify through dbus if user changes profile manually
|
||||||
|
- Better help on CLI, show help only for supported items
|
||||||
|
- Bugfix to gfx switcher
|
||||||
|
|
||||||
# [3.1.3] - 2021-03-10
|
# [3.1.3] - 2021-03-10
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -261,20 +261,13 @@ impl CtrlGraphics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn do_driver_action(driver: &str, action: &str) -> Result<(), RogError> {
|
fn do_driver_action(driver: &str, action: &str) -> Result<(), RogError> {
|
||||||
let mut cmd;
|
let mut cmd= Command::new(action);
|
||||||
if Self::kmod_exists() {
|
|
||||||
info!("using kmod");
|
|
||||||
cmd = Command::new("kmod");
|
|
||||||
cmd.arg(action);
|
|
||||||
} else {
|
|
||||||
cmd = Command::new(action);
|
|
||||||
}
|
|
||||||
cmd.arg(driver);
|
cmd.arg(driver);
|
||||||
|
|
||||||
let mut count = 0;
|
let mut count = 0;
|
||||||
const MAX_TRIES: i32 = 6;
|
const MAX_TRIES: i32 = 6;
|
||||||
loop {
|
loop {
|
||||||
if count > MAX_TRIES+1 {
|
if count > MAX_TRIES {
|
||||||
let msg = format!("{} {} failed for unknown reason", action, driver);
|
let msg = format!("{} {} failed for unknown reason", action, driver);
|
||||||
error!("{}", msg);
|
error!("{}", msg);
|
||||||
return Ok(()) //Err(RogError::Modprobe(msg));
|
return Ok(()) //Err(RogError::Modprobe(msg));
|
||||||
@@ -297,6 +290,8 @@ impl CtrlGraphics {
|
|||||||
let msg = format!("{} {} failed: {:?}", action, driver, String::from_utf8_lossy(&output.stderr));
|
let msg = format!("{} {} failed: {:?}", action, driver, String::from_utf8_lossy(&output.stderr));
|
||||||
return Err(RogError::Modprobe(msg));
|
return Err(RogError::Modprobe(msg));
|
||||||
}
|
}
|
||||||
|
} else if output.status.success() {
|
||||||
|
return Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
count += 1;
|
count += 1;
|
||||||
@@ -344,17 +339,6 @@ impl CtrlGraphics {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn kmod_exists() -> bool {
|
|
||||||
let mut cmd = Command::new("which");
|
|
||||||
cmd.arg("kmod");
|
|
||||||
if let Ok(output) = cmd
|
|
||||||
.output() {
|
|
||||||
return output.status.success() && output.stdout.ends_with("kmod".as_bytes())
|
|
||||||
}
|
|
||||||
//Path::new("/usr/bin/kmod").exists()
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn do_vendor_tasks(&mut self, vendor: GfxVendors) -> Result<(), RogError> {
|
pub fn do_vendor_tasks(&mut self, vendor: GfxVendors) -> Result<(), RogError> {
|
||||||
Self::write_xorg_conf(vendor)?;
|
Self::write_xorg_conf(vendor)?;
|
||||||
Self::write_modprobe_conf()?; // TODO: Not required here, should put in startup?
|
Self::write_modprobe_conf()?; // TODO: Not required here, should put in startup?
|
||||||
|
|||||||
Reference in New Issue
Block a user