Skip to content

honor XDG_DATA_HOME on Linux and Mac #258

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

Merged
merged 3 commits into from
Jul 1, 2025
Merged

Conversation

0xmohit
Copy link
Contributor

@0xmohit 0xmohit commented Jun 30, 2025

Fixes #255

Copy link
Owner

@ggozad ggozad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @0xmohit thanks for this!
Would you mind updating the docs to reflect that we honour XDG_DATA_HOME

@0xmohit 0xmohit requested a review from ggozad July 1, 2025 08:06
@0xmohit
Copy link
Contributor Author

0xmohit commented Jul 1, 2025

I've added a note to the docs, @ggozad. PTAL.

Copy link
Owner

@ggozad ggozad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @0xmohit!

"linux": home / ".local/share/oterm",
"darwin": home / "Library/Application Support/oterm",
"linux": Path(os.getenv("XDG_DATA_HOME") or os.path.expanduser("~/.local/share")) / "oterm",
"darwin": Path(os.getenv("XDG_DATA_HOME") or os.path.expanduser("~/Library/Application Support")) / "oterm",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace os.path.expanduser(...) with home / ".local /share" and same for the macOS version. We have home already and use pathlib everywhere, there's no reason to involve os.path

@ggozad ggozad merged commit b1b0949 into ggozad:main Jul 1, 2025
@0xmohit 0xmohit deleted the xdg_data_home branch July 1, 2025 09:33
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

Successfully merging this pull request may close these issues.

Follow XDG dirs if set on macos
2 participants