rog-gui: sort fan curve by name

This commit is contained in:
Luke D. Jones
2022-08-29 10:41:51 +12:00
parent 71241b7127
commit fb08d83999
6 changed files with 12 additions and 8 deletions

View File

@@ -137,9 +137,9 @@ I'm unsure of how many laptops this works on, so please try it.
`led_type: Key` works only on actual per-key RGB keyboards. `led_type: Key` works only on actual per-key RGB keyboards.
`led_type: PerZone` works on most zoned laptops but I've no idea if it works on unzoned. Please try it if you can. `led_type: Zone` works on zoned laptops.
For TUF use `"Zone": "None"` (and yes this does mean an audio EQ can be done now). `led_type: Zone` set to `None` works on zoned ROG laptops, unzoned ROG laptops, and TUF laptops (and yes this does mean an audio EQ can be done now).
`~/.config/rog/rog-user.cfg` contains a setting `"active_aura": "<FILENAME>"` where `<FILENAME>` is the name of the Aura config to use, located in the same directory and without the file postfix, e.g, `"active_anime": "aura-default"` `~/.config/rog/rog-user.cfg` contains a setting `"active_aura": "<FILENAME>"` where `<FILENAME>` is the name of the Aura config to use, located in the same directory and without the file postfix, e.g, `"active_anime": "aura-default"`

View File

@@ -100,7 +100,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let packets = aura_config.aura.create_packets(); let packets = aura_config.aura.create_packets();
client.proxies().led().per_key_raw(packets).unwrap(); client.proxies().led().per_key_raw(packets).unwrap();
std::thread::sleep(std::time::Duration::from_millis(60)); std::thread::sleep(std::time::Duration::from_millis(33));
} }
}) })
.detach(); .detach();

View File

@@ -9,6 +9,7 @@ use serde_derive::{Deserialize, Serialize};
// static mut RNDINDEX: usize = 0; // static mut RNDINDEX: usize = 0;
static mut PRNDINDEX: usize = 0; static mut PRNDINDEX: usize = 0;
/// Pseudo random table ripped straight out of Room4Doom
pub const RNDTABLE: [i32; 256] = [ pub const RNDTABLE: [i32; 256] = [
0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66, 74, 21, 211, 47, 80, 242, 154, 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66, 74, 21, 211, 47, 80, 242, 154,
27, 205, 128, 161, 89, 77, 36, 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188, 27, 205, 128, 161, 89, 77, 36, 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188,

View File

@@ -7,5 +7,5 @@ Comment=Make your ASUS ROG Laptop go Brrrrr!
Categories=Settings Categories=Settings
Icon=rog-control-center Icon=rog-control-center
Exec=env WINIT_UNIX_BACKEND=x11 rog-control-center Exec=rog-control-center
Terminal=false Terminal=false

View File

@@ -1,5 +1,5 @@
use std::{ use std::{
collections::{BTreeMap, HashMap, HashSet}, collections::{BTreeMap, HashSet},
sync::{ sync::{
atomic::{AtomicBool, Ordering}, atomic::{AtomicBool, Ordering},
Arc, Arc,
@@ -72,7 +72,9 @@ impl ProfilesState {
Ok(Self { Ok(Self {
was_notified, was_notified,
list: if supported.platform_profile.platform_profile { list: if supported.platform_profile.platform_profile {
dbus.proxies().profile().profiles()? let mut list = dbus.proxies().profile().profiles()?;
list.sort();
list
} else { } else {
vec![] vec![]
}, },
@@ -91,7 +93,7 @@ pub struct FanCurvesState {
pub show_curve: Profile, pub show_curve: Profile,
pub show_graph: FanCurvePU, pub show_graph: FanCurvePU,
pub enabled: HashSet<Profile>, pub enabled: HashSet<Profile>,
pub curves: HashMap<Profile, FanCurveSet>, pub curves: BTreeMap<Profile, FanCurveSet>,
pub drag_delta: Vec2, pub drag_delta: Vec2,
} }
@@ -118,7 +120,7 @@ impl FanCurvesState {
HashSet::from([Profile::Balanced, Profile::Quiet, Profile::Performance]) HashSet::from([Profile::Balanced, Profile::Quiet, Profile::Performance])
}; };
let mut curves: HashMap<Profile, FanCurveSet> = HashMap::new(); let mut curves: BTreeMap<Profile, FanCurveSet> = BTreeMap::new();
profiles.iter().for_each(|p| { profiles.iter().for_each(|p| {
if supported.platform_profile.fan_curves { if supported.platform_profile.fan_curves {
if let Ok(curve) = dbus.proxies().profile().fan_curve_data(*p) { if let Ok(curve) = dbus.proxies().profile().fan_curve_data(*p) {

View File

@@ -66,6 +66,7 @@ impl<'a> RogApp<'a> {
} }
}; };
profiles.list.sort();
for f in profiles.list.iter() { for f in profiles.list.iter() {
item(*f, curves, curves.enabled.contains(f)); item(*f, curves, curves.enabled.contains(f));
} }