mirror of
https://github.com/Wojtek242/rwmstatus.git
synced 2024-11-21 15:15:25 +01:00
Hardware monitor and battery paths are not a configuration option
This commit is contained in:
parent
ce2fe133d5
commit
dc4e3c2c70
@ -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")];
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user