SCRIPTLINKS += fixsub
SCRIPTLINKS += check-debsyms
SCRIPTLINKS += check-blkdev-size
+SCRIPTLINKS += xremote
+SCRIPTLINKS += remote-disorder
+SCRIPTLINKS += remote-slideshow
## Random odds and ends.
DOTLINKS += .infokey .sqliterc
--- /dev/null
+#! /bin/sh -e
+case $# in 1) ;; *) echo >&2 "usage: $0 HOST"; exit 2 ;; esac
+host=$1; shift
+case $host in
+ *[!-a-zA-Z0-9]*) echo >&2 "$0: bad host name \`$host'"; exit 2 ;;
+esac
+cd "$HOME/.disorder"
+if ! [ -f "passwd.$host" ] ||
+ ! grep -q "^connect -unix /.*/\.disorder/sock/disorder@$host" \
+ "passwd.$host"
+then echo >&2 "$0: unknown disorder host \`$host'"; exit 2; fi
+if [ -S "sock/ssh@$host" ]; then
+ ssh -oControlPath="sock/ssh@$host" -Oexit "$host"
+fi
+rm -f "sock/disorder@$host"
+ssh -oControlMaster=yes -oControlPath="sock/ssh@$host" -fnN \
+ -L"sock/disorder@$host:/var/lib/disorder/socket" \
+ "$host"
--- /dev/null
+#! /bin/sh -e
+
+case $#,$2 in
+ 0,* | 1,*) ok=nil ;;
+ *,*:*) ok=t ;;
+ *) ok=nil ;;
+esac
+case $ok in
+ nil) echo >&2 "usage: $0 DIR,... HOST:DISP [CMD ARGS ...]"; exit 2; ;;
+esac
+dirs=$1 host=${2%:*} dpy=${2##*:}; shift 2
+case $#,$1 in
+ 0 | 1,:slideshow)
+ set -- /usr/lib/xscreensaver/glslideshow -duration 60 -pan 10 \
+ -xrm "'*desktopGrabber: ./getimg %s'"
+ ;;
+ 1,:photopile)
+ set -- /usr/lib/xscreensaver/photopile -no-titles -no-polaroid -shadows \
+ -xrm "'*desktopGrabber: ./getimg %s'"
+ ;;
+esac
+
+t=$(mktemp -d "${TMPDIR-/tmp}/remote-slidesshow.XXXXXXXX")
+mkfifo "$t/pipe"
+exec 3<>"$t/pipe"
+rm -rf "$t"
+
+ssh -ax "$host" "
+ set -e
+ tmp=\$(mktemp -d \"\${TMPDIR-/tmp}/remote-slideshow.XXXXXXXX\")
+ trap 'cd / && rm -rf \$tmp' EXIT INT TERM HUP
+ cd \$tmp
+ IMAGEFILE=\$tmp/img; export IMAGEFILE
+ DISPLAY=:$dpy; export DISPLAY
+ exec 3<&0 4>&1
+ cat >getimg <<'EOF'
+#! /bin/sh -e
+rm -f img
+echo \"\$IMAGEFILE\" >&4
+xscreensaver-command -deactivate >/dev/null 2>&1 || :
+IFS= read -r f <&3
+exec xscreensaver-getimage -directory \"\${IMAGEFILE%/*}\" -file img \"\$@\"
+EOF
+ chmod +x getimg
+ $*" <&3 |
+while IFS= read -r rdir; do
+ set -- \( -false
+ for e in jpg jpeg pjpeg pjpg png gif tif tiff xbm xpm; do
+ set -- "$@" -o -name "*.$e"
+ done
+ set -- "$@" \) -type f -print -o -type d \( -false
+ dd=$dirs
+ while :; do
+ case $dd in
+ "") break ;;
+ *,*) d=${dd##*,} dd=${dd%,*} ;;
+ *) d=$dd dd= ;;
+ esac
+ for i in $(find "$d" -name .slideshow-ignore -type f -print); do
+ while IFS= read -r line; do
+ case $line in \#*) continue ;; esac
+ set -- "$@" -o -path "${i%/*}/$line"
+ done <"$i"
+ done
+ set -- "$d" "$@"
+ done
+ set -- "$@" \) -prune
+ f=$(find "$@" | shuf -n1)
+ echo "$f"
+ scp "$f" "$host:$rdir" >/dev/null 2>&1
+ echo done >&3
+done
--- /dev/null
+#! /bin/sh -e
+
+case $#,$1 in
+ 0,* | 1,*) ok=nil ;;
+ *,*:*) ok=t ;;
+ *) ok=nil ;;
+esac
+case $ok in
+ nil) echo >&2 "usage: $0 HOST:RDPY/LDPY PROG ARGS ..."; exit 2 ;;
+esac
+host=${1%:*} dpy=${1##*:}; rdpy=${dpy%%/*} ldpy=${dpy#*/}; shift 1
+
+ssh -L"/tmp/.X11-unix/X$ldpy:/tmp/.X11-unix/X$rdpy" -Nafx "$host"
+sleep 1
+trap 'trap - INT QUIT HUP EXIT; ssh -Oexit "$host"; rm -f "/tmp/.X11-unix/X$ldpy"' INT QUIT HUP EXIT
+DISPLAY=:$ldpy "$@"