Here is my program
#!/bin/bash
command="LVDS-1 --auto --right-of HDMI-1"
main_mon="LVDS-1"
position="--right-of"
aux_mon="HDMI-1"
# Don't work
# warning: output LVDS-1 --auto --right-of HDMI-1 not found; ignoring
xrandr --output "$command"
# Works
xrandr --output "$main_mon" --auto "$position" "$aux_mon"
As you can see if i “split” command
into several variables xrandr
is able to run the command, otherwise it don’t.
The output error is: warning: output LVDS-1 --auto --right-of HDMI-1 not found; ignoring
when using $command