Thanks Dugan for sharing.
You made me discover yet_another_shell.
FWIW here is what I write in .profile, read by several shells including BASH:
Code:
export XDG_CACHE_HOME=/dev/shm/$(whoami)
mkdir -p /dev/shm/$(whoami)
chmod 700 /dev/shm/$(whoami)
export XDG_RUNTIME_DIR=$XDG_CACHE_HOME
Rationale:
1) Some upstream devs use XDG_RUNTIME_DIR for the same purposes as other use XDG_CACHE_HOME. Using the same directory for both helps e.g. to find a socket written in the former and looked for in the latter, or reverse, for instance.
2) Using /dev/shm provides an auto-cleaning of the cache when the system goes down for halt or reboot. This avoids the hassle of cleaning the cache manually or limiting it for applications cache-hungry like web browsers. Of course this is more useful when the system is used as a desktop or laptop than as an almost never rebooted server.
3) I didn't encounter an ill effect of these settings so far.
I will make this the default in upcoming Slint release.
As an aside, many people including me like to have /tmp in RAM, but i wouldn't like to impose that to others, especially newbies.