Merge pull request #5073 from ar-turek/persistent_workspaces_by_monitor_make_and_model

[feat] `sway/workspaces`: refer to outputs by their monitor identifier in `persistent-workspaces`
This commit is contained in:
Alexis Rouillard
2026-07-03 22:53:48 +02:00
committed by GitHub
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -152,6 +152,7 @@ an empty list denoting all outputs.
"3": [], // Always show a workspace with name '3', on all outputs if it does not exist
"4": ["eDP-1"], // Always show a workspace with name '4', on output 'eDP-1' if it does not exist
"5": ["eDP-1", "DP-2"] // Always show a workspace with name '5', on outputs 'eDP-1' and 'DP-2' if it does not exist
"6": ["MonitorMaker 3000 ABC0123"], // Always show a workspace with name '6' on outputs with an identifier 'MonitorMaker 3000 ABC0123' (usually a triple of vendor/model/serial)
}
}
```
+2 -1
View File
@@ -175,7 +175,8 @@ void Workspaces::onCmd(const struct Ipc::ipc_response& res) {
if (p_w.isArray() && !p_w.empty()) {
// Adding to target outputs
for (const Json::Value& output : p_w) {
if (output.asString() == bar_.output->name) {
auto output_name = output.asString();
if (output_name == bar_.output->name || output_name == bar_.output->identifier) {
Json::Value v;
v["name"] = p_w_name;
v["target_output"] = bar_.output->name;