Skip to content

✨ feat(api): add user_applications_dir property#432

Merged
gaborbernat merged 2 commits intotox-dev:mainfrom
gaborbernat:235-applications
Feb 14, 2026
Merged

✨ feat(api): add user_applications_dir property#432
gaborbernat merged 2 commits intotox-dev:mainfrom
gaborbernat:235-applications

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

@gaborbernat gaborbernat commented Feb 14, 2026

Applications have platform-specific directories where launchers and shortcuts are registered — .desktop files on Linux, the per-user Applications folder on macOS, and Start Menu shortcuts on Windows. There was no way to discover these paths programmatically through platformdirs, forcing users to hardcode platform-specific logic. 🗂️

user_applications_dir and user_applications_path return the correct path on each platform: ~/.local/share/applications on Linux (per XDG spec, where .desktop files go), ~/Applications on macOS, and Start Menu\Programs via FOLDERID_Programs on Windows. Android falls back to user_data_dir. The XDGMixin respects $XDG_DATA_HOME when set, deriving $XDG_DATA_HOME/applications before falling back to platform defaults. ✨

This follows the same pattern as user_bin_dir — a shared, non-app-specific directory that does not append appname or version. On Windows, CSIDL_PROGRAMS is fully wired into the resolution chain (ctypes, registry, env-var fallback, and PLATFORMDIRS_PROGRAMS override). Documentation for both user_applications_dir and user_bin_dir is included in api.rst and platforms.rst.

Closes #235

@gaborbernat gaborbernat requested a review from ofek as a code owner February 14, 2026 00:48
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
Both properties were added in recent PRs but missing from the API
reference and platform path tables.
@gaborbernat gaborbernat merged commit f6b900e into tox-dev:main Feb 14, 2026
29 checks passed
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>
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.

HOME and StartMenu?

1 participant