mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix(battery): use path for the / operator
This commit is contained in:
@ -8,11 +8,8 @@ waybar::modules::Temperature::Temperature(const std::string& id, const Json::Val
|
||||
auto zone = config_["thermal-zone"].isInt() ? config_["thermal-zone"].asInt() : 0;
|
||||
file_path_ = fmt::format("/sys/class/thermal/thermal_zone{}/temp", zone);
|
||||
}
|
||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
||||
if (!std::experimental::filesystem::exists(file_path_)) {
|
||||
#else
|
||||
if (!std::filesystem::exists(file_path_)) {
|
||||
#endif
|
||||
std::ifstream temp(file_path_);
|
||||
if (!temp.is_open()) {
|
||||
throw std::runtime_error("Can't open " + file_path_);
|
||||
}
|
||||
label_.set_name("temperature");
|
||||
|
Reference in New Issue
Block a user