X-Git-Url: https://git.madduck.net/etc/xsession.git/blobdiff_plain/5c272279d2bc0751dd5eea92afff05f17e48a611..2ef069ef35fdc2b3e7a290680e81e96fc0b070ad:/.xsession?ds=sidebyside diff --git a/.xsession b/.xsession index 2550f2b..1c92e34 100755 --- a/.xsession +++ b/.xsession @@ -1,5 +1,18 @@ #!/bin/zsh --login +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