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 31f9dc1219eb8e94a50c0bdc67686493a9e053f9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jan 6 15:19:29 2019 +0000 added local non-locking slideshow screensaver --- .../60x11-spawn-configure-slideshow-screensaver | 52 ++++++++++++++++++++++ config/package-lists/xbackground.list.chroot | 1 - config/package-lists/xbgandscreensaver.list.chroot | 2 + 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/etc/X11/Xsession.d/60x11-spawn-configure-slideshow-screensaver b/config/includes.chroot/etc/X11/Xsession.d/60x11-spawn-configure-slideshow-screensaver new file mode 100644 index 0000000..8fbdc60 --- /dev/null +++ b/config/includes.chroot/etc/X11/Xsession.d/60x11-spawn-configure-slideshow-screensaver @@ -0,0 +1,52 @@ +# enable a non-locking local slideshow screensaver +XSAVERIMAGES=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | awk -F '=' '$1 == "xsaverimages" { print $2 }' | tr -dc '0-9a-zA-Z,$-_.+!*'"'"'();/?:@=&|') + +XSAVERIDLETIME=$(cat /proc/cmdline | tr ' ' '\n' | awk -F'=' '"xsaveridletime"==$1 {print $2}' | tr -dc '0-9') + +XSAVERIMGTIME=$(cat /proc/cmdline | tr ' ' '\n' | awk -F'=' '"xsaverimgtime"==$1 {print $2}' | tr -dc '0-9') + +IMAGEDIR="/var/tmp/images/" + +SLIDESDIR="${IMAGEDIR}/slides/" + +if [ -z "$XSAVERIMAGES" ] && [ -z "$XSAVERIDLETIME" ] && [ -z "$XSAVERIMGTIME" ] ; then + exit 0 +else + + if echo "$XSAVERIMAGES" | grep -q "://" ; then + # this could be an URI + # TODO move this download part to an earlier script + mkdir -p $IMAGEDIR/slides/ + wget -P $IMAGEDIR/slides/ ${XSAVERIMAGES/|/ } + fi + + IDLE_TIME=$(($XSAVERIDLETIME*1000)) + + BLACK=false + while sleep 1; do + idle=$(xprintidle) + [ -z "$idle" ] && exit 1 + if [ $idle -ge $IDLE_TIME ] && ! $BLACK ; then + # hide all things nxproxy + ps -C nxproxy -opid= | xargs -n 1 --no-run-if-empty -I XXX xdotool search --pid XXX . | xargs --no-run-if-empty -n 1 xdotool windowunmap + if [ $(ls $SLIDESDIR 2>/dev/null| wc -l) -gt 0 ] ; then + if ! ps -C feh >/dev/null ; then + feh -Y -x -F -D $XSAVERIMGTIME -Z -B black -q "$SLIDESDIR" & + fi + else + xsetroot -solid "#000000" + fi + BLACK=true + + else + if [ $idle -lt $IDLE_TIME ] && $BLACK ; then + if ps -C feh >/dev/null; then + killall feh + fi + # show all things nxproxy + ps -C nxproxy -opid= | xargs -n 1 --no-run-if-empty -I XXX xdotool search --pid XXX . | xargs --no-run-if-empty -n 1 xdotool windowmap + BLACK=false + fi + fi + done & +fi diff --git a/config/package-lists/xbackground.list.chroot b/config/package-lists/xbackground.list.chroot deleted file mode 100644 index 875156c..0000000 --- a/config/package-lists/xbackground.list.chroot +++ /dev/null @@ -1 +0,0 @@ -feh diff --git a/config/package-lists/xbgandscreensaver.list.chroot b/config/package-lists/xbgandscreensaver.list.chroot new file mode 100644 index 0000000..14eecfe --- /dev/null +++ b/config/package-lists/xbgandscreensaver.list.chroot @@ -0,0 +1,2 @@ +feh +xprintidle -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git