XDG_DESKTOP_DIR="$HOME" makes apps scatter .desktop shortcuts into the home directory
Summary
omarchy-provision-user points DESKTOP, TEMPLATES and PUBLICSHARE at $HOME and removes the
folders:
# /usr/bin/omarchy-provision-user (omarchy 4.0.2-1, lines ~98-101)
xdg-user-dirs-update --set TEMPLATES "$HOME"
xdg-user-dirs-update --set PUBLICSHARE "$HOME"
xdg-user-dirs-update --set DESKTOP "$HOME"
rmdir ~/Templates ~/Public ~/Desktop 2>/dev/null || true
The intent is clear and I agree with it — Hyprland has no desktop metaphor, so three permanently empty folders are noise. Pointing an XDG dir at the home directory is also the freedesktop-documented way to say "this directory doesn't exist here", so this isn't a hack.
The problem is that apps don't interpret it that way. Nothing reads XDG_DESKTOP_DIR=$HOME as
"there is no desktop, skip it". They read it as "the desktop is ~" and write there. So the setting
that exists to keep $HOME tidy is the thing that untidies it.
Impact
On one machine, after about a day of ordinary use, ~ had collected:
steam.desktop # byte-identical to /usr/share/applications/steam.desktop
chrome-<id>-Default.desktop # Chrome PWA shortcut
chrome-<id>-Default.desktop # Chrome PWA shortcut
chrome-<id>-Default.desktop # Chrome PWA shortcut
Two things make this worse than ordinary clutter:
- The files are inert. Walker and the app menu read
~/.local/share/applications/, where correct copies already exist. The~copies are never used by anything. - They are stale duplicates. The Chrome PWA copies in
~lacked the%Uargument and theMimeType=line that the~/.local/share/applications/versions carry, so they were also worse copies — e.g. missingx-scheme-handler/mailtoregistration.
Users are unlikely to connect loose .desktop files in $HOME to an XDG setting, so they accumulate
indefinitely.
Reproduce
On a stock Omarchy install:
omarchy-install-steam(or install Steam by any means) and let it create a desktop shortcut, and/or- In Chrome, open any site → Cast, save and share → Install page as app
ls ~/*.desktop
Expected: nothing in $HOME. Actual: one .desktop file per shortcut.
Suggested fix
Keep the intent, drop the side effect — give DESKTOP a real but out-of-the-way target rather than
$HOME:
xdg-user-dirs-update --set DESKTOP "$HOME/.local/share/desktop"
No visible folder in $HOME, and anything that insists on writing a desktop shortcut lands somewhere
ignorable. TEMPLATES and PUBLICSHARE are rarely written to by anything, so they matter less — but
the same reasoning applies.
An alternative, if a hidden path feels wrong, is to leave the folders in place and accept three empty directories; that at least confines the writes.
Environment
- omarchy
4.0.2-1 xdg-user-dirs 0.20-1/etc/xdg/user-dirs.defaultsships the standard layout (DESKTOP=Desktop,TEMPLATES=Templates,PUBLICSHARE=Public); the$HOMEvalues come fromomarchy-provision-user, not the system default.
Related
- #1331 — proposal that Omarchy avoid creating files in the user's home directory (same concern, other direction)
I would like to work on this. Proposed scope: point new installs to a hidden desktop directory, add an idempotent migration only when the current XDG desktop value is exactly HOME, preserve user-customized paths, and avoid moving or deleting existing .desktop files. I will add focused fresh-install/migration tests and run the project CLI/full test suites.
Confirmed in source on current quattro (988f44ea): bin/omarchy-provision-user:109 sets DESKTOP to $HOME on a fresh install, and the 3.x upgrade sets it the same way in bin/omarchy-upgrade-to-quattro:2068. Apps that create desktop shortcuts write them to that directory, so they land in ~. I did not run the Steam or Chrome reproduction on a worker. The mechanism is explicit in the source, and whether an app writes to XDG_DESKTOP_DIR is that app's behaviour, not something Omarchy controls.
The fix is already open as #9563, which says Fixes #9556. It points new installs at ~/.local/share/desktop and adds a migration that changes the setting only where it is still exactly $HOME. On an upgraded machine that migration would correct the value: the upgrade sets DESKTOP before it runs pending migrations. #9563 will be reviewed separately. #9562 took the same approach and was closed in favour of #9563.
This review was done by Opus 5.5 alone. No second opinion ran, because the configured reviewer (Codex Medium) had reached its daily limit.
Next step is the maintainer's: whether to take #9563.