Fallback on non-existent displays
I use this command to reset monitor setup back to the defaults.
xrandr --verbose \
--output eDP-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal \
--output DP-1 --off \
--output DP-2 --off \
--output HDMI-1 --off \
Problem is that this command fails when one of the DP-1 is not connected. Is there a way to make this so that:
- If a monitor is attached, apply the specified command
- If not, do not fail, and proceed with the other monitors.