[Bug 110806] Display not recognized if initially disconnected

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jun 3 13:05:38 UTC 2019


https://bugs.freedesktop.org/show_bug.cgi?id=110806

--- Comment #4 from Ropid <rropid at gmail.com> ---
I got this to work right with LightDM. Looking at "man sddm.conf", it seems the
same method could also work with SDDM.

I created the following three scripts inside "/etc/lightdm/":

------------------------------------------------------------
$ tail -n+1 display-setup session-setup xrandr-auto.sh 
==> display-setup <==
#!/bin/bash
/etc/lightdm/xrandr-auto.sh &

==> session-setup <==
#!/bin/bash
pkill -x xrandr-auto.sh

==> xrandr-auto.sh <==
#!/bin/bash
trap 'kill -- $(jobs -p)' EXIT
LC_ALL=C xev -root -event randr |
while read -r line; do
    # trigger only on certain lines
    if [[ $line == "RRScreenChangeNotify event"* ]]; then
        echo "$(date +%H:%M:%S.%N): screen change event"
        # in background, sleep a bit and run xrandr --auto
        # and don't start multiple background jobs
        if [[ ! $(jobs) ]]; then
            {
                sleep 1;
                echo "$(date +%H:%M:%S.%N): run xrandr"
                xrandr --auto
            } &
        fi
    fi
done
------------------------------------------------------------

And then in "/etc/lightdm/lightdm.conf", I configured the following:

[Seat:*]
display-setup-script=/etc/lightdm/display-setup
session-setup-script=/etc/lightdm/session-setup


The interesting part is inside "xrandr-auto.sh". That script uses 'xev' to
capture screen change events and it runs "xrandr --auto" when those events
happen. This seems to solve the problem here for me. I can now boot without a
monitor being connected, and when I connect the monitor the login screen will
show up correctly.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-driver-ati/attachments/20190603/f6b8d82f/attachment.html>


More information about the xorg-driver-ati mailing list