X-Git-Url: https://git.madduck.net/etc/xsession.git/blobdiff_plain/1cc701240a14fc4566a8806c91216dcd30001ea4..8ae4de427aa82a91921dc30394d91236f39bdd0d:/.xsession?ds=inline diff --git a/.xsession b/.xsession index 45d8afe..1c92e34 100755 --- a/.xsession +++ b/.xsession @@ -1,8 +1,19 @@ #!/bin/zsh --login -set -eu - -SHLVL=0 +RUNDIR="/run/user/$(id -u)" +mkdir -m700 -p "$RUNDIR" +NEW_ERRFILE=$RUNDIR/xsession-errors +if [ -f "$ERRFILE" ]; then + mv "$ERRFILE" $NEW_ERRFILE +elif [ -L /tmp/xsession-$LOGNAME ]; then + mv $(readlink -f /tmp/xsession-$LOGNAME) $NEW_ERRFILE + rm /tmp/xsession-$LOGNAME +fi +chmod 600 $NEW_ERRFILE +ln -sf $NEW_ERRFILE $HOME/.xsession-errors +exec >>$NEW_ERRFILE 2>&1 + +set -u while :; do for script in $(run-parts --list $HOME/.xsession.d); do @@ -11,10 +22,6 @@ while :; do echo I: done sourcing ${script:t}... >&2 done - echo I: waiting for child processes to complete... >&2 - jobs >&2 - wait - [ -e $HOME/.xsession-exit ] && break echo "I: restarting xsession (touch $HOME/.xsession-exit to exit)..." >&2