Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

niri/workspaces: Allow restricting the module to an output #3842

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions man/waybar-niri-workspaces.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Addressed by *niri/workspaces*
default: false ++
If set to false, workspaces will only be shown on the output they are on. If set to true all workspaces will be shown on every output.

*output*: ++
typeof: string ++
If set, only show workspaces for the output set.

*format*: ++
typeof: string ++
default: {value} ++
Expand Down
2 changes: 2 additions & 0 deletions src/modules/niri/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ void Workspaces::doUpdate() {
std::copy_if(workspaces.cbegin(), workspaces.cend(), std::back_inserter(my_workspaces),
[&](const auto &ws) {
if (alloutputs) return true;
if (config_["output"].isString())
return config_["output"].asString() == ws["output"].asString();
return ws["output"].asString() == bar_.output->name;
});

Expand Down