Thank you to both Michal Srb and Marius Gedminas for taking the trouble to reply to my query and for their suggestions. I tried Michal's suggestion, but the same strange behaviour occurred on the laptop's display when the edited script ran without the external monitor plugged in. Marius's suggestion to adjust the monitors configuration was unfortunately beyond my limited skills.

I've now run up the white flag on the startup script idea. Instead, I created a custom launcher with an icon that resides on my top panel. Now, when I boot up with the external monitor connected, I just click on the icon and it runs: xrandr --output eDP1 --off. At least I've reduced the steps needed to one simple one.

Thank you again,

Leslie



On 2018-04-09 07:00 AM, xorg-requ...@lists.x.org wrote:
Send xorg mailing list submissions to
        xorg@lists.x.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.x.org/mailman/listinfo/xorg
or, via email, send a message with subject or body 'help' to
        xorg-requ...@lists.x.org

You can reach the person managing the list at
        xorg-ow...@lists.x.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of xorg digest..."


Today's Topics:

    1. Re: Dual monitor problem (Michal Srb)
    2. Re: Dual monitor problem (Michal Srb)
    3. Re: Dual monitor problem (Marius Gedminas)
    4. Re: Dual monitor problem (Marius Gedminas)


----------------------------------------------------------------------

Message: 1
Date: Mon, 09 Apr 2018 09:50:53 +0200
From: Michal Srb <m...@suse.com>
To: xorg@lists.x.org
Cc: Leslie Katz <lesl...@mymts.net>, x...@freedesktop.org
Subject: Re: Dual monitor problem
Message-ID: <2873766.kkh69jj...@sheogorath.suse.cz>
Content-Type: text/plain; charset="us-ascii"

On sobota 7. dubna 2018 23:13:48 CEST Leslie Katz wrote:
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:

#!/bin/bash

sleep 15

EXTERNAL_OUTPUT="DP1"
INTERNAL_OUTPUT="eDP1"

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

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.
If there is no external output the script reconfigures the internal output and
disables the external output. I can't explain why the desktop environment
reacts to it the way it does, but maybe you could just drop the whole else
branch so nothing happens if there is no external output.

So it would look somehow like this:

...

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

...

Michal Srb


------------------------------

Message: 2
Date: Mon, 09 Apr 2018 09:50:53 +0200
From: Michal Srb <m...@suse.com>
To: xorg@lists.x.org
Cc: Leslie Katz <lesl...@mymts.net>, x...@freedesktop.org
Subject: Re: Dual monitor problem
Message-ID: <2873766.kkh69jj...@sheogorath.suse.cz>
Content-Type: text/plain; charset="us-ascii"

On sobota 7. dubna 2018 23:13:48 CEST Leslie Katz wrote:
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:

#!/bin/bash

sleep 15

EXTERNAL_OUTPUT="DP1"
INTERNAL_OUTPUT="eDP1"

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

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.
If there is no external output the script reconfigures the internal output and
disables the external output. I can't explain why the desktop environment
reacts to it the way it does, but maybe you could just drop the whole else
branch so nothing happens if there is no external output.

So it would look somehow like this:

...

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

...

Michal Srb


------------------------------

Message: 3
Date: Mon, 9 Apr 2018 13:32:54 +0300
From: Marius Gedminas <mar...@gedmin.as>
To: xorg@lists.x.org, x...@freedesktop.org
Subject: Re: Dual monitor problem
Message-ID: <20180409103254.2ccfwjfwyfqw4e4g@platonas>
Content-Type: text/plain; charset="utf-8"

On Sat, Apr 07, 2018 at 04:13:48PM -0500, Leslie Katz wrote:
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.
GNOME should already automate that.  It remembers your settings for each
set of connected monitor configurations, and when you plug in or unplug
a monitor, it restores them.

The configurations themselves are stored in ~/.config/monitors.xml.  The
process responsible for applying them on hotplug/unplug events is
gnome-settings-daemon.  (Ubuntu might have a unity-settings-daemon which
is a fork of an older version of gnome-settings-daemon, but it does the
same thing.)

There's a way to turn that autoconfiguration off, which might explain
why it's not happening for you.  It's a setting somewhere in
dconf/gsettings, but I don't remember exactly where.

HTH,
Marius Gedminas


--

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
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Reply via email to