From 25f31b19f6a71306119bc4381115bf710c8d3948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20L=2E=20Treffenst=C3=A4dt?= Date: Fri, 2 Nov 2018 22:50:01 +0100 Subject: [PATCH] formatting is hard. --- src/modules/battery.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 0986fff1..83ebd08f 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -34,7 +34,6 @@ waybar::modules::Battery::Battery(const Json::Value& config) for (auto const& bat : batteries_) { inotify_add_watch(fd_, (bat / "uevent").c_str(), IN_ACCESS); } - old_status_ = ""; worker(); } @@ -67,7 +66,7 @@ std::tuple waybar::modules::Battery::getInfos() { try { uint16_t total = 0; - std::string status; + std::string status = "Unknown"; for (auto const& bat : batteries_) { uint16_t capacity; std::string _status; @@ -125,9 +124,9 @@ auto waybar::modules::Battery::update() -> void old_status_ = status; if (!state.empty() && config_["format-" + status + "-" + state].isString()) { format = config_["format-" + status + "-" + state].asString(); - }else if (config_["format-" + status].isString()) { + } else if (config_["format-" + status].isString()) { format = config_["format-" + status].asString(); - }else if (!state.empty() && config_["format-" + state].isString()) { + } else if (!state.empty() && config_["format-" + state].isString()) { format = config_["format-" + state].asString(); } if (format.empty()) {