]> git.madduck.net Git - etc/xsession.git/blob - .xsession

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

swap matcher keys
[etc/xsession.git] / .xsession
1 #!/bin/zsh --login
2
3 RUNDIR="/run/user/$(id -u)"
4 mkdir -m700 -p "$RUNDIR"
5 NEW_ERRFILE=$RUNDIR/xsession-errors
6 if [ -f "$ERRFILE" ]; then
7   mv "$ERRFILE" $NEW_ERRFILE
8 elif [ -L /tmp/xsession-$LOGNAME ]; then
9   mv $(readlink -f /tmp/xsession-$LOGNAME) $NEW_ERRFILE
10   rm /tmp/xsession-$LOGNAME
11 fi
12 chmod 600 $NEW_ERRFILE
13 ln -sf $NEW_ERRFILE $HOME/.xsession-errors
14 exec >>$NEW_ERRFILE 2>&1
15
16 set -u
17
18 while :; do
19   for script in $(run-parts --list $HOME/.xsession.d); do
20     echo I: sourcing ${script:t}... >&2
21     . $script
22     echo I: done sourcing ${script:t}... >&2
23   done
24
25   [ -e $HOME/.xsession-exit ] && break
26
27   echo "I: restarting xsession (touch $HOME/.xsession-exit to exit)..." >&2
28 done
29
30 rm -f $HOME/.xsession-exit
31
32 exit 0