diff --git a/src/config.rs b/src/config.rs index af432ea..1abbcd7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,10 +1,4 @@ //! # rwmstatus configuration -/// Path to monitors. -pub const HW_MON_PATH: &str = "/sys/devices/virtual/hwmon"; - -/// Path to power supply information. -pub const BATT_PATH: &str = "/sys/class/power_supply"; - /// Additional time zones to display (short name, full name). pub const TZS: [(char, &str); 2] = [('A', "America/Buenos_Aires"), ('U', "UTC")]; diff --git a/src/lib.rs b/src/lib.rs index b342610..3d45943 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -103,10 +103,10 @@ struct Tz { impl RwmStatus { /// Build a new RwmStatus object. This function collects all the monitor /// and battery paths for later use. - pub fn new(hw_mon_path: &str, batt_path: &str, tzs: &[(char, &str)]) -> RwmStatus { + pub fn new(tzs: &[(char, &str)]) -> RwmStatus { RwmStatus { - hw_mons: RwmStatus::get_paths(hw_mon_path, "hwmon"), - batts: RwmStatus::get_paths(batt_path, "BAT"), + hw_mons: RwmStatus::get_paths("/sys/devices/virtual/hwmon", "hwmon"), + batts: RwmStatus::get_paths("/sys/class/power_supply", "BAT"), tzs: tzs.iter() .map(|tz| { Tz { diff --git a/src/main.rs b/src/main.rs index 36a1527..c793b22 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,7 @@ fn main() { std::process::exit(1); } - let rwmstatus = RwmStatus::new(config::HW_MON_PATH, config::BATT_PATH, &config::TZS[..]); + let rwmstatus = RwmStatus::new(&config::TZS[..]); let mut stats = vec![]; loop {