1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-01 10:41:03 +02:00

docs(script): add information on new mode options

This commit is contained in:
Jake Stanger 2022-11-06 23:04:24 +00:00
parent b4db0226cd
commit 8c774100f1
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61

View file

@ -5,10 +5,17 @@ Pango markup is supported.
> Type: `script` > Type: `script`
| Name | Type | Default | Description | | Name | Type | Default | Description |
|-----------|----------|---------|---------------------------------------------------------| |------------|-----------------------|---------|---------------------------------------------------------|
| `path` | `string` | `null` | Path to the script on disk | | `path` | `string` | `null` | Path to the script on disk |
| `interval` | `number` | `5000` | Number of milliseconds to wait between executing script | | `mode` | `'poll'` or `'watch'` | `poll` | See [#modes](#modes) |
| `interval` | `number` | `5000` | Number of milliseconds to wait between executing script |
### Modes
- Use `poll` to run the script wait for it to exit. On exit, the label is updated to show everything the script wrote to `stdout`.
- Use `watch` to start a long-running script. Every time the script writes to `stdout`, the label is updated to show the latest line.
Note this does not work for all programs as they may use block-buffering instead of line-buffering when they detect output being piped.
<details> <details>
<summary>JSON</summary> <summary>JSON</summary>
@ -19,6 +26,7 @@ Pango markup is supported.
{ {
"type": "script", "type": "script",
"path": "/home/jake/.local/bin/phone-battery", "path": "/home/jake/.local/bin/phone-battery",
"mode": "poll",
"interval": 5000 "interval": 5000
} }
] ]
@ -35,6 +43,7 @@ Pango markup is supported.
[[end]] [[end]]
type = "script" type = "script"
path = "/home/jake/.local/bin/phone-battery" path = "/home/jake/.local/bin/phone-battery"
mode = "poll"
interval = 5000 interval = 5000
``` ```
@ -47,6 +56,7 @@ interval = 5000
end: end:
- type: "script" - type: "script"
path: "/home/jake/.local/bin/phone-battery" path: "/home/jake/.local/bin/phone-battery"
mode: 'poll'
interval : 5000 interval : 5000
``` ```
@ -61,6 +71,7 @@ end:
{ {
type = "script" type = "script"
path = "/home/jake/.local/bin/phone-battery" path = "/home/jake/.local/bin/phone-battery"
mode = "poll"
interval = 5000 interval = 5000
} }
] ]