diff --git a/src/AAppIconLabel.cpp b/src/AAppIconLabel.cpp index 55de78f5..b72906c3 100644 --- a/src/AAppIconLabel.cpp +++ b/src/AAppIconLabel.cpp @@ -158,7 +158,8 @@ void AAppIconLabel::updateAppIcon() { } else if (app_icon_name_.front() == '/') { try { int scaled_icon_size = app_icon_size_ * image_.get_scale_factor(); - auto pixbuf = Gdk::Pixbuf::create_from_file(app_icon_name_, scaled_icon_size, scaled_icon_size); + auto pixbuf = + Gdk::Pixbuf::create_from_file(app_icon_name_, scaled_icon_size, scaled_icon_size); auto surface = Gdk::Cairo::create_surface_from_pixbuf(pixbuf, image_.get_scale_factor(), image_.get_window()); diff --git a/src/main.cpp b/src/main.cpp index 166dd2bb..9d7d0ba2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -142,7 +142,7 @@ static void handleSignalMainThread(int signum, bool& reload) { spdlog::debug("Received SIGCHLD in signalThread"); { std::lock_guard lock(reap_mtx); - for (auto it = reap.begin(); it != reap.end(); ) { + for (auto it = reap.begin(); it != reap.end();) { if (waitpid(*it, nullptr, WNOHANG) == *it) { spdlog::debug("Reaped child with PID: {}", *it); it = reap.erase(it); diff --git a/src/modules/cpu_usage/common.cpp b/src/modules/cpu_usage/common.cpp index 82126dac..1571cb74 100644 --- a/src/modules/cpu_usage/common.cpp +++ b/src/modules/cpu_usage/common.cpp @@ -80,7 +80,8 @@ std::tuple, std::string> waybar::modules::CpuUsage::getCpu auto [prev_idle, prev_total] = prev_times[0]; const float delta_idle = curr_idle - prev_idle; const float delta_total = curr_total - prev_total; - uint16_t tmp = (delta_total > 0) ? static_cast(100 * (1 - delta_idle / delta_total)) : 0; + uint16_t tmp = + (delta_total > 0) ? static_cast(100 * (1 - delta_idle / delta_total)) : 0; tooltip = fmt::format("Total: {}%\nCores: (pending)", tmp); usage.push_back(tmp); } else { @@ -102,7 +103,8 @@ std::tuple, std::string> waybar::modules::CpuUsage::getCpu } const float delta_idle = curr_idle - prev_idle; const float delta_total = curr_total - prev_total; - uint16_t tmp = (delta_total > 0) ? static_cast(100 * (1 - delta_idle / delta_total)) : 0; + uint16_t tmp = + (delta_total > 0) ? static_cast(100 * (1 - delta_idle / delta_total)) : 0; if (i == 0) { tooltip = fmt::format("Total: {}%", tmp); } else { diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 0dbdcc57..34dcc03c 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -45,7 +45,7 @@ waybar::modules::Network::readBandwidthUsage() { std::istringstream iss(line); std::string ifacename; - iss >> ifacename; // ifacename contains "eth0:" + iss >> ifacename; // ifacename contains "eth0:" if (ifacename.empty()) continue; ifacename.pop_back(); // remove trailing ':' if (ifacename != ifname_) { diff --git a/src/modules/sndio.cpp b/src/modules/sndio.cpp index 46bffdc2..d878c4a4 100644 --- a/src/modules/sndio.cpp +++ b/src/modules/sndio.cpp @@ -102,9 +102,9 @@ Sndio::~Sndio() { sioctl_close(hdl_); } auto Sndio::update() -> void { auto format = format_; - unsigned int vol = (maxval_ > 0) - ? static_cast(100. * static_cast(volume_) / static_cast(maxval_)) - : 0; + unsigned int vol = (maxval_ > 0) ? static_cast(100. * static_cast(volume_) / + static_cast(maxval_)) + : 0; if (volume_ == 0) { label_.get_style_context()->add_class("muted"); diff --git a/src/modules/upower.cpp b/src/modules/upower.cpp index 3006a34a..8202b718 100644 --- a/src/modules/upower.cpp +++ b/src/modules/upower.cpp @@ -62,7 +62,8 @@ UPower::UPower(const std::string& id, const Json::Value& config) GError* gErr = NULL; upClient_ = up_client_new_full(NULL, &gErr); if (upClient_ == NULL) { - spdlog::error("Upower. UPower client connection error. {}", gErr ? gErr->message : "unknown error"); + spdlog::error("Upower. UPower client connection error. {}", + gErr ? gErr->message : "unknown error"); if (gErr) g_error_free(gErr); } diff --git a/src/util/backlight_backend.cpp b/src/util/backlight_backend.cpp index c7a2b046..61eb9b43 100644 --- a/src/util/backlight_backend.cpp +++ b/src/util/backlight_backend.cpp @@ -79,20 +79,38 @@ static void upsert_device(std::vector& devices, udev_device* de }); if (found != devices.end()) { if (actual != nullptr) { - try { found->set_actual(std::stoi(actual)); } catch (const std::exception&) {} + try { + found->set_actual(std::stoi(actual)); + } catch (const std::exception&) { + } } if (max != nullptr) { - try { found->set_max(std::stoi(max)); } catch (const std::exception&) {} + try { + found->set_max(std::stoi(max)); + } catch (const std::exception&) { + } } if (power != nullptr) { - try { found->set_powered(std::stoi(power) == 0); } catch (const std::exception&) {} + try { + found->set_powered(std::stoi(power) == 0); + } catch (const std::exception&) { + } } } else { int actual_int = 0, max_int = 0; bool power_bool = true; - try { if (actual != nullptr) actual_int = std::stoi(actual); } catch (const std::exception&) {} - try { if (max != nullptr) max_int = std::stoi(max); } catch (const std::exception&) {} - try { if (power != nullptr) power_bool = std::stoi(power) == 0; } catch (const std::exception&) {} + try { + if (actual != nullptr) actual_int = std::stoi(actual); + } catch (const std::exception&) { + } + try { + if (max != nullptr) max_int = std::stoi(max); + } catch (const std::exception&) { + } + try { + if (power != nullptr) power_bool = std::stoi(power) == 0; + } catch (const std::exception&) { + } devices.emplace_back(name, actual_int, max_int, power_bool); } } diff --git a/src/util/portal.cpp b/src/util/portal.cpp index 0aa78cb9..e2be97c7 100644 --- a/src/util/portal.cpp +++ b/src/util/portal.cpp @@ -63,7 +63,8 @@ void waybar::Portal::refreshAppearance() { Glib::VariantBase modev; container.get_child(modev, 0); auto mode = - Glib::VariantBase::cast_dynamic>>>(modev) + Glib::VariantBase::cast_dynamic>>>( + modev) .get() .get() .get();