Merge pull request #2979 from grimpy/filterscratch

Filter out special output __i3 which contains scratchpad
pull/2983/head
Alexis Rouillard 2024-02-28 10:38:33 +01:00 committed by GitHub
commit e7c7ef6814
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 4 deletions

View File

@ -107,11 +107,16 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
auto payload = parser_.parse(res.payload);
workspaces_.clear();
std::vector<Json::Value> outputs;
bool alloutputs = config_["all-outputs"].asBool();
std::copy_if(payload["nodes"].begin(), payload["nodes"].end(), std::back_inserter(outputs),
[&](const auto &workspace) {
return !config_["all-outputs"].asBool()
? workspace["name"].asString() == bar_.output->name
: true;
[&](const auto &output) {
if (alloutputs && output["name"].asString() != "__i3") {
return true;
}
if (output["name"].asString() == bar_.output->name) {
return true;
}
return false;
});
for (auto &output : outputs) {