summaryrefslogtreecommitdiffstats
path: root/core/modules/xscreensaver
diff options
context:
space:
mode:
authorSimon Rettberg2018-10-11 15:07:41 +0200
committerSimon Rettberg2018-10-11 15:07:41 +0200
commit60f365e413be60cd7d7a616c62200c33361e43f8 (patch)
tree48fdd7c7aef11632b817aad491a6c4c207184029 /core/modules/xscreensaver
parent[speedcheck] Remove defunct helper call (diff)
downloadmltk-60f365e413be60cd7d7a616c62200c33361e43f8.tar.gz
mltk-60f365e413be60cd7d7a616c62200c33361e43f8.tar.xz
mltk-60f365e413be60cd7d7a616c62200c33361e43f8.zip
[xscreensaver] Build bwlp-screensaver
Diffstat (limited to 'core/modules/xscreensaver')
-rwxr-xr-xcore/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver73
-rw-r--r--core/modules/xscreensaver/module.build9
-rw-r--r--core/modules/xscreensaver/module.conf6
3 files changed, 73 insertions, 15 deletions
diff --git a/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver b/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver
index 469e090a..d8bd831a 100755
--- a/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver
+++ b/core/modules/xscreensaver/data/etc/X11/Xsession.d/95-xscreensaver
@@ -1,34 +1,79 @@
#!/bin/ash
+DPMS=False
if which xscreensaver; then
[ -z "$UID" ] && UID=$(id -u)
[ -z "$HOME" ] && HOME="$(getent passwd "$UID" | head -n 1 | awk -F ':' '{print $6}')"
- if ! [ -s "$HOME/.xscreensaver" ]; then
- . /opt/openslx/config
- NUM=${SLX_SCREEN_STANDBY_TIMEOUT}
- [ -n "${SLX_EXAM}" ] && NUM=0
- if [ -n "$NUM" ] && [ "$NUM" -gt 60 ]; then
- SECS=0$(( NUM % 60 ))
- MINS=0$(( ( NUM / 60 ) % 60 ))
- HRS=0$(( ( NUM / 3600 ) % 60 ))
- STANDBY="${HRS:$(( ${#HRS} - 2 )):2}:${MINS:$(( ${#MINS} - 2 )):2}:${SECS:$(( ${#SECS} - 2 )):2}"
- else
- STANDBY=0:00:00
+ . /opt/openslx/config
+ SBY=${SLX_SCREEN_STANDBY_TIMEOUT}
+ if [ -n "${SLX_EXAM}" ]; then
+ SLX_LOGOUT_TIMEOUT=0
+ SBY=0
+ elif [ -z "$SBY" ]; then
+ SBY=0
+ elif [ "$SBY" -gt 0 ] && [ "$SBY" -lt 60 ]; then
+ SBY=60
+ elif ! [ "$SBY" -ge 0 ]; then # isNumeric?
+ SBY=0
+ fi
+ # Make sure standby timeout is less than logout timeout, otherwise, disable standby
+ if [ "$SBY" -gt 0 ]; then
+ if [ "$SLX_LOGOUT_TIMEOUT" -gt 0 ]; then
+ if [ "$SBY" -lt 300 ]; then
+ SBY=300
+ fi
+ if [ "$SLX_LOGOUT_TIMEOUT" -lt "$SBY" ]; then
+ SBY=0
+ fi
fi
+ fi
+ # Create config value for standby timeout
+ [ "$NUM" -gt 0 ] && DPMS=True
+ NUM=$SBY
+ SECS=0$(( NUM % 60 ))
+ MINS=0$(( ( NUM / 60 ) % 60 ))
+ HRS=0$(( ( NUM / 3600 ) % 60 ))
+ STANDBY="${HRS:$(( ${#HRS} - 2 )):2}:${MINS:$(( ${#MINS} - 2 )):2}:${SECS:$(( ${#SECS} - 2 )):2}"
+ # Create config for screensaver activation timeout
+ if [ "$SLX_LOGOUT_TIMEOUT" -gt 0 ] && [ "$SBY" -eq 0 ]; then
+ # Standby is disabled, consider logout timeout
+ TMO=$SLX_LOGOUT_TIMEOUT
+ else
+ # Consider standby timeout
+ TMO=$SBY
+ fi
+ # Start screen saver 3 minutes before forced logout, or screen enters standby
+ TMO=$(( TMO - 180 ))
+ if [ "$TMO" -gt 0 ]; then
+ [ "$TMO" -gt 1200 ] && TMO=$(( TMO - 300 ))
+ NUM=$TMO
+ SECS=0$(( NUM % 60 ))
+ MINS=0$(( ( NUM / 60 ) % 60 ))
+ HRS=0$(( ( NUM / 3600 ) % 60 ))
+ TIMEOUT="${HRS:$(( ${#HRS} - 2 )):2}:${MINS:$(( ${#MINS} - 2 )):2}:${SECS:$(( ${#SECS} - 2 )):2}"
+ else
+ TIMEOUT="99:00:00"
+ fi
+ if ! [ -s "$HOME/.xscreensaver" ]; then
cat > "$HOME/.xscreensaver" <<EOF
-mode: blank
-timeout: 24:00:00
+mode: one
+cycle: 99:00:00
+timeout: $TIMEOUT
lock: True
lockTimeout: 0:00:10
fade: False
unfade: False
-dpmsEnabled: True
+dpmsEnabled: $DPMS
dpmsStandby: $STANDBY
dpmsSuspend: $STANDBY
dpmsOff: $STANDBY
+newLoginCommand:
+programs: /opt/openslx/bin/bwlp-screensaver
+selected: 0
EOF
fi
xscreensaver -no-splash &
fi
+
true
diff --git a/core/modules/xscreensaver/module.build b/core/modules/xscreensaver/module.build
index 5fa3a36f..c78497fb 100644
--- a/core/modules/xscreensaver/module.build
+++ b/core/modules/xscreensaver/module.build
@@ -1,9 +1,16 @@
#!/bin/bash
fetch_source() {
- :
+ git clone "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src" || perror "Could not clone $REQUIRED_GIT"
}
build() {
+ [ ! -d "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}" ] && mkdir -p "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}"
+ cd "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}"
+
+ pinfo "Running cmake"
+
+ cmake "$SRCDIR" || perror "'cmake $SRCDIR' failed."
+ make || perror "'make' failed."
COPYLIST="list_dpkg_output"
list_packet_files > "$COPYLIST"
tarcopy "$(cat "${COPYLIST}" | sort -u)" "${MODULE_BUILD_DIR}"
diff --git a/core/modules/xscreensaver/module.conf b/core/modules/xscreensaver/module.conf
index e4d90404..defefddf 100644
--- a/core/modules/xscreensaver/module.conf
+++ b/core/modules/xscreensaver/module.conf
@@ -1,7 +1,13 @@
#!/bin/bash
+REQUIRED_MODULES="
+ qt5core
+"
+REQUIRED_GIT="git://git.openslx.org/openslx-ng/bwlp-screensaver.git"
+REQUIRED_PREFIX="/opt/openslx/bin"
REQUIRED_BINARIES="
xscreensaver
xscreensaver-command
+ bwlp-screensaver
"
REQUIRED_LIBRARIES=""
REQUIRED_DIRECTORIES="