feat(niri/workspaces): add window icons via window-rewrite
Adds format-window-separator, window-rewrite and window-rewrite-default
options plus the {windows} format replacement to the niri/workspaces
module (rebased onto master; coexists with ignore-workspaces).
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "AModule.hpp"
|
||||
#include "bar.hpp"
|
||||
#include "modules/niri/backend.hpp"
|
||||
#include "util/regex_collection.hpp" // Added for rewrite rules
|
||||
|
||||
namespace waybar::modules::niri {
|
||||
|
||||
@@ -26,6 +27,10 @@ class Workspaces : public AModule, public EventHandler {
|
||||
std::string getIcon(const std::string& value, const Json::Value& ws);
|
||||
bool isWorkspaceIgnored(const std::string& name);
|
||||
bool handleScroll(GdkEventScroll* /*unused*/) override;
|
||||
// Added for window rewrite
|
||||
void populateWindowRewriteConfig();
|
||||
void populateFormatWindowSeparatorConfig();
|
||||
std::string getRewrite(const std::string& app_id, const std::string& title);
|
||||
|
||||
const Bar& bar_;
|
||||
Gtk::Box box_;
|
||||
@@ -37,6 +42,12 @@ class Workspaces : public AModule, public EventHandler {
|
||||
bool sort_by_id_ = false;
|
||||
bool sort_by_name_ = false;
|
||||
bool sort_by_coordinates_ = false;
|
||||
|
||||
// Added for window rewrite
|
||||
util::RegexCollection m_windowRewriteRules;
|
||||
std::string m_windowRewriteDefault;
|
||||
std::string m_formatWindowSeparator;
|
||||
|
||||
};
|
||||
|
||||
} // namespace waybar::modules::niri
|
||||
|
||||
Reference in New Issue
Block a user