https://bugs.kde.org/show_bug.cgi?id=346961

a.key <a....@moronet.pl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a....@moronet.pl

--- Comment #95 from a.key <a....@moronet.pl> ---
There's not much point in repeating what's already been said apart from the
fact that I acknowledge the problem. It may have been fixed in the latest code
but on the freshest fedora 24 it is defo still broken.
Anyways...For me the most annoying thing is that I simply loose my windows or
even the ability to put the laptop to sleep/suspend or even shutdown after
undocking it.

Environment:
OS: Fedora 24
Desired monitor setup: 
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis)
310mm x 170mm
DP2-1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis)
520mm x 290mm
DP2-2 connected 1920x1080+3840+0 (normal left inverted right x axis y axis)
600mm x 340mm

This config is 90% of times lost when I undock the laptop and dock it again or
udock, suspend, dock it back and wake up. 

The most reliable way for me to restore my screens is to run xrandr manually
and not even specified all outputs in one go but enabling the outputs one after
another:
xrandr --output eDP1 --auto --primary && xrandr --output DP2-1 --auto
--right-of eDP1 && xrandr --output DP2-2 --auto --right-of DP2-1

I have this command in history of krunner so I can fairly easily get back to it
if I loose my screens after undocking and have no way to restore windows
quickly.

Today I discovered a new method which seems to work for me every time I undock
and redock:
This one is using the feature of power management/Energy Saving settings. In
particular executing scripts on Profile changes.

So I have 2 scripts:
$ ls -1 ~/scripts/
disable-external-monitors.sh
enable-external-monitors.sh

containing:
$ cat scripts/enable-external-monitors.sh 
#!/usr/bin/env bash
PATH=$PATH:/usr/bin

export DISPLAY=":0"

logger "$0 - run"


sleep 1
xrandr --output eDP1 --auto --primary && xrandr --output DP2-1 --auto
--right-of eDP1 && xrandr --output DP2-2 --auto --right-of DP2-1


and:

$ cat scripts/disable-external-monitors.sh 
#!/usr/bin/env bash
PATH=$PATH:/usr/bin

export DISPLAY=":0"

logger "$0 - run"

sleep 1
xrandr --output eDP1 --auto --primary && xrandr --output DP2-1 --off && xrandr
--output DP2-2 --off


The scripts are executable (obviously).
So in the settings of Energy Saving for "On AC Power" profile I have:
Run script (ticked) and pointing at:
/home/a.key/scripts/enable-external-monitors.sh

and for "On Battery"
Run script (ticked) and pointing at:
/home/a.key/scripts/disable-external-monitors.sh


This seems to work pretty well with the current state of things (broken KDE
packages as provided by current Fedora 24). 
Obviously for your setups you will have to modify the outputs in xrandr calls
inside the scripts.
There's obviously a bit of debugging in them. The reason for 1s sleep is that I
very often find that my Thinkpad T440s takes a bit of time to register h/w
changes that happen during docking/undocking so allowing 1s delay is helping
there.

This doesn't resolve the screen setup being broken during KDE start (after
reboot) but that should be as simple as adding the
"enable-external-monitors.sh) script to KDE startup.

Hope this helps before we get the fixed packages from vendors/distributions.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to