Dual monitor problem

Leslie Katz lesliek at mymts.net
Sat Apr 7 21:20:38 UTC 2018

I have a laptop that I usually connect to an external monitor. I use 
Ubuntu 16.04 and Gnome 3.18.5. When I do connect to the external 
monitor, I like to turn the laptop screen off. I can do that by going to 
System Settings, Screen Display, selecting the built-in display and then 
clicking "off". I'd like to automate the process. I found a script that 
claimed to do that at startup. It's as follows:


sleep 15


xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
if [ $? -eq 0 ]; then
     xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT 
     xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT 

I made the script a startup application.

It works as advertised when the external monitor is connected. However, 
when the external monitor is not connected, I first see my desktop on 
the laptop screen as I would like it. Then, when the script wakes up and 
runs, the bottom panel on my desktop suddenly jumps to the top of the 
screen and comes to rest immediately below the top panel. I can't find 
any reports of this happening to anyone else.

If anyone could explain to me why the script is causing this behavior 
and tell me how to correct it, I'd be very grateful.




Leslie Katz

email: lesliek [at] mymts [dot] net

Please visit http://ssrn.com/author=1164057 to find hyperlinks

to papers that I’ve written on literary and legal topics

More information about the xorg mailing list