Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

125.6. xdg-user-dirs-0.20

Well-known user directories (Desktop, Documents, Music…) and their names in user-dirs.dirs

0.20-1 · GPL-2.0-or-later AND MIT · 0.1 SBU · 77.2 KiB, 11 files · 41_system, 1046 of 1047 · ports/core/xdg/xdg-user-dirs

Homepage: https://www.freedesktop.org/wiki/Software/xdg-user-dirs

xdg-user-dirs manages the well-known folders of a home directory: Desktop, Downloads, Documents, Music, Pictures, Videos, Templates, Public and Projects. xdg-user-dirs-update writes where each one is to ~/.config/user-dirs.dirs and creates any that is missing, and xdg-user-dir prints one of them for a script.

On KDOS it runs at every Plasma login: the port installs /etc/xdg/autostart/xdg-user-dirs.desktop, which Plasma starts in autostart phase 1. Dolphin’s Places panel, the file dialogs and every program that saves to “Downloads” or “Pictures” read the folders from user-dirs.dirs. /etc/skel ships no user-dirs.dirs: the first Plasma login writes it from /etc/xdg/user-dirs.defaults and makes the folders, Projects among them. A copied file naming folders that a useradd -m home lacks would have every one of them reassigned to $HOME. Later runs keep every entry that names an existing directory and add what the defaults list and the file lacks.

Depends on: meson, ninja, libxslt, docbook-xsl, docbook-xml.

Required by (1): plasma-desktop.

Sources: xdg-user-dirs-0.20.tar.xz (52.5 KiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install xdg-user-dirs'

build.sh:

meson setup build \
	--prefix=/usr --sysconfdir=/etc --libdir=lib \
	--buildtype=release \
	-Ddocs=true \
	-Dnls=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

rm -rf "$PKG/usr/lib/systemd"

Programs: xdg-user-dir, xdg-user-dirs-update.

Directories: /usr/share/licenses/xdg-user-dirs.

The recipe deletes /usr/lib/systemd. The build installs a systemd user unit there whether or not systemd is found, and the package lint refuses the directory; the autostart entry does the same job in a Plasma session.

xdg-user-dirs-update calls gettext even with -Dnls=false. On KDOS the functions come from musl, whose <libintl.h> is the one installed. A build root whose <libintl.h> is GNU gettext’s renames them to libintl_* and the link fails unless -lintl is added; that happens in an Alpine container with gettext-dev, not in the tree.