Skip to content

Commit 766ed46

Browse files
committed
document slider command better
1 parent e688930 commit 766ed46

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎development/menu.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ ins menu slide --preset brightness # Brightness control
5555
ins menu slide --min 0 --max 100 --label "Brightness" --step 1
5656
```
5757

58+
### Custom commands on change
59+
60+
The `--command` flag runs a command whenever the slider value changes. The current value is appended as the final argument.
61+
62+
```bash
63+
# Set brightness using brightnessctl
64+
ins menu slide --min 0 --max 100 --label "Brightness" \
65+
--command brightnessctl set
66+
67+
# Log values to a file
68+
ins menu slide --min 0 --max 255 \
69+
--command sh -c 'echo "Value: $1" >> /tmp/slider.log'
70+
71+
# RGB color control
72+
ins menu slide --min 0 --max 255 --step 1 --big-step 16 \
73+
--label "Red" --command mycolorsetter --red
74+
```
75+
76+
Commands run asynchronously with output suppressed to avoid UI interference. The command only executes when the value actually changes.
77+
5878
## Chord navigator
5979

6080
Interactive tree-based selector where you type characters to navigate. Format: `sequence:description`.

0 commit comments

Comments
 (0)