Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDG Base Directory Specification $XDG_RUNTIME_DIR #37

Open
jmschp opened this issue Oct 27, 2024 · 2 comments
Open

XDG Base Directory Specification $XDG_RUNTIME_DIR #37

jmschp opened this issue Oct 27, 2024 · 2 comments

Comments

@jmschp
Copy link

jmschp commented Oct 27, 2024

Hi

First of all thank you for your project. I have learned a lot from it to build my own dot-files.

I am wondering how you manage the XDG_RUNTIME_DIR directory on a MacOS. At system/.env you do export XDG_RUNTIME_DIR="$HOME/.local/runtime # macOS does not have session lifetime directories; alt: ~/Library/Caches".

According to XDG Base Directory Specification for $XDG_RUNTIME_DIR:

The lifetime of the directory MUST be bound to the user being logged in. It MUST be created when the user first logs in and if the user fully logs out the directory MUST be removed. If the user logs in more than once they should get pointed to the same directory, and it is mandatory that the directory continues to exist from their first login to their last logout on the system, and not removed in between. Files in the directory MUST not survive reboot or a full logout/login cycle.

How do you manage this lifecycle?

I read this SO answer about a similar behavior in MacOS.

@webpro
Copy link
Owner

webpro commented Oct 28, 2024

First of all thank you for your project. I have learned a lot from it to build my own dot-files.

That's awesome! Great to hear.

How do you manage this lifecycle?

Good question, the short answer is: I don't. Since I'm the only user on my machine I didn't really bother when introducing this. Perhaps at the very least this deserves a warning in the docs and/or during installation.

Maybe, as a single user, it could be mitigated a tiny bit by at least removing the directory after login.

@jmschp
Copy link
Author

jmschp commented Oct 29, 2024

Hey

Still didn't get to a proper solution for this. After Googling a bit and asking AI, it seems creating a LaunchAgent could simulate the behavior in macOS, at least for login. But macOS doesn't have a true "logout" event like Linux systems, some some hack might be needed.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants