1

To configure my displays for lightdm, I use the display-setup-script option in /etc/lightdm/lightdm.conf

If I point it to an actual script

if xrandr | grep -q "HDMI-1 connected"; then
    xrandr --output eDP-1 --mode 1920x1080 --output HDMI-1 --mode 1920x1080 --same-as eDP-1
else
    xrandr --output eDP-1 --mode 1920x1080
fi

it works just fine.

But if I use a one-liner like

display-setup-script=if xrandr | grep -q "HDMI-1 connected"; then xrandr --output eDP-1 --mode 1920x1080 --output HDMI-1 --mode 1920x1080 --same-as eDP-1; else xrandr --output eDP-1 --mode 1920x1080; fi

this fails. Why does this happen?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.