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

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:

store temp xsession errors file on cleanup master
authormartin f. krafft <madduck@madduck.net>
Thu, 3 Feb 2022 06:36:01 +0000 (07:36 +0100)
committermartin f. krafft <madduck@madduck.net>
Thu, 10 Feb 2022 09:27:53 +0000 (10:27 +0100)
.xsession

index 1c92e340e1db595b3f46548bd19e2922d4b0aaea..ea1683e9623d456e64333dabdd9a9d8ec0cc332f 100755 (executable)
--- a/.xsession
+++ b/.xsession
@@ -11,6 +11,15 @@ elif [ -L /tmp/xsession-$LOGNAME ]; then
 fi
 chmod 600 $NEW_ERRFILE
 ln -sf $NEW_ERRFILE $HOME/.xsession-errors
 fi
 chmod 600 $NEW_ERRFILE
 ln -sf $NEW_ERRFILE $HOME/.xsession-errors
+
+TRAPS="0 1 2 3 4 5 6 7 8 10 11 12 13 14 15"
+cleanup() {
+  rm -f $HOME/.xsession-errors
+  mv $NEW_ERRFILE $HOME/.xsession-errors
+  trap - $TRAPS
+}
+trap cleanup $TRAPS
+
 exec >>$NEW_ERRFILE 2>&1
 
 set -u
 exec >>$NEW_ERRFILE 2>&1
 
 set -u