Fix: reimplement fetching of fan curves on CLI

Partial close of #385
This commit is contained in:
Luke D. Jones
2023-08-01 09:18:27 +12:00
parent 9154aaa97c
commit 42b92f3b87
2 changed files with 11 additions and 3 deletions

View File

@@ -686,9 +686,11 @@ fn handle_fan_curve(
} }
if cmd.get_enabled { if cmd.get_enabled {
// TODO: let profile = dbus.proxies().profile().active_profile()?;
// let res = dbus.proxies().profile().enabled_fan_profiles()?; let curves = dbus.proxies().profile().fan_curve_data(profile)?;
// println!("{:?}", res); for curve in curves.iter() {
println!("{}", String::from(curve));
}
} }
if cmd.default { if cmd.default {

View File

@@ -6,13 +6,16 @@ use rog_profiles::{FanCurvePU, Profile};
pub struct ProfileCommand { pub struct ProfileCommand {
#[options(help = "print help message")] #[options(help = "print help message")]
pub help: bool, pub help: bool,
#[options(help = "toggle to next profile in list")] #[options(help = "toggle to next profile in list")]
pub next: bool, pub next: bool,
#[options(help = "list available profiles")] #[options(help = "list available profiles")]
pub list: bool, pub list: bool,
#[options(help = "get profile")] #[options(help = "get profile")]
pub profile_get: bool, pub profile_get: bool,
#[options(meta = "", help = "set the active profile")] #[options(meta = "", help = "set the active profile")]
pub profile_set: Option<Profile>, pub profile_set: Option<Profile>,
} }
@@ -24,6 +27,7 @@ pub struct FanCurveCommand {
#[options(help = "get enabled fan profiles")] #[options(help = "get enabled fan profiles")]
pub get_enabled: bool, pub get_enabled: bool,
#[options(help = "set the active profile's fan curve to default")] #[options(help = "set the active profile's fan curve to default")]
pub default: bool, pub default: bool,
@@ -32,11 +36,13 @@ pub struct FanCurveCommand {
help = "profile to modify fan-curve for. Shows data if no options provided" help = "profile to modify fan-curve for. Shows data if no options provided"
)] )]
pub mod_profile: Option<Profile>, pub mod_profile: Option<Profile>,
#[options( #[options(
meta = "", meta = "",
help = "enable or disable <true/false> fan curve. `mod_profile` required" help = "enable or disable <true/false> fan curve. `mod_profile` required"
)] )]
pub enabled: Option<bool>, pub enabled: Option<bool>,
#[options( #[options(
meta = "", meta = "",
help = "select fan <cpu/gpu/mid> to modify. `mod_profile` required" help = "select fan <cpu/gpu/mid> to modify. `mod_profile` required"