feat(hyprland/workspaces): add uniqueIcons option
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <json/value.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@@ -95,7 +96,10 @@ void Workspace::insertWindow(WindowCreationPayload create_window_payload) {
|
||||
if (!create_window_payload.isEmpty(m_workspaceManager)) {
|
||||
auto repr = create_window_payload.repr(m_workspaceManager);
|
||||
|
||||
if (!repr.empty()) {
|
||||
if (!repr.empty() && (!m_workspaceManager.uniqueIcons() ||
|
||||
std::ranges::find_if(m_windowMap, [&repr](const auto &x) {
|
||||
return x.second == repr;
|
||||
}) == m_windowMap.end())) {
|
||||
m_windowMap[create_window_payload.getAddress()] = repr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,6 +609,7 @@ auto Workspaces::parseConfig(const Json::Value &config) -> void {
|
||||
populateBoolConfig(config, "persistent-only", m_persistentOnly);
|
||||
populateBoolConfig(config, "active-only", m_activeOnly);
|
||||
populateBoolConfig(config, "move-to-monitor", m_moveToMonitor);
|
||||
populateBoolConfig(config, "unique-icons", m_uniqueIcons);
|
||||
|
||||
m_persistentWorkspaceConfig = config.get("persistent-workspaces", Json::Value());
|
||||
populateSortByConfig(config);
|
||||
@@ -1038,4 +1039,4 @@ std::optional<int> Workspaces::parseWorkspaceId(std::string const &workspaceIdSt
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
} // namespace waybar::modules::hyprland
|
||||
|
||||
Reference in New Issue
Block a user