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
To: xorg@lists.x.org
Cc: Leslie Katz , 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
To: xorg@lists.x.org
Cc: Leslie Katz , 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.