whisperity/envprobe

Put temporary files under `/run/user/<id>` if available (`$XDG_RUNTIME_DIR`) and clean them up at shell exit

whisperity opened this issue ยท 4 comments

  • Use $XDG_RUNTIME_DIR for envprobe shell-specific root.
  • Clean up the config files and whatnot for exiting shells.

Implemented the first half (using $XDG_RUNTIME_DIR) for the upcoming new version.

It's not possible (excluding very weird hacks) to detect if a non-login shell exited. Usually, shells run by users in terminal emulators are not login shells... so I'm scrapping the second idea of this issue, and closing it down with the first.

Reopening. Thanks to @christianparpart, it seems a trap funcname EXIT "hook" should make the cleanup possible.

Done. ๐Ÿ˜“ ZSH's trap "functions" suck, but I figured it out.