I'm new to bash scripting, and I'm trying to configure my video outputs so that my laptop display gets turned off when I connect an external monitor via VGA.
That's the script I came up with, pretty straightforward:
#!/bin/bash myvar="$(xrandr -q)" if [[ $myvar == *"VGA connected"* ]] then xrandr --output VGA --auto; xrandr --output LVDS --off; else xrandr --output LVDS --auto; fi
All is working as it should except for the
xrandr --output LVDS --off bit, as my laptop display simply adjusts its resolution to match the external monitor's one and stays on.
Can't figure out the bug on this one. Any help is appreciated.