fix: lint

This commit is contained in:
Alex
2025-06-22 10:01:36 +02:00
parent f27df33280
commit ee91d18ad9
8 changed files with 50 additions and 55 deletions

View File

@ -1,4 +1,5 @@
#include "modules/gps.hpp"
#include <gps.h>
#include <spdlog/spdlog.h>
@ -19,11 +20,11 @@ namespace {
constexpr const char* DEFAULT_FORMAT = "{mode}";
} // namespace
waybar::modules::Gps::Gps(const std::string& id, const Json::Value& config)
: ALabel(config, "gps", id, "{}", 5)
#ifdef WANT_RFKILL
,rfkill_{RFKILL_TYPE_GPS}
,
rfkill_{RFKILL_TYPE_GPS}
#endif
{
thread_ = [this] {
@ -131,7 +132,8 @@ const std::string waybar::modules::Gps::getFixStatusString() const {
auto waybar::modules::Gps::update() -> void {
sleep(0); // Wait for gps status change
if ((gps_data_.fix.mode == MODE_NOT_SEEN && hideDisconnected) || (gps_data_.fix.mode == MODE_NO_FIX && hideNoFix)) {
if ((gps_data_.fix.mode == MODE_NOT_SEEN && hideDisconnected) ||
(gps_data_.fix.mode == MODE_NO_FIX && hideNoFix)) {
event_box_.set_visible(false);
return;
}
@ -163,7 +165,6 @@ auto waybar::modules::Gps::update() -> void {
state_ = state;
}
auto format = format_;
fmt::dynamic_format_arg_store<fmt::format_context> store;
@ -213,5 +214,3 @@ waybar::modules::Gps::~Gps() {
gps_stream(&gps_data_, WATCH_DISABLE, NULL);
gps_close(&gps_data_);
}

View File

@ -68,7 +68,8 @@ void Language::onEvent(const std::string& ev) {
std::string kbName(begin(ev) + ev.find_last_of('>') + 1, begin(ev) + ev.find_first_of(','));
// Last comma before variants parenthesis, eg:
// activelayout>>micro-star-int'l-co.,-ltd.-msi-gk50-elite-gaming-keyboard,English (US, intl., with dead keys)
// activelayout>>micro-star-int'l-co.,-ltd.-msi-gk50-elite-gaming-keyboard,English (US, intl.,
// with dead keys)
std::string beforParenthesis(begin(ev), begin(ev) + ev.find_last_of('('));
auto layoutName = ev.substr(beforParenthesis.find_last_of(',') + 1);

View File

@ -791,25 +791,21 @@ void Workspaces::sortSpecialCentered() {
size_t center = normalWorkspaces.size() / 2;
m_workspaces.insert(m_workspaces.end(),
std::make_move_iterator(normalWorkspaces.begin()),
m_workspaces.insert(m_workspaces.end(), std::make_move_iterator(normalWorkspaces.begin()),
std::make_move_iterator(normalWorkspaces.begin() + center));
m_workspaces.insert(m_workspaces.end(),
std::make_move_iterator(specialWorkspaces.begin()),
m_workspaces.insert(m_workspaces.end(), std::make_move_iterator(specialWorkspaces.begin()),
std::make_move_iterator(specialWorkspaces.end()));
m_workspaces.insert(m_workspaces.end(),
std::make_move_iterator(normalWorkspaces.begin() + center),
std::make_move_iterator(normalWorkspaces.end()));
m_workspaces.insert(m_workspaces.end(),
std::make_move_iterator(hiddenWorkspaces.begin()),
m_workspaces.insert(m_workspaces.end(), std::make_move_iterator(hiddenWorkspaces.begin()),
std::make_move_iterator(hiddenWorkspaces.end()));
}
void Workspaces::sortWorkspaces() {
std::ranges::sort( //
m_workspaces, [&](std::unique_ptr<Workspace> &a, std::unique_ptr<Workspace> &b) {
// Helper comparisons

View File

@ -172,7 +172,6 @@ std::string Workspaces::getIcon(const std::string &value, const Json::Value &ws)
const auto &icons = config_["format-icons"];
if (!icons) return value;
if (ws["is_urgent"].asBool() && icons["urgent"]) return icons["urgent"].asString();
if (ws["active_window_id"].isNull() && icons["empty"]) return icons["empty"].asString();