Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a laptop that is hooked up to a monitor via a VGA cable. I'm trying to get the display set to the external monitor only (I don't want any display on the laptop screen). However, whenever I set the laptop display to "off" in the "Displays" setting, their isn't a display on either (the laptop screen and the monitor have no signal). So, how do I get it to where the display only shows up on the external monitor?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You can use xrandr to change the default primary monitor.

Turns out xrandr --output DFP1 --primary does the trick. Replace DFP1 to the name of the monitor you want to make your primary monitor. You can run xrandr --prop to get the proper names of the monitors currently connected.

If you run xrandr --output DFP1 --primary, it does switch the primary monitors, but once you restart your laptop, the laptop becomes the primary display once again.

So, I thought I would write a simple script, that runs at start up, which checks, if there is an external monitor connected, and if there is, then run the command to make the external monitor the primary display.

#!/bin/bash
NR_OF_MONITORS=$(xrandr -d :0 -q | grep ' connected' | wc -l)
if [ $NR_OF_MONITORS = "2" ]; then
  xrandr --output DFP1 --primary
fi

Source

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.