=== modified file 'adhoc-skel/home/ccx/s6-rc/source/terminator/run' --- old/adhoc-skel/home/ccx/s6-rc/source/terminator/run 2019-06-28 17:27:23 +0000 +++ new/adhoc-skel/home/ccx/s6-rc/source/terminator/run 2019-06-28 17:18:05 +0000 @@ -1,4 +1,4 @@ #!/bin/execlineb cd /home/ccx flock -x /run/termination.lock -s6-svscanctl -0 /run/service +s6-svscanctl -h /run/service === modified file 'home/adhoc-setup' --- old/home/adhoc-setup 2019-06-28 17:27:23 +0000 +++ new/home/adhoc-setup 2019-06-28 17:18:05 +0000 @@ -1,8 +1,9 @@ #!/bin/zsh setopt no_unset extended_glob warn_create_global -typeset -g DSTROOT +typeset -g DSTROOT DISPLAYNUM #set -x DSTROOT=$1 +DISPLAYNUM=$2 copy-skel() { local skel @@ -11,13 +12,35 @@ done } +setup-x11() { + s6-svwait /run/service/X$DISPLAYNUM || exit $? + + ln -f /run/Xauthority.$DISPLAYNUM $DSTROOT/run/Xauthority.$DISPLAYNUM || exit $? + printf '%s' >$DSTROOT/home/ccx/run/env/XAUTHORITY /run/Xauthority.$DISPLAYNUM || exit $? + + ln -f /run/X11/X$DISPLAYNUM $DSTROOT/tmp/.X11-unix/X$DISPLAYNUM || exit $? + printf '%s' >$DSTROOT/home/ccx/run/env/DISPLAY :$DISPLAYNUM || exit $? +} + +setup-i3status() { + s6-rc -l /run/user/ccx/s6-rc -u change i3status || exit $? + ln -f /run/user/ccx/service/i3status/s $DSTROOT/run/i3status.s || exit $? +} + main() { if ! [[ -d $DSTROOT ]]; then echo >&2 "Destination root not a directory: $DSTROOT" exit 2 fi + if [[ $DISPLAYNUM != [0-9] ]]; then + echo >&2 "Invalid display number: $DISPLAYNUM" + exit 3 + fi + copy-skel + setup-x11 + setup-i3status } main