sector-f-linux

Sector F Linux
git clone https://git.sectorflabs.com/sector-f-linux.git
Log | Files | Refs | README | LICENSE

0017-the-first-login-creates-the-users-folders.md (2059B)


      1 # 0017. The first login creates the user's standard folders
      2 
      3 Date: 2026-11-27
      4 
      5 ## Status
      6 
      7 Accepted (the user's direction: fix it in the image, so an update delivers it).
      8 
      9 ## Context
     10 
     11 A machine installed from the ISO had `~/Pictures/Wallpapers` and Settings did not show it. Nothing had
     12 created `~/.config/user-dirs.dirs`, the file that tells apps where Pictures, Downloads and the rest
     13 are. Patina's apps ask the `dirs` crate (`dirs::picture_dir()` and the others), which returns nothing
     14 without that file: Settings skipped the folder and hid its "Open wallpapers folder" button, and Files'
     15 sidebar (Desktop, Documents, Downloads, Music, Pictures, Videos), Settings' avatars, Montage and Mail
     16 use the same lookup.
     17 
     18 Fedora does ship the fix: `xdg-user-dirs.service`, a user unit that runs `xdg-user-dirs-update`, enabled
     19 by preset. But it hangs on `graphical-session-pre.target`, which only a full desktop session (GNOME's)
     20 starts. Patina's session does not reach any `graphical-session*` target, so the unit never ran.
     21 
     22 ## Decision
     23 
     24 - The image also wants `xdg-user-dirs.service` from `default.target`, which every login reaches
     25   (`/usr/lib/systemd/user/default.target.wants/xdg-user-dirs.service`, a symlink in `linux/system/`).
     26   The first login of a user creates the folders and the file; it is harmless to repeat.
     27 - It reaches machines that are already installed through an update: the folders appear at the next login.
     28 
     29 Tried in the test VM: without the link the unit stays inactive and the file is missing; with it the
     30 file and the folders are created as soon as the user's manager starts.
     31 
     32 ## Not done
     33 
     34 - Patina's apps could fall back to `~/Pictures` and the others when the lookup returns nothing (the
     35   compositor's screenshot code already does). That would make them work on a machine whose file was
     36   deleted. It is a change in patina-desktop.
     37 - Starting `graphical-session.target` from patina-session is the general fix for everything that
     38   expects a systemd-managed session (XDG autostart, for one). It is larger and belongs in patina-desktop.