summaryrefslogtreecommitdiffstats
path: root/core/modules/remote-access
diff options
context:
space:
mode:
authorSimon Rettberg2020-06-19 17:03:15 +0200
committerSimon Rettberg2020-06-19 17:03:15 +0200
commit5e6181b7bd2710d8241ffcc2c4ef86573ca96173 (patch)
treeb78d93d61138f9e0d0df033438f57c61f67c3e24 /core/modules/remote-access
parent[remote-access] mkdir (diff)
downloadmltk-5e6181b7bd2710d8241ffcc2c4ef86573ca96173.tar.gz
mltk-5e6181b7bd2710d8241ffcc2c4ef86573ca96173.tar.xz
mltk-5e6181b7bd2710d8241ffcc2c4ef86573ca96173.zip
[remote-access] Show warning on real display (TODO: Make pretty)
Diffstat (limited to 'core/modules/remote-access')
-rw-r--r--core/modules/remote-access/data/opt/openslx/remote-access/xorg.conf85
-rwxr-xr-xcore/modules/remote-access/data/opt/openslx/scripts/systemd-remote_x_config36
2 files changed, 78 insertions, 43 deletions
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,9 +1,4 @@
Section "Monitor"
- Identifier "disable"
- Option "Ignore" "true"
-EndSection
-
-Section "Monitor"
Identifier "virt"
Option "DefaultModes" "false"
Modeline "1664x936" 128.50 1664 1768 1936 2208 936 939 944 972 -hsync +vsync
@@ -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 <<END
[General]
rpc-port = 7551
END
+
+# Force :0.0 usage
+
+cat > /etc/X11/Xsession.d/00-force-screen0 <<END
+#!/bin/ash Being sourced but hey
+(
+export DISPLAY=:0.1
+text="Dieser PC wird gerade aus der Ferne verwendet.
+This computer is currently being used for a remote session.
+
+Bitte nicht abschalten.
+Please don't turn it off."
+zenity --info --width 630 --text "\$text" || xmessage -center "\$text"
+) &
+export DISPLAY=:0.0
+END