Updated the docs, renamed EWW_CPU_USAGE to EWW_CPU

This commit is contained in:
druskus20 2021-08-21 19:55:04 +02:00
parent 4c9315a016
commit 86dce341ac
2 changed files with 14 additions and 6 deletions

View file

@ -22,10 +22,10 @@ macro_rules! builtin_vars {
pub fn get_inbuilt_vars() -> HashMap<VarName, ScriptVarDefinition> { pub fn get_inbuilt_vars() -> HashMap<VarName, ScriptVarDefinition> {
builtin_vars! {Duration::new(2, 0), builtin_vars! {Duration::new(2, 0),
// @desc EWW_TEMPS - Heat of the components in Celcius\nExample: `{(CPU_TEMPS.core_1 + CPU_TEMPS.core_2) / 2}` // @desc EWW_TEMPS - Heat of the components in Celcius
"EWW_TEMPS" => || Ok(DynVal::from(get_core_temperatures())), "EWW_TEMPS" => || Ok(DynVal::from(get_temperatures())),
// @desc EWW_RAM - The current RAM + Swap usage // @desc EWW_RAM - Information on ram and swap usage in kB.
"EWW_RAM" => || Ok(DynVal::from(get_ram())), "EWW_RAM" => || Ok(DynVal::from(get_ram())),
// @desc EWW_DISK - Information on on all mounted partitions (Might report inaccurately on some filesystems, like btrfs)\nExample: `{EWW_DISK["/"]}` // @desc EWW_DISK - Information on on all mounted partitions (Might report inaccurately on some filesystems, like btrfs)\nExample: `{EWW_DISK["/"]}`
@ -42,8 +42,16 @@ pub fn get_inbuilt_vars() -> HashMap<VarName, ScriptVarDefinition> {
} }
)), )),
// @desc EWW_CPU_USAGE - Average CPU usage (all cores) since the last update (No MacOS support) // @desc EWW_CPU - Information on the CPU cores: frequency and usage (No MacOS support)
"EWW_CPU_USAGE" => || Ok(DynVal::from(get_cpus())), "EWW_CPU" => || Ok(DynVal::from(get_cpus())),
// TODO: Change this eventually, maybe implement an error system
// @desc EWW_CPU_USAGE - Outdated, use `EWW_CPU` instead
"EWW_CPU_USAGE" => {
log::warn!("EWW_CPU_BATTERY is deprecated, use EWW_CPU instead");
|| Ok(DynVal::from(get_cpus()))
},
// @desc EWW_NET - Bytes up/down on all interfaces // @desc EWW_NET - Bytes up/down on all interfaces
"EWW_NET" => || Ok(DynVal::from(net())), "EWW_NET" => || Ok(DynVal::from(net())),

View file

@ -40,7 +40,7 @@ pub fn get_ram() -> String {
) )
} }
pub fn get_core_temperatures() -> String { pub fn get_temperatures() -> String {
let mut c = SYSTEM.lock().unwrap(); let mut c = SYSTEM.lock().unwrap();
c.refresh_components_list(); c.refresh_components_list();
c.refresh_components(); c.refresh_components();