Re: plasma5 screen management going wrong

2018-07-12 Thread Bug Reporter
On Thu, Jul 12, 2018 at 7:06 PM, Bug Reporter  wrote:
> On Thu, Jul 12, 2018 at 6:03 PM, Bug Reporter  wrote:
>> see below
>>
>> On Thu, Jul 12, 2018 at 2:20 AM, Duncan <1i5t5.dun...@cox.net> wrote:
>>> Bug Reporter posted on Wed, 11 Jul 2018 21:05:22 -0400 as excerpted:
>>>
 see below

 On Mon, Jul 2, 2018 at 2:25 AM, Duncan <1i5t5.dun...@cox.net> wrote:
> Bug Reporter posted on Sun, 01 Jul 2018 21:17:29 -0400 as excerpted:
>
>> Some questions include:
>>
>> - Upon putting the laptop on the dock (multiple external monitors) can
>> I run my randr script (or command) to activate the dock-connected
>> monitors without logging out of plasma?
>
> YES.
>
>>
>> - Upon undocking, I assume I would run another randr script to disable
>> the external monitors, then I would undock the laptop.
>
> YES
>
>>
>> - Say I have two different docking stations (one in the east coast
>> office one in the west coast office). Say both have the identical
>> monitor layout (e.g., two 1920x1080 HDMI monitors side by side). Will
>> the same randr dock-connect script work at the other office? The
>> monitors will have different EDID's, of course. But the relative
>> positions and the resolutions will be the same.
>
> This would appear to depend upon the names of the screens, such as
> "DP-2-1". My guess is that if the dock itself is the same model
> device, the display ports may be named the same by xrandr. Obviously,
> it is not hard to come up with the required command for additional
> office locations. However, it would be more convenient if a
> non-technical user (one who can barely use a terminal) had exactly one
> command to execute for docking, regardless of the office. But, in
> worst case, I can see making scripts or aliases such as "dock-east"
> and "dock-west". The undock script/alias would always be the same.
>
>>
>> - With xorg conf files, I assume that switching from the undocked to
>> the docked configuration requires logging out of plasma, restarting X,
>> and logging back in. Correct?
>
> I don't know. I did not create any xorg.conf files yet. Will I need to
> create them?
>
>>
>> - Are there frequent or common situations where one could lose all
>> monitor output and a non-sudo user would be required to restart the
>> computer?
>
> After just a little testing, this seems like a robust solution.
>
> However, the key to whether or not this will be practical for me is
> power management. Having to remove KDE's PowerDevil means I now have
> to go and explore alternative means of managing power on a laptop. Any
> suggestions?

The lack of powerdevil may be the showstopper in this process. So I
started looking for a config file that might disable kscreen. I did
not find any yet, but I did find kscreen-doctor. This might be the way
to leave kscreen installed and to manage it the way one would manage
screens with xorg conf files or with xrandr.

Interestingly, `kscreen-doctor -i` tells me: Preferred KScreen backend
: KSC_XRandR.so

KSC_XRandR.so: /usr/lib/qt/plugins/kf5/kscreen/KSC_XRandR.so

I don't know exactly what that is, but the name gives me the feeling
that kscreen-doctor might be able to be used like xrandr... any
thoughts?

# /usr/bin/kscreen-doctor --help

Usage: /usr/bin/kscreen-doctor [options] [output..
output..setting [...]]
kscreen-doctor allows to change the screen setup from the command-line.

Setting the output configuration is done in an atomic fashion, all settings
are applied in a single command.
kscreen-doctor can be used to enable and disable outputs, to position screens,
change resolution (mode setting), etc.. You should put all your options into
a single invocation of kscreen-doctor, so they can all be applied at once.

Usage examples:

   Show output information:
   $ kscreen-doctor -o
   Output: 1 eDP-1 enabled connected Panel Modes: Modes: 1:800x600@60
[...] Geometry: 0,0 1280x800
   Output: 70 HDMI-2 enabled connected  HDMI Modes: 1:800x600@60 [...]
Geometry: 1280,0 1920x1080

   Disable the hdmi output, enable the laptop panel and set it to a
specific mode
   $ kscreen-doctor output.HDMI-2.disable output.eDP-1.mode.1
output.eDP-1.enable

   Position the hdmi monitor on the right of the laptop panel
   $ kscreen-doctor output.HDMI-2.position.0,1280 output.eDP-1.position.0,0

   Set resolution mode
   $ kscreen-doctor output.HDMI-2.mode.1920x1080@60

   Set scale (note: fractional scaling is only supported on wayland)
   $ kscreen-doctor output.HDMI-2.scale.2

   Set rotation (possible values: none, left, right, inverted)
   $ kscreen-doctor output.HDMI-2.rotation.left


Options:
  -h, --help   Displays this help.
  -i, --info   Show runtime information: backends, logging, etc.
  -j, --json   Show configuration in JSON format
  -o, --outputsShow outputs
  -d, --dpms  Display power management (wayland only)
  -l, --log   Write a comment to the log file

Arguments:
  config   Specific output settings are separated by spaces, each

Re: plasma5 screen management going wrong

2018-07-12 Thread Bug Reporter
On Thu, Jul 12, 2018 at 6:03 PM, Bug Reporter  wrote:
> see below
>
> On Thu, Jul 12, 2018 at 2:20 AM, Duncan <1i5t5.dun...@cox.net> wrote:
>> Bug Reporter posted on Wed, 11 Jul 2018 21:05:22 -0400 as excerpted:
>>
>>> see below
>>>
>>> On Mon, Jul 2, 2018 at 2:25 AM, Duncan <1i5t5.dun...@cox.net> wrote:
 Bug Reporter posted on Sun, 01 Jul 2018 21:17:29 -0400 as excerpted:

> Some questions include:
>
> - Upon putting the laptop on the dock (multiple external monitors) can
> I run my randr script (or command) to activate the dock-connected
> monitors without logging out of plasma?

YES.

>
> - Upon undocking, I assume I would run another randr script to disable
> the external monitors, then I would undock the laptop.

YES

>
> - Say I have two different docking stations (one in the east coast
> office one in the west coast office). Say both have the identical
> monitor layout (e.g., two 1920x1080 HDMI monitors side by side). Will
> the same randr dock-connect script work at the other office? The
> monitors will have different EDID's, of course. But the relative
> positions and the resolutions will be the same.

This would appear to depend upon the names of the screens, such as
"DP-2-1". My guess is that if the dock itself is the same model
device, the display ports may be named the same by xrandr. Obviously,
it is not hard to come up with the required command for additional
office locations. However, it would be more convenient if a
non-technical user (one who can barely use a terminal) had exactly one
command to execute for docking, regardless of the office. But, in
worst case, I can see making scripts or aliases such as "dock-east"
and "dock-west". The undock script/alias would always be the same.

>
> - With xorg conf files, I assume that switching from the undocked to
> the docked configuration requires logging out of plasma, restarting X,
> and logging back in. Correct?

I don't know. I did not create any xorg.conf files yet. Will I need to
create them?

>
> - Are there frequent or common situations where one could lose all
> monitor output and a non-sudo user would be required to restart the
> computer?

After just a little testing, this seems like a robust solution.

However, the key to whether or not this will be practical for me is
power management. Having to remove KDE's PowerDevil means I now have
to go and explore alternative means of managing power on a laptop. Any
suggestions?


Re: plasma5 screen management going wrong

2018-07-12 Thread Bug Reporter
see below

On Thu, Jul 12, 2018 at 2:20 AM, Duncan <1i5t5.dun...@cox.net> wrote:
> Bug Reporter posted on Wed, 11 Jul 2018 21:05:22 -0400 as excerpted:
>
>> see below
>>
>> On Mon, Jul 2, 2018 at 2:25 AM, Duncan <1i5t5.dun...@cox.net> wrote:
>>> Bug Reporter posted on Sun, 01 Jul 2018 21:17:29 -0400 as excerpted:
>>
>>> This is likely the kscreen component, or libkscreen ...
>>>  I finally unmerged/uninstalled those two components
>>
>> To clarify, you removed kscreen and libkscreen? I'm running Arch Linux,
>> so I can probably uninstall those packages as well.
>
> Correct.  kscreen and libkscreen are not installed (on gentoo, aka
> "merged") here, despite the fact that I have kde-plasma as my desktop
> environment, with plasmashell providing the desktop and panels, and kwin
> as the window manager.
>
> It's possible there's something with a direct buildtime/runtime
> dependency on them, but it doesn't seem to be anything I have merged, or
> if it is, it's USE-flag controlled and I have that flag off.
>
> Actually... just did a grep on libkscreen in the (gentoo) repo, thus
> covering packages I don't have installed as well.  Other than kscreen
> itself, there's two other packages depending on it:
>
> powerdevil:  On gentoo at least, this appears to be a hard dep, buildtime
> and runtime.  The reason it doesn't affect me is that I don't have
> powerdevil installed either.
>
> Interestingly enough, the other one is lxqt-config.
>
> Nothing (well, other than the plasma-meta metapackage) appears to dep on
> kscreen itself.
>
> Meanwhile, note that I'm still on X.

Yes, I see it the same way. I will switch to Wayland once it has full
support under KDE and is reliable.

> It's possible, however, that the past problems have all been due to kde
> "fighting" with X over the configuration, and if there's no standard non-
> kde config to mess up, with some luck perhaps it'll all "just work".

My experience over most of the last two years is that it has "just
worked" -- until a couple weeks ago.

> Doing the same with xrandr, presumably scripting it to the settings you
> use frequently and then either running the script with selected
> parameters or running the appropriate script to change things, isn't
> difficult.  It'll just take some study of the xrandr manpage.  Typically
> you'd do something like this (for the same outputs/size/positioning as
> above):
>
> xrandr --output HDMI-A-0 --primary --mode 3840x2160 --pos 1920x0 --output
> DVI-D-0 --mode 1920x1080 --pos 0x2100
>
> Note that there's a bash-completion helper available for xrandr as well.

Can you say more about how this would work on a laptop that is docked
and undocked daily? Some questions include:

- Upon putting the laptop on the dock (multiple external monitors) can
I run my randr script (or command) to activate the dock-connected
monitors without logging out of plasma? The "without logging out" part
is important. If we have to log out and restart X, that's no better
than kscreen at the moment because if we restart after docking,
kscreen usually gets things right. (Until two weeks ago, it got things
right immediately when the dock was connected without any user
intervention at all.)

- Upon undocking, I assume I would run another randr script to disable
the external monitors, then I would undock the laptop.

- Say I have two different docking stations (one in the east coast
office one in the west coast office). Say both have the identical
monitor layout (e.g., two 1920x1080 HDMI monitors side by side). Will
the same randr dock-connect script work at the other office? The
monitors will have different EDID's, of course. But the relative
positions and the resolutions will be the same.

- With xorg conf files, I assume that switching from the undocked to
the docked configuration requires logging out of plasma, restarting X,
and logging back in. Correct?

- Are there frequent or common situations where one could lose all
monitor output and a non-sudo user would be required to restart the
computer?


Re: plasma5 screen management going wrong

2018-07-12 Thread Duncan
Bug Reporter posted on Wed, 11 Jul 2018 21:05:22 -0400 as excerpted:

> see below
> 
> On Mon, Jul 2, 2018 at 2:25 AM, Duncan <1i5t5.dun...@cox.net> wrote:
>> Bug Reporter posted on Sun, 01 Jul 2018 21:17:29 -0400 as excerpted:
> 
>> This is likely the kscreen component, or libkscreen ...
>>  I finally unmerged/uninstalled those two components
> 
> To clarify, you removed kscreen and libkscreen? I'm running Arch Linux,
> so I can probably uninstall those packages as well.

Correct.  kscreen and libkscreen are not installed (on gentoo, aka 
"merged") here, despite the fact that I have kde-plasma as my desktop 
environment, with plasmashell providing the desktop and panels, and kwin 
as the window manager.

It's possible there's something with a direct buildtime/runtime 
dependency on them, but it doesn't seem to be anything I have merged, or 
if it is, it's USE-flag controlled and I have that flag off.

Actually... just did a grep on libkscreen in the (gentoo) repo, thus 
covering packages I don't have installed as well.  Other than kscreen 
itself, there's two other packages depending on it:

powerdevil:  On gentoo at least, this appears to be a hard dep, buildtime 
and runtime.  The reason it doesn't affect me is that I don't have 
powerdevil installed either.

Interestingly enough, the other one is lxqt-config.

Nothing (well, other than the plasma-meta metapackage) appears to dep on 
kscreen itself.

Meanwhile, note that I'm still on X.  Google suggests there's not a lot 
of info out there about configuring plasma on wayland yet (a prominent 
hit is actually the arch wiki), but what I can find suggests that unlike 
X, there's no real desktop-independent configuration for wayland yet.  At 
some point I'm going to decide it's time to try (plasma on) wayland, and 
I've been kind of dreading it in part (one thing on a list...) because 
I've had such bad experiences with kde's X-based monitor configuration, 
while for better or for worse, that seems to be what I'll have to use.

It's possible, however, that the past problems have all been due to kde 
"fighting" with X over the configuration, and if there's no standard non-
kde config to mess up, with some luck perhaps it'll all "just work".  One 
can hope, anyway...

But I definitely expect kscreen/libkscreen will be needed to properly 
configure kwin_wayland and plasmashell on wayland, since that's the way 
that kde/plasma does it these days, and as I said, it appears there's no 
desktop-independent way to do it, so if my desktop is plasma on wayland, 
it'll have to be kde/plasma configuring it, and thus kscreen/libkscreen.

>>  And if I /do/ want to change the layout or resolution on-the-fly, I
>>  can use xrandr to do it, or simply
>> change the xorg.conf configuration and restart x/kde/plasma to have it
>> take effect.
> 
> It would be really helpful to find some examples of exactly how to apply
> your approach to a laptop which docks and undocks to/from a dock with
> multiple external displays. I would like to try your approach, but I
> don't have any experience with xrandr at all, and it has been an
> incredibly long time since I messed with xorg.conf. Any instructions or
> links are appreciated.

Wow.  While xorg does generally have sane no-xorg.conf behavior these 
days, I have a customized enough setup that I'd hardly consider doing 
without it, entirely!

Without actually checking, I'd (figuratively) bet money, however, that 
the arch wiki is one of the better resources out there on it.  Well, that 
and the xorg.conf manpage...

If you've not messed with xorg.conf in awhile, the biggest change you may 
not be aware of is that it's modular these days, configurable with 
multiple drop-in files (some of which are shipped by various xorg drivers 
in ordered to set defaults such as libinput (newer) or evdev (a bit 
older) as the default keyboard and mouse driver), instead of a single 
monolithic xorg.conf.  That makes it much *MUCH* easier to tweak just one 
thing, with a comparatively small configuration file likely with just one 
section and a couple configuration lines in it, either to override a 
shipped driver default, or to, for instance, configure one monitor 
"primary", with a second positioned "left-of" the primary.

As an example of why/how my config is somewhat customized, consider ($$ 
indicating a command, jed being my initials, my way of distinguishing my 
own settings files from the shipped defaults, this is for a radeon with 
the freedomware amdgpu driver, but the config should be similar for most 
freedomware drivers, if you're running nvidia with the servantware driver 
it may be different in which case you'll need to look elsewhere for that):

$$ cat /etc/X11/xorg.conf.d/jed.monitors.conf
# 48-inch 1080p youtube monitor
Section "Monitor"
Identifier  "jed.mon.dvi0"
Gamma   1.1
Option  "Position"  "0 2100"
EndSection