Merge pull request #4683 from RaphaelKimmig/master

feat: allow sorting niri workspaces
This commit is contained in:
Alexis Rouillard
2026-07-03 22:44:26 +02:00
committed by GitHub
3 changed files with 108 additions and 4 deletions
+7
View File
@@ -3,6 +3,8 @@
#include <gtkmm/button.h>
#include <json/value.h>
#include <vector>
#include "AModule.hpp"
#include "bar.hpp"
#include "modules/niri/backend.hpp"
@@ -18,6 +20,7 @@ class Workspaces : public AModule, public EventHandler {
private:
void onEvent(const Json::Value& ev) override;
void doUpdate();
void sortWorkspaces(std::vector<Json::Value>& workspaces) const;
Gtk::Button& addButton(const Json::Value& ws);
std::string getIcon(const std::string& value, const Json::Value& ws);
@@ -25,6 +28,10 @@ class Workspaces : public AModule, public EventHandler {
Gtk::Box box_;
// Map from niri workspace id to button.
std::unordered_map<uint64_t, Gtk::Button> buttons_;
bool sort_by_id_ = false;
bool sort_by_name_ = false;
bool sort_by_coordinates_ = false;
};
} // namespace waybar::modules::niri