[X2Go-Commits] [live-build-x2go] 89/108: reworked 60x11-set-xbackground: URL takes precedence over Hex color; when in minidesktop mode, wait until file has been downloaded before continuing, else wait in background
git-admin at x2go.org
git-admin at x2go.org
Wed Mar 20 22:13:24 CET 2019
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch feature/openbox
in repository live-build-x2go.
commit 3dc9b9dc5d1ae8c2d775a3aaa4f17bd9cf1b32de
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date: Sat Jan 19 16:56:37 2019 +0000
reworked 60x11-set-xbackground: URL takes precedence over Hex color; when in minidesktop mode, wait until file has been downloaded before continuing, else wait in background
---
.../etc/X11/Xsession.d/60x11-set-xbackground | 64 +++++++++++++---------
1 file changed, 37 insertions(+), 27 deletions(-)
diff --git a/config/includes.chroot/etc/X11/Xsession.d/60x11-set-xbackground b/config/includes.chroot/etc/X11/Xsession.d/60x11-set-xbackground
index f38b08d..6897f12 100644
--- a/config/includes.chroot/etc/X11/Xsession.d/60x11-set-xbackground
+++ b/config/includes.chroot/etc/X11/Xsession.d/60x11-set-xbackground
@@ -4,9 +4,43 @@ XROOTMODE=$(cat /proc/cmdline | tr ' ' '\n' | awk -F'=' '"xrootmode"==$1 {print
IMAGEDIR=/var/tmp/images/
if [ -n "$XROOT" ] ; then
+
+ #input validation
+ # allowed values for POSITION: center fill max scale tile; default: max
+ case "${XROOTMODE,,}" in # force lowercase
+ "center") POSITION=center ;;
+ "fill") POSITION=fill ;;
+ "scale") POSITION=scale ;;
+ "tile") POSITION=tile ;;
+ *) POSITION=max ;;
+ esac
+
XROOTSHORT=$(echo "$XROOT" | tr -dc '0-9a-fA-Fx')
- if echo "$XROOTSHORT" | grep -q '^0x' && [ 8 = ${#XROOTSHORT} ] ; then
+ if echo "$XROOT" | grep -q "://" ; then
+ # this could be an URI
+ if [ -f "/etc/x2go/x2gothinclient-minidesktop_start" ] ; then
+ # We're running in X2Go-TCE-MATE-MiniDesktop
+ # only 1 image supported (so far)
+ # no background colors supported (so far)
+ # but, in TCE-MMD, we can use SVG images in addition to PNG, JPG, etc.
+ while ! [ $(ls -1 $IMAGEDIR/background/* 2>/dev/null | wc -l) -gt 0 ] ; do
+ sleep 1
+ done
+ cat $(ls -1 $IMAGEDIR/background/*| head -1) >/etc/x2go/x2gothinclient-minidesktop_background.svg # nasty hack, but seems to work, even for non-svg images
+ # update-alternatives --remove desktop-background /usr/share/backgrounds/x2go/x2gothinclient-minidesktop_background.svg
+ # update-alternatives --install /usr/share/images/desktop-base/desktop-background desktop-background $(ls -1 $IMAGEDIR/background/*| head -1) 10
+ else
+ (
+ while ! [ $(ls -1 $IMAGEDIR/background/* 2>/dev/null | wc -l) -gt 0 ] ; do
+ xsetroot -grey # show that something's amiss
+ sleep 1
+ done
+ feh --no-fehbg --bg-$POSITION $IMAGEDIR/background/*
+ ) &
+ fi
+
+ elif echo "$XROOTSHORT" | grep -q '^0x' && [ 8 = ${#XROOTSHORT} ] ; then
# this should be a hex color string
HEXCOLOR=${XROOTSHORT#0x}
if [ 6 = ${#HEXCOLOR} ] ; then
@@ -14,32 +48,8 @@ if [ -n "$XROOT" ] ; then
else
xsetroot -grey # show that something's amiss
fi
- elif echo "$XROOT" | grep -q "://" ; then
- # this could be an URI
- if [ $(ls $IMAGEDIR 2>/dev/null| wc -l) -gt 0 ] ; then
- #input validation
- case "${XROOTMODE,,}" in # force lowercase
- "center") POSITION=center ;;
- "fill") POSITION=fill ;;
- "scale") POSITION=scale ;;
- "tile") POSITION=tile ;;
- *) POSITION=max ;;
- esac
- # POSITION: center fill max scale tile; default: max
- if [ -f "/etc/x2go/x2gothinclient-minidesktop_start" ] ; then
- # We're running in X2Go-TCE-MATE-MiniDesktop
- # only 1 image supported (so far)
- # no background colors supported (so far)
- # but, in TCE-MMD, we can use SVG images in addition to PNG, JPG, etc.
- cat $(ls -1 $IMAGEDIR/background/*| head -1) >/etc/x2go/x2gothinclient-minidesktop_background.svg # nasty hack, but seems to work, even for non-svg images
- # update-alternatives --remove desktop-background /usr/share/backgrounds/x2go/x2gothinclient-minidesktop_background.svg
- # update-alternatives --install /usr/share/images/desktop-base/desktop-background desktop-background $(ls -1 $IMAGEDIR/background/*| head -1) 10
- else
- feh --no-fehbg --bg-$POSITION $IMAGEDIR/background/*
- fi
- else
- xsetroot -grey # show that something's amiss
- fi
+ else
+ : # NOP
fi
else
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
More information about the x2go-commits
mailing list