aboutsummaryrefslogtreecommitdiff
path: root/example/init
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-07-16 00:00:28 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2021-07-21 14:07:49 +0200
commitb7e15a8ef6b223fa5195fa9b149dc83764677429 (patch)
tree63ee36279183c403dabcdb70e4d2c5c96c2ef16b /example/init
parentdfa24711415a48edb0fed64e3c3feaaf61130c8b (diff)
downloadriver-b7e15a8ef6b223fa5195fa9b149dc83764677429.tar.gz
river-b7e15a8ef6b223fa5195fa9b149dc83764677429.tar.xz
river: make spawn command take only one argument
Currently the spawn command takes any number of arguments and naively joins them together with spaces before passing them as the single argument of `/bin/sh -c`. This however produces unexpected results as soon as shell quoting gets involved in the arguments passed to spawn. For example, running riverctl spawn foo "bar baz" will execute `/bin/sh -c "foo bar baz"`, unexpectedly splitting bar and baz into separate arguments. To avoid this confusion, make the spawn command take only a single argument, forcing the user to quote properly to spawn multi-argument commands.
Diffstat (limited to 'example/init')
-rwxr-xr-xexample/init20
1 files changed, 10 insertions, 10 deletions
diff --git a/example/init b/example/init
index ae85914..a00a5b1 100755
--- a/example/init
+++ b/example/init
@@ -122,22 +122,22 @@ riverctl map passthrough $mod F11 enter-mode normal
for mode in normal locked
do
# Eject the optical drive
- riverctl map $mode None XF86Eject spawn eject -T
+ riverctl map $mode None XF86Eject spawn 'eject -T'
# Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer)
- riverctl map $mode None XF86AudioRaiseVolume spawn pamixer -i 5
- riverctl map $mode None XF86AudioLowerVolume spawn pamixer -d 5
- riverctl map $mode None XF86AudioMute spawn pamixer --toggle-mute
+ riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5'
+ riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5'
+ riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute'
# Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
- riverctl map $mode None XF86AudioMedia spawn playerctl play-pause
- riverctl map $mode None XF86AudioPlay spawn playerctl play-pause
- riverctl map $mode None XF86AudioPrev spawn playerctl previous
- riverctl map $mode None XF86AudioNext spawn playerctl next
+ riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'
+ riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause'
+ riverctl map $mode None XF86AudioPrev spawn 'playerctl previous'
+ riverctl map $mode None XF86AudioNext spawn 'playerctl next'
# Control screen backlight brighness with light (https://github.com/haikarainen/light)
- riverctl map $mode None XF86MonBrightnessUp spawn light -A 5
- riverctl map $mode None XF86MonBrightnessDown spawn light -U 5
+ riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5'
+ riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5'
done
# Set repeat rate