From ce05aa36a1d542a553fbc827411e693a297c75ff Mon Sep 17 00:00:00 2001 From: NBonaparte Date: Tue, 29 Aug 2017 15:10:28 -0700 Subject: [PATCH] feat(temperature): Add hwmon sysfs support (#688) --- src/modules/temperature.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/temperature.cpp b/src/modules/temperature.cpp index db466516..60fbbce9 100644 --- a/src/modules/temperature.cpp +++ b/src/modules/temperature.cpp @@ -15,10 +15,13 @@ namespace modules { temperature_module::temperature_module(const bar_settings& bar, string name_) : timer_module(bar, move(name_)) { m_zone = m_conf.get(name(), "thermal-zone", 0); + m_path = m_conf.get(name(), "hwmon-path", ""s); m_tempwarn = m_conf.get(name(), "warn-temperature", 80); m_interval = m_conf.get(name(), "interval", 1s); - m_path = string_util::replace(PATH_TEMPERATURE_INFO, "%zone%", to_string(m_zone)); + if (m_path.empty()) { + m_path = string_util::replace(PATH_TEMPERATURE_INFO, "%zone%", to_string(m_zone)); + } if (!file_util::exists(m_path)) { throw module_error("The file '" + m_path + "' does not exist");