1

I have the following in my .xinitrc:

xrandr --output eDP-1 --off
xrandr --output HDMI-1 --off

# set monitors
if [ xrandr -q | grep 'HDMI-1 connected' | wc -l == 1 ] ; then
    xrandr --output HDMI-1 --primary --mode 2560x1080
    xrandr --output eDP-1 --mode 2560x1440 --right-of HDMI-1
else
    xrandr --output eDP-1 --primary --mode 2560x1440
fi

The output of xrandr -q | grep 'HDMI-1 connected' | wc -l is 1 when HDMI-1 is plugged in. Both monitors work fine, but HDMI-1 is not primary and eDP-1 is. In addition if I switch the --right-of to --left-of I see no difference. It looks to me like there's something else setting the monitors. Removing these lines however disables HDMI-1 so I'm not sure what's going on.

A bit of system info: I'm using a lenovo laptop with bspwm and lightdm. If you need more info please let me know.

EDIT: Just putting the lines

xrandr --output HDMI-1 --primary --mode 2560x1080
xrandr --output eDP-1 --mode 2560x1440 --right-of HDMI-1

into my .xinitrc without the conditional doesn't work either.

0 Answers0