Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve external monitor handling. #239

Open
PCMan opened this issue Jul 19, 2014 · 19 comments
Open

Improve external monitor handling. #239

PCMan opened this issue Jul 19, 2014 · 19 comments

Comments

@PCMan
Copy link
Member

PCMan commented Jul 19, 2014

When a new monitor is plugged in, we need to show the tool to configure it.
Besides, the tool should be on the primary monitor.
We also need to handle the case when the external monitor is reomved, too.

@capkaverne
Copy link

And fix the issue where lxqt-panel iconify the bottom panel and the whole
desktop, crash the widgets and task managers icons when a new monitor
configuration is applied.

On Sat, Jul 19, 2014 at 3:50 PM, PCMan notifications@github.com wrote:

When a new monitor is plugged in, we need to show the tool to configure it.
Besides, the tool should be on the primary monitor.
We also need to handle the case when the external monitor is reomved, too.


Reply to this email directly or view it on GitHub
#239.

R.

@PCMan PCMan added this to the mstone-0.8.0 milestone Jul 20, 2014
@jleclanche jleclanche modified the milestones: mstone-0.8.0, mstone-1.0 Aug 5, 2014
@jleclanche jleclanche modified the milestones: 1.0.0, 0.9.0 Oct 14, 2014
@Vladimir-csp
Copy link

I once created an xrandr wrapper daemon for own use (https://github.com/Vladimir-csp/rerandr) and would like to share some thoughts.
In general, xrandr command in XDG autostart won't do. There should be a daemon, it should react to display-related events and act according to user-preferred model.
It should classify outputs as internal (like LVDS) and external (HDMI, VGA, etc).
Basic model: use only externals, fallback to internals if there aren't any externals
Other models: use everything, custom, etc
Submodels: clone, side-by-side, saved presets.
Presets can be saved based on monitor models, or combination of resolutions. So plugging in some known devices should trigger saved preset with saved orientations, dpi's, etc.

Changing configurations should be incremental, e.g. "enable needed outputs, then disable unneeded", not "disable everything, enable what is needed". In the latter case window placement would most certainly be messed up. General rule of thumb: during transition there should always be some enabled output (unless there is only one CRTC available on the video device). By the way, daemon should also check availability of CRTCs not to run out of them. Xrandr has a bug: it does not free CRTCs first (https://bugs.freedesktop.org/show_bug.cgi?id=29929)

Hope, some of it helps.

@jleclanche jleclanche modified the milestones: 1.0.0, 0.9.0 Dec 31, 2014
@jleclanche
Copy link
Member

Nobody picked this up, moving to 1.0.

@Vladimir-csp
Copy link

I've created another multimonitor handler in bash. https://github.com/Vladimir-csp/rerandr3
Well, it's pretty dirty, but it illustrates the concept of known setups from my previous message. When run as daemon it listens to hot-plug events and tries to either apply known configuration or enable/stack everything in auto.

One of my users shot himself in the foot recently because of static xrandr in XDG autostart: changed monitor, booted, logged in - out of range!

@jleclanche
Copy link
Member

@Vladimir-csp take a look at kscreen. They have a daemon that does exactly that (although it is outside the framework).

@jleclanche
Copy link
Member

also see #502

@Vladimir-csp
Copy link

...tried to install kscreen package in Debian, it pulls in 105MB of dependencies in 67 packages... Ouch.

@jleclanche
Copy link
Member

libkscreen is what you need, not kscreen. libkscreen should have no dependency outside of qt.

@Vladimir-csp
Copy link

Unfortunately my coding skills are limited to Bash, so I can not take advantage of the library yet.
With quick googling I couldn't find whether kscreen saves setups based on display models/serials, or just outputs combinations. If such feature can be included in lxqt with libkscreen, it would be perfect!
Use case: Multimonitor setup A at work, different multimonitor setup B at home. Save once, then just plug and play.

@capkaverne
Copy link

In ubuntu

sudo apt-get install libkscreen
...
E: Unable to locate package libkscreen

sudo apt-get install libkscreen-dbg
...
The following NEW packages will be installed:
libkscreen-dbg libkscreen1 libqjson0 libqt4-dbg
....
Need to get 117 MB of archives.

is this the package libkscreen-dbg ?

On Mon, Feb 16, 2015 at 1:32 PM, Vladimir-csp notifications@github.com
wrote:

Unfortunately my coding skills are limited to Bash, so I can not take
advantage of the library yet.
With quick googling I couldn't find whether kscreen saves setups based on
display models/serials, or just outputs combinations. If such feature can
be included in lxqt with libkscreen, it would be perfect!
Use case: Multimonitor setup A at work, different multimonitor setup B at
home. Save once, then just plug and play.


Reply to this email directly or view it on GitHub
#239 (comment).

R.

@Vladimir-csp
Copy link

No, that was kscreen with lots of KDE dependencies.
libkscreen1 wants 7 packages, 2.8MB, 10.9MB unpacked
(libattica0.4 libdbusmenu-qt2 libdlrestrictions1 libkdecore5 libkdeui5 libkscreen1libqjson0)

@kuzmas
Copy link
Contributor

kuzmas commented Feb 16, 2015

@RcMn
I guess you need libkscreen1 for runtime and libkscreen-dev for development.

@jleclanche
Copy link
Member

libattica0.4 libdbusmenu-qt2 libdlrestrictions1 libkdecore5 libkdeui5 libkscreen1libqjson0

That's far more than it actually requires...

@kuzmas
Copy link
Contributor

kuzmas commented Feb 16, 2015

In short:

Depends: libc6 (>= 2.14), libkdecore5 (>= 4:4.5.85), libkdeui5 (>= 4:4.5.85), libqjson0 (>= 0.7.1), libqtcore4 (>= 4:4.7.0~beta1), libqtgui4 (>= 4:4.6.1), libstdc++6
         (>= 4.1.1), libx11-6, libxcb-randr0 (>= 1.1), libxcb1 (>= 1.6), libxrandr2 (>= 2:1.2.99.3)

In full:

<user>@<host>:~$ aptitude show libkscreen1 libkscreen-dev

Package: libkscreen1                     
State: installed
Automatically installed: yes
Version: 1.0.5-0ubuntu1~ubuntu14.04
Priority: extra
Section: universe/libs
Maintainer: Kubuntu Developers <kubuntu-devel@lists.ubuntu.com>
Architecture: amd64
Uncompressed Size: 392 k
Depends: libc6 (>= 2.14), libkdecore5 (>= 4:4.5.85), libkdeui5 (>= 4:4.5.85), libqjson0 (>= 0.7.1), libqtcore4 (>= 4:4.7.0~beta1), libqtgui4 (>= 4:4.6.1), libstdc++6
         (>= 4.1.1), libx11-6, libxcb-randr0 (>= 1.1), libxcb1 (>= 1.6), libxrandr2 (>= 2:1.2.99.3)
Conflicts: libkscreen1
Breaks: libkscreen0, libkscreen0
Replaces: libkscreen0, libkscreen0
Description: library for screen management - shared library
 The KDE multiple monitor support is trying be as smart as possible adapting the behavior of it to each use case making the configuration of monitors as simple as
 plugging them to your computer. 

 This package contains the shared library
Homepage: https://projects.kde.org/projects/playground/libs/libkscreen

Package: libkscreen-dev
State: not installed
Version: 1.0.5-0ubuntu1~ubuntu14.04
Priority: extra
Section: universe/libdevel
Maintainer: Kubuntu Developers <kubuntu-devel@lists.ubuntu.com>
Architecture: amd64
Uncompressed Size: 84.0 k
Depends: libkscreen1 (= 1.0.5-0ubuntu1~ubuntu14.04), libqt4-dev
Conflicts: libkscreen-dev
Description: library for screen management - development files
 The KDE multiple monitor support is trying be as smart as possible adapting the behavior of it to each use case making the configuration of monitors as simple as
 plugging them to your computer. 

 This package contains the files necessary for development.
Homepage: https://projects.kde.org/projects/playground/libs/libkscreen

@paulolieuthier
Copy link
Contributor

As @palinek said in #600, we can create a daemon that would listen to screen changes and could react. I think it can be easily done as part of lxqt-config-monitor. We could create a flag --daemon for it. On screen changes, it could show a simple dialog asking what to do (or possibly do it automatically).

@Vladimir-csp
Copy link

The dialog could pop up on unknown display combinations with a choice to either "Apply and save" or just "Apply". If save is chosen, the daemon would not produce dialog if this combination is seen again, just apply saved configuration.
Configurations could be saved by string consisting of ports and display vendors, models and s/n, something like:

LVDS1-x-x-HDMI1-DELL_P2211H-922RN192B2LM-VGA1-DELL_P2211H-922RN192BJ4M

There also should be some timeout or a way to automatically cancel the dialog when known combination is reached through unknown combination. I.e. when user consequently plugs in multiple external monitors.

@Vladimir-csp
Copy link

...in fact, forget the serial numbers.

@jleclanche jleclanche added this to the 0.11 milestone Oct 24, 2015
@luke-jr
Copy link

luke-jr commented Jun 1, 2016

libkscreen should have no dependency outside of qt.

Oh, it very much does: Wayland stuff. I just opened #1068 here as a result...

@paulolieuthier paulolieuthier modified the milestones: 0.12, 0.11 Jun 28, 2016
@palinek palinek modified the milestones: 0.12, 0.13 Oct 23, 2017
@Vladimir-csp
Copy link

Vladimir-csp commented Apr 11, 2018

Here is a great and lightweight tool: https://github.com/phillipberndt/autorandr no dependencies except x11 utils and python. Has profiles, hooks, auto actions, just works. Could act as a backend for lxqt-config-monitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants