From ebddfac014cfee9eab06afa50f04fb9e16c56f3b Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Tue, 6 Oct 2020 10:02:56 +0200
Subject: [*] Helper script to add text to lightdm logo, and change its color
---
.../data/opt/openslx/lightdm/bwlp-banner-exam.svg | 135 ---------------------
.../data/opt/openslx/lightdm/bwlp-banner.svg | 2 +-
.../data/opt/openslx/scripts/lightdm-patch_logo | 15 +++
.../opt/openslx/scripts/systemd-remote_x_config | 2 +
.../data/opt/openslx/scripts/systemd-safe_mode | 9 +-
5 files changed, 24 insertions(+), 139 deletions(-)
delete mode 100644 core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/bwlp-banner-exam.svg
create mode 100755 core/modules/lightdm-greeter-bwlp/data/opt/openslx/scripts/lightdm-patch_logo
(limited to 'core/modules')
diff --git a/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/bwlp-banner-exam.svg b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/bwlp-banner-exam.svg
deleted file mode 100644
index 468a6dc8..00000000
--- a/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/bwlp-banner-exam.svg
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
\ No newline at end of file
diff --git a/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/bwlp-banner.svg b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/bwlp-banner.svg
index 11016a9e..6cc7e194 100644
--- a/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/bwlp-banner.svg
+++ b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/lightdm/bwlp-banner.svg
@@ -1,2 +1,2 @@
-
+
diff --git a/core/modules/lightdm-greeter-bwlp/data/opt/openslx/scripts/lightdm-patch_logo b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/scripts/lightdm-patch_logo
new file mode 100755
index 00000000..fb339105
--- /dev/null
+++ b/core/modules/lightdm-greeter-bwlp/data/opt/openslx/scripts/lightdm-patch_logo
@@ -0,0 +1,15 @@
+#!/bin/ash
+
+text="$1"
+color=
+if [ -n "$2" ]; then
+ color=";s:#[0-9a-f][0-9a-f][0-9a-f][0-9a-f]*:${2}:gI"
+fi
+
+text="${text//}"
+text="${text//>/}"
+text="${text//:/}"
+text="${text//'"'/}"
+
+# Add text to bwLehrpool logo
+sed -i "s::${text}:${color}" '/opt/openslx/lightdm/bwlp-banner.svg'
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 075fd5a1..e977ffd5 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
@@ -7,6 +7,8 @@
# Disable all input drivers
cp "/opt/openslx/remote-access/xorg-noinput.conf" "/etc/X11/xorg.conf.d/16-remote-access-noinput.conf"
+/opt/openslx/scripts/lightdm-patch_logo "Fernzugriff" '#555555'
+
# Find connected output, get driver for according card
driver=
fallback=
diff --git a/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode b/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
index eeaf34b1..062c3fca 100755
--- a/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
+++ b/core/modules/safe-mode/data/opt/openslx/scripts/systemd-safe_mode
@@ -20,9 +20,12 @@ disable_magic_keys() {
}
change_loginscreen() {
- local CF="/etc/lightdm/qt-lightdm-greeter.conf"
- sed -r -i '/^greeter-background/d;s:(^greeter-banner-image=).*$:\1/opt/openslx/lightdm/bwlp-banner-exam.svg:' "$CF"
- echo "greeter-background-gradient=FFB22C FFB22C" >> "$CF"
+ cat > "/etc/lightdm/qt-lightdm-greeter.conf.d/99-exam-mode.conf" <