fix: lint
parent
f26efae569
commit
8ef4ddd7ef
|
@ -181,7 +181,8 @@ static bool status_gt(const std::string& a, const std::string& b) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::tuple<uint8_t, float, std::string, float, uint16_t, float> waybar::modules::Battery::getInfos() {
|
std::tuple<uint8_t, float, std::string, float, uint16_t, float>
|
||||||
|
waybar::modules::Battery::getInfos() {
|
||||||
std::lock_guard<std::mutex> guard(battery_list_mutex_);
|
std::lock_guard<std::mutex> guard(battery_list_mutex_);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -596,7 +597,8 @@ std::tuple<uint8_t, float, std::string, float, uint16_t, float> waybar::modules:
|
||||||
// still charging but not yet done
|
// still charging but not yet done
|
||||||
if (cap == 100 && status == "Charging") status = "Full";
|
if (cap == 100 && status == "Charging") status = "Full";
|
||||||
|
|
||||||
return {cap, time_remaining, status, total_power / 1e6, mainBatCycleCount, mainBatHealthPercent};
|
return {
|
||||||
|
cap, time_remaining, status, total_power / 1e6, mainBatCycleCount, mainBatHealthPercent};
|
||||||
#endif
|
#endif
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
spdlog::error("Battery: {}", e.what());
|
spdlog::error("Battery: {}", e.what());
|
||||||
|
@ -686,12 +688,11 @@ auto waybar::modules::Battery::update() -> void {
|
||||||
} else if (config_["tooltip-format"].isString()) {
|
} else if (config_["tooltip-format"].isString()) {
|
||||||
tooltip_format = config_["tooltip-format"].asString();
|
tooltip_format = config_["tooltip-format"].asString();
|
||||||
}
|
}
|
||||||
label_.set_tooltip_text(fmt::format(fmt::runtime(tooltip_format),
|
label_.set_tooltip_text(
|
||||||
fmt::arg("timeTo", tooltip_text_default),
|
fmt::format(fmt::runtime(tooltip_format), fmt::arg("timeTo", tooltip_text_default),
|
||||||
fmt::arg("power", power), fmt::arg("capacity", capacity),
|
fmt::arg("power", power), fmt::arg("capacity", capacity),
|
||||||
fmt::arg("time", time_remaining_formatted),
|
fmt::arg("time", time_remaining_formatted), fmt::arg("cycles", cycles),
|
||||||
fmt::arg("cycles", cycles),
|
fmt::arg("health", fmt::format("{:.3}", health))));
|
||||||
fmt::arg("health", fmt::format("{:.3}", health))));
|
|
||||||
}
|
}
|
||||||
if (!old_status_.empty()) {
|
if (!old_status_.empty()) {
|
||||||
label_.get_style_context()->remove_class(old_status_);
|
label_.get_style_context()->remove_class(old_status_);
|
||||||
|
@ -710,10 +711,10 @@ auto waybar::modules::Battery::update() -> void {
|
||||||
} else {
|
} else {
|
||||||
event_box_.show();
|
event_box_.show();
|
||||||
auto icons = std::vector<std::string>{status + "-" + state, status, state};
|
auto icons = std::vector<std::string>{status + "-" + state, status, state};
|
||||||
label_.set_markup(fmt::format(
|
label_.set_markup(
|
||||||
fmt::runtime(format), fmt::arg("capacity", capacity), fmt::arg("power", power),
|
fmt::format(fmt::runtime(format), fmt::arg("capacity", capacity), fmt::arg("power", power),
|
||||||
fmt::arg("icon", getIcon(capacity, icons)), fmt::arg("time", time_remaining_formatted),
|
fmt::arg("icon", getIcon(capacity, icons)),
|
||||||
fmt::arg("cycles", cycles)));
|
fmt::arg("time", time_remaining_formatted), fmt::arg("cycles", cycles)));
|
||||||
}
|
}
|
||||||
// Call parent update
|
// Call parent update
|
||||||
ALabel::update();
|
ALabel::update();
|
||||||
|
|
|
@ -423,9 +423,7 @@ void waybar::modules::Clock::cldShift_up() {
|
||||||
void waybar::modules::Clock::cldShift_down() {
|
void waybar::modules::Clock::cldShift_down() {
|
||||||
cldCurrShift_ -= (months)((cldMode_ == CldMode::YEAR) ? 12 : 1) * cldShift_;
|
cldCurrShift_ -= (months)((cldMode_ == CldMode::YEAR) ? 12 : 1) * cldShift_;
|
||||||
}
|
}
|
||||||
void waybar::modules::Clock::cldShift_reset() {
|
void waybar::modules::Clock::cldShift_reset() { cldCurrShift_ = (months)0; }
|
||||||
cldCurrShift_ = (months)0;
|
|
||||||
}
|
|
||||||
void waybar::modules::Clock::tz_up() {
|
void waybar::modules::Clock::tz_up() {
|
||||||
const auto tzSize{tzList_.size()};
|
const auto tzSize{tzList_.size()};
|
||||||
if (tzSize == 1) return;
|
if (tzSize == 1) return;
|
||||||
|
|
Loading…
Reference in New Issue