✨ feat(api): add user_applications_dir property#432
Merged
gaborbernat merged 2 commits intotox-dev:mainfrom Feb 14, 2026
Merged
✨ feat(api): add user_applications_dir property#432gaborbernat merged 2 commits intotox-dev:mainfrom
gaborbernat merged 2 commits intotox-dev:mainfrom
Conversation
Applications have platform-specific installation directories that users need to discover programmatically. This adds `user_applications_dir` and `user_applications_path` across all platforms, following the same pattern as other media directories (no appname/version appending). Platform paths: `~/.local/share/applications` on Linux (XDG spec), `~/Applications` on macOS, `Start Menu\Programs` on Windows, and `user_data_dir` on Android. The XDG mixin respects `$XDG_DATA_HOME` when set, falling back to platform defaults otherwise. Closes tox-dev#235
e32c791 to
cd4e0c8
Compare
Both properties were added in recent PRs but missing from the API reference and platform path tables.
1974fbf to
2573f34
Compare
gaborbernat
added a commit
to gaborbernat/platformdirs
that referenced
this pull request
Feb 14, 2026
Merges changes from upstream/main including: - use_site_for_root parameter (tox-dev#426) - site_state_dir and site_log_dir APIs (tox-dev#424, tox-dev#425) - user_bin_dir and user_applications_dir APIs (tox-dev#430, tox-dev#432) - Windows environment variable overrides (tox-dev#427, tox-dev#428) - Various bug fixes and improvements Adds missing documentation for use_site_for_root parameter in the Usage Guide, addressing issue tox-dev#433. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applications have platform-specific directories where launchers and shortcuts are registered —
.desktopfiles on Linux, the per-userApplicationsfolder on macOS, and Start Menu shortcuts on Windows. There was no way to discover these paths programmatically throughplatformdirs, forcing users to hardcode platform-specific logic. 🗂️user_applications_diranduser_applications_pathreturn the correct path on each platform:~/.local/share/applicationson Linux (per XDG spec, where.desktopfiles go),~/Applicationson macOS, andStart Menu\ProgramsviaFOLDERID_Programson Windows. Android falls back touser_data_dir. TheXDGMixinrespects$XDG_DATA_HOMEwhen set, deriving$XDG_DATA_HOME/applicationsbefore falling back to platform defaults. ✨This follows the same pattern as
user_bin_dir— a shared, non-app-specific directory that does not appendappnameorversion. On Windows,CSIDL_PROGRAMSis fully wired into the resolution chain (ctypes, registry, env-var fallback, andPLATFORMDIRS_PROGRAMSoverride). Documentation for bothuser_applications_diranduser_bin_diris included inapi.rstandplatforms.rst.Closes #235