2

I set the display settings of my laptop so that when an external screen is plugged in, only the external screen is used. However, when I plug it in after being logged into Ubuntu, it stays as if no screen was plugged in. That is not a big problem since the display settings refresh after I go into "System Settings" > "Displays".

That is kind of unhandy, so I would like to use the terminal to refresh the display settings. I guess it has something to do with an xrandr command. I tried xrandr --dryrun, this works but outputs a lot of stuff. It doesn't seem to be the right command.

What is the correct command?

2 Answers 2

1

You can use the following command:

xrandr --auto && xrandr --output --left-of

or

xrandr --auto && xrandr --output --right-of

depending how your screen are arranged in System SettingsDisplays.

See man xrandr for more info.

3
  • I tried this, too. But it turns on the external screen as well as the laptop screen. The latter one I want to be inactivated.
    – aldorado
    Oct 11, 2013 at 7:43
  • @aldorado Then use xrandr --auto && xrandr --output --left-of (or xrandr --auto && xrandr --output --right-of). I told you to see man xrandr. Oct 11, 2013 at 7:55
  • This did not work for me for some reason, but combining xrandr auto by && helped me to get to a command that works for me. Thanks a lot! I will write it down as a possible answer.
    – aldorado
    Oct 11, 2013 at 8:17
0

For some reason the first answer did not work for me, but it brought me to to this command, which seems to do what I want:

xrandr --auto && xrandr --output LVDS --off

I will create an alias in the .bashrc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .