1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-16 22:31:03 +02:00

fix(ipc): support querying against duplicate bar names

It is possible/valid to define multiple bars by the same name by setting `name` on the top-level bar object, but not specifying monitors. This updates IPC to support this scenario.

Allow IPC to act on multiple bars by the same name (#777)
This commit is contained in:
Ridan Vandenbergh 2024-11-16 21:48:12 +01:00 committed by GitHub
parent e7c56ee09b
commit 42e25f5ef2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 75 additions and 45 deletions

View file

@ -10,7 +10,8 @@ You can also view help per sub-command or command, for example using `ironbar va
The CLI supports plaintext and JSON output. Plaintext will:
- Print `ok` for empty success responses
- Print the returned body for success responses
- Print the returned body for each success response
- Some commands act on multiple objects, in which case the CLI will print one line for each body.
- Print `error` to followed by the error on the next line for error responses. This is printed to `stderr`.
Example:
@ -150,6 +151,9 @@ Each key/value pair is on its own `\n` separated newline. The key and value are
### `bar`
> [!NOTE]
> If there are multiple bars by the same name, the `bar` subcommand will act on all of them and return a `multi` response for commands that get a value.
#### `show`
Forces a bar to be shown, regardless of the current visibility state.
@ -324,6 +328,17 @@ The operation completed successfully, with response data.
}
```
### `multi`
The operation completed successfully on multiple objects, with response data.
```json
{
"type": "multi",
"values": ["lorem ipsum", "dolor sit"]
}
```
### `error`
The operation failed.
@ -335,4 +350,4 @@ Message is optional.
"type": "error",
"message": "lorem ipsum"
}
```
```