feat(conf): Option to always show urgent workspaces in i3 (#2378)

When `pin-workspaces` is set to true using `show-urgent` will show
urgent workspaces on the bar even when the workspace is not associated
with the current monitor.
This commit is contained in:
zappolowski
2021-02-15 21:31:34 +01:00
committed by GitHub
parent 50f127f1bc
commit 99900323b7
5 changed files with 8 additions and 4 deletions

View File

@ -16,10 +16,10 @@ namespace i3_util {
/**
* Get all workspaces for given output
*/
vector<shared_ptr<workspace_t>> workspaces(const connection_t& conn, const string& output) {
vector<shared_ptr<workspace_t>> workspaces(const connection_t& conn, const string& output, const bool show_urgent) {
vector<shared_ptr<workspace_t>> result;
for (auto&& ws : conn.get_workspaces()) {
if (output.empty() || ws->output == output) {
if (output.empty() || ws->output == output || (show_urgent && ws->urgent)) {
result.emplace_back(forward<decltype(ws)>(ws));
}
}