X-Git-Url: https://git.madduck.net/etc/xsession.git/blobdiff_plain/4be9ded8407e86d9f34cb0bc9dacf887db0f3d11..cdc0f4bc212d6654be984145b71a006551d9b406:/.xsession?ds=sidebyside diff --git a/.xsession b/.xsession index bb8cbf0..1c92e34 100755 --- a/.xsession +++ b/.xsession @@ -1,8 +1,19 @@ #!/bin/zsh --login -set -eu +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 -SHLVL=0 +set -u while :; do for script in $(run-parts --list $HOME/.xsession.d); do