This would be really useful for deleting old files from the trash, clearing the cache, clearing old downloads, recreating XDG directories, etc.
I plus one this.
In my use case, I want to add a directory into $XDG_RUNTIME_DIR to hold sockets for ssh multiplexing. Since ssh can't create the directory by itself, I thought of systemd-tmpfiles could generate it.
I have made a change that makes systemd-tmpfiles recognise %U, %u and %h as well, so this will allow using it in a user context a bit more easily.
That being said, tmpfiles still doesn't support environment variables like e.g. the XDG_... variables, so this doesn't entirely solve this problem yet (I'll wait with opening a pull request).
Duplicate of this: https://bugs.freedesktop.org/show_bug.cgi?id=88873
Most helpful comment
I plus one this.
In my use case, I want to add a directory into $XDG_RUNTIME_DIR to hold sockets for ssh multiplexing. Since ssh can't create the directory by itself, I thought of systemd-tmpfiles could generate it.