Merge pull request #4127 from iostapyshyn/master

niri/workspaces: Add empty icon
This commit is contained in:
Alexis Rouillard
2025-06-22 08:45:13 +01:00
committed by GitHub
2 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,7 @@ Additional to workspace name matching, the following *format-icons* can be set.
- *default*: Will be shown, when no string matches are found. - *default*: Will be shown, when no string matches are found.
- *focused*: Will be shown, when workspace is focused. - *focused*: Will be shown, when workspace is focused.
- *active*: Will be shown, when workspace is active on its output. - *active*: Will be shown, when workspace is active on its output.
- *empty*: Will be shown, when workspace is empty.
# EXAMPLES # EXAMPLES

View File

@ -166,6 +166,8 @@ std::string Workspaces::getIcon(const std::string &value, const Json::Value &ws)
const auto &icons = config_["format-icons"]; const auto &icons = config_["format-icons"];
if (!icons) return value; if (!icons) return value;
if (ws["active_window_id"].isNull() && icons["empty"]) return icons["empty"].asString();
if (ws["is_focused"].asBool() && icons["focused"]) return icons["focused"].asString(); if (ws["is_focused"].asBool() && icons["focused"]) return icons["focused"].asString();
if (ws["is_active"].asBool() && icons["active"]) return icons["active"].asString(); if (ws["is_active"].asBool() && icons["active"]) return icons["active"].asString();