fix: Code formatting for clang-format/lint CI
This commit is contained in:
@ -1,8 +1,9 @@
|
|||||||
#include "modules/battery.hpp"
|
#include "modules/battery.hpp"
|
||||||
#include "util/command.hpp"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
||||||
|
#include "util/command.hpp"
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__)
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
@ -771,17 +772,15 @@ void waybar::modules::Battery::setBarClass(std::string& state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void waybar::modules::Battery::processEvents(std::string& state, std::string& status, uint8_t capacity) {
|
void waybar::modules::Battery::processEvents(std::string& state, std::string& status,
|
||||||
|
uint8_t capacity) {
|
||||||
// There are no events specified, skip
|
// There are no events specified, skip
|
||||||
auto events = config_["events"];
|
auto events = config_["events"];
|
||||||
if (!events.isObject() || events.empty()) {
|
if (!events.isObject() || events.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::string event_name = fmt::format(
|
std::string event_name = fmt::format("on-{}-{}", status == "discharging" ? status : "charging",
|
||||||
"on-{}-{}",
|
state.empty() ? std::to_string(capacity) : state);
|
||||||
status == "discharging" ? status : "charging",
|
|
||||||
state.empty() ? std::to_string(capacity) : state
|
|
||||||
);
|
|
||||||
if (last_event_ != event_name) {
|
if (last_event_ != event_name) {
|
||||||
spdlog::debug("battery: triggering event {}", event_name);
|
spdlog::debug("battery: triggering event {}", event_name);
|
||||||
if (events[event_name].isString()) {
|
if (events[event_name].isString()) {
|
||||||
|
Reference in New Issue
Block a user