Hello all,
I've had great success connecting my external monitor to my netbook so that I can use a full-size display, but the setup is currently somewhat inconvenient in its current form. I often have to switch back to the built-in display to take the computer elsewhere, and to do that requires going into the gnome monitor panel and reconfiguring everything. What I'd like would be a series of commands I could use to switch the configuration from one monitor to the other. Even better would be a script which would automatically switch to the big display when it's connected, and vice-versa. Any suggestions?
Just to be clear, I'm not using a multiple-monitor setup here... I only use one at a time.
Multiple monitor control from command line
Forum rules
LMDE 2 has reached end of support as of 1-1-2019
LMDE 2 has reached end of support as of 1-1-2019
Multiple monitor control from command line
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Multiple monitor control from command line
Code: Select all
xrandr --output LVDS1 --auto
Code: Select all
xrandr --output LVDS1 --off
Hope that helps.
As for the scripting of connected vs not connected, I'm sure one of our talented gurus probably can come up with something.
Re: Multiple monitor control from command line
Thanks! This has allowed me to create the following little script:
It doesn't work on its own, but it's still much faster than doing it through the gnome panels.
Code: Select all
#!/bin/bash
echo "MAIN SCREEN TURN ON. Please choose (l)aptop or (m)ain:"
read CHOICE
case $CHOICE in
l)xrandr --output LVDS1 --auto
xrandr --output VGA1 --off
echo "For Great Justice.";;
m)xrandr --output VGA1 --auto
xrandr --output LVDS1 --off
echo "For Great Justice.";;
*)echo "Somebody set up us the bomb.";;
esac
Re: Multiple monitor control from command line
This might be useful for you as well - you can set your primary monitor, and positioning as well
That's what I use:
setup monitors
unset
That's what I use:
setup monitors
Code: Select all
xrandr --output LVDS1 --primary
xrandr --output VGA1 --auto --pos 0x0 --output LVDS1 --auto --below VGA1
Code: Select all
xrandr --output VGA1 --off --output LVDS1 --auto