From 5e6181b7bd2710d8241ffcc2c4ef86573ca96173 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 19 Jun 2020 17:03:15 +0200 Subject: [remote-access] Show warning on real display (TODO: Make pretty) --- .../data/opt/openslx/remote-access/xorg.conf | 85 +++++++++++----------- .../opt/openslx/scripts/systemd-remote_x_config | 36 ++++++++- 2 files changed, 78 insertions(+), 43 deletions(-) (limited to 'core/modules/remote-access') diff --git a/core/modules/remote-access/data/opt/openslx/remote-access/xorg.conf b/core/modules/remote-access/data/opt/openslx/remote-access/xorg.conf index 549400f5..660f9bac 100644 --- a/core/modules/remote-access/data/opt/openslx/remote-access/xorg.conf +++ b/core/modules/remote-access/data/opt/openslx/remote-access/xorg.conf @@ -1,8 +1,3 @@ -Section "Monitor" - Identifier "disable" - Option "Ignore" "true" -EndSection - Section "Monitor" Identifier "virt" Option "DefaultModes" "false" @@ -13,45 +8,51 @@ Section "Monitor" EndSection Section "Device" - Identifier "whatever" + Identifier "DeviceWarn" + Driver "%DRIVER%" + Option "ZaphodHeads" "VGA1,VGA-1,VGA2,VGA-2,VGA3,VGA-3,VGA4,VGA-4,LVDS1,LVDS-1,LVDS2,LVDS-2,LVDS3,LVDS-3,LVDS4,LVDS-4,DP1,DP-1,DP2,DP-2,DP3,DP-3,DP4,DP-4,eDP1,eDP-1,eDP2,eDP-2,eDP3,eDP-3,eDP4,eDP-4,HDMI1,HDMI-1,HDMI2,HDMI-2,HDMI3,HDMI-3,HDMI4,HDMI-4,DVI1,DVI-1,DVI2,DVI-2,DVI3,DVI-3,DVI4,DVI-4,DVI-I-11,DVI-I-1-1,DVI-I-12,DVI-I-1-2,DVI-I-13,DVI-I-1-3,DVI-I-14,DVI-I-1-4,DVI-I-21,DVI-I-2-1,DVI-I-22,DVI-I-2-2,DVI-I-23,DVI-I-2-3,DVI-I-24,DVI-I-2-4,DVI-I-31,DVI-I-3-1,DVI-I-32,DVI-I-3-2,DVI-I-33,DVI-I-3-3,DVI-I-34,DVI-I-3-4" + Screen 1 +EndSection + +Section "Device" + Identifier "Device0" + Driver "%DRIVER%" Option "VirtualHeads" "1" - Option "Monitor-HDMI1" "disable" - Option "Monitor-HDMI2" "disable" - Option "Monitor-HDMI3" "disable" - Option "Monitor-HDMI-1" "disable" - Option "Monitor-HDMI-2" "disable" - Option "Monitor-HDMI-3" "disable" - Option "Monitor-VGA1" "disable" - Option "Monitor-VGA2" "disable" - Option "Monitor-VGA3" "disable" - Option "Monitor-VGA-1" "disable" - Option "Monitor-VGA-2" "disable" - Option "Monitor-VGA-3" "disable" - Option "Monitor-DP1" "disable" - Option "Monitor-DP2" "disable" - Option "Monitor-DP3" "disable" - Option "Monitor-DP-1" "disable" - Option "Monitor-DP-2" "disable" - Option "Monitor-DP-3" "disable" - Option "Monitor-eDP1" "disable" - Option "Monitor-eDP2" "disable" - Option "Monitor-eDP3" "disable" - Option "Monitor-eDP-1" "disable" - Option "Monitor-eDP-2" "disable" - Option "Monitor-eDP-3" "disable" - Option "Monitor-DVI1" "disable" - Option "Monitor-DVI2" "disable" - Option "Monitor-DVI3" "disable" - Option "Monitor-DVI-1" "disable" - Option "Monitor-DVI-2" "disable" - Option "Monitor-DVI-3" "disable" - Option "Monitor-DVI-I-1-1" "disable" - Option "Monitor-DVI-I-1-2" "disable" - Option "Monitor-DVI-I-1-3" "disable" - Option "Monitor-DVI-I-2-1" "disable" - Option "Monitor-DVI-I-2-2" "disable" - Option "Monitor-DVI-I-2-3" "disable" Option "Monitor-VIRTUAL1" "virt" Option "Monitor-VIRTUAL-1" "virt" + Screen 0 +EndSection + +Section "Screen" + Identifier "Screen0" + Option "AutoServerLayout" "off" + Device "Device0" + Monitor "virt" + SubSection "Display" + Depth 24 + Modes "1664x936" + EndSubSection +EndSection + +Section "Screen" + Identifier "ScreenWarn" + Option "AutoServerLayout" "on" + Device "DeviceWarn" +EndSection + +Section "ServerLayout" + Identifier "Layout0" + Option "AutoServerLayout" "on" + Screen 0 "Screen0" + Screen 1 "ScreenWarn" +EndSection + +Section "ServerFlags" + Option "Xinerama" "off" +EndSection + +Section "InputClass" + Identifier "noinput" + Option "Ignore" "on" EndSection diff --git a/core/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config b/core/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config index 7bf37f05..2dc10343 100755 --- a/core/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config +++ b/core/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config @@ -4,10 +4,44 @@ [ -n "$SLX_REMOTE_VNC" ] || exit 0 # Nothing to do -ln -nfs /opt/openslx/remote-access/xorg.conf /etc/X11/xorg.conf.d/16-remote-access.conf +# Find connected output, get driver for according card +driver= +for cdir in /sys/class/drm/card?; do + card="${cdir##*/}" + grep -qFx 'connected' "$cdir/$card"-*/status || continue + driver="$( awk -F= '{ if ($1 = "DRIVER") { print $2; exit; } }' "$cdir/device/uevent" )" + [ -n "$driver" ] && break +done +# ??? +[ -z "$driver" ] && driver="i915" +case "$driver" in + i915) driver="intel" ;; + vmwgfx) driver="vmware" ;; +esac + +# Enable the dual-screen setup +sed "s/%DRIVER%/$driver/g" "/opt/openslx/remote-access/xorg.conf" > "/etc/X11/xorg.conf.d/16-remote-access.conf" + +# Enable LoingRPC of greeter mkdir -p /etc/lightdm/qt-lightdm-greeter.conf.d cat > /etc/lightdm/qt-lightdm-greeter.conf.d/13-loginrpc.conf < /etc/X11/Xsession.d/00-force-screen0 <