diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-19 07:33:26 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-19 09:49:17 -0500 |
| commit | dc068955692811b99c954e2d948516639babf935 (patch) | |
| tree | fb9f7ccead9348dc2ed73392ab553ad2c8595373 | |
| parent | 8e52feb67ce5b94cc6542925009048cbb6bac547 (diff) | |
| download | archsetup-dc068955692811b99c954e2d948516639babf935.tar.gz archsetup-dc068955692811b99c954e2d948516639babf935.zip | |
fix(archsetup): write desktop defaults as a system dconf db
The previous block ran two `sudo -u $user dbus-launch dconf write …` calls during install to set GTK file-chooser and GNOME interface defaults. Both exited 1 on a headless install. The user had no real session bus, so dconf couldn't create `~/.config/dconf/user`. They also showed up in the 2026-05-11 / 16 / 18 VM-run error summaries.
I rewrote the block to compile a system-wide dconf db under `/etc/dconf/db/site.d/`. `dconf update` runs as root and needs no D-Bus. Settings apply to every user and can still be overridden per-user. Bonus: portal-gtk reads these on first login without the ~50s settings-proxy timeout the prior code aimed to prevent but couldn't deliver, since the per-user writes failed during install.
| -rwxr-xr-x | archsetup | 43 |
1 files changed, 26 insertions, 17 deletions
@@ -934,24 +934,33 @@ user_customizations() { (sudo -u "$username" update-desktop-database "/home/$username/.local/share/applications" \ >> "$logfile" 2>&1 ) || true - # install dconf before writing GTK/GNOME desktop settings (provides dconf) + # GTK and GNOME desktop interface settings — read by GTK apps and + # xdg-desktop-portal-gtk. Written as a system-wide dconf db rather than + # per-user dbus-launch dconf writes: the system path needs no session + # bus (which the prior approach lacked during install, exit-1ing both + # blocks), and portal-gtk reads the settings on first login without + # the ~50s settings-proxy timeout. Users can still override per-user. pacman_install dconf - - # GTK file chooser settings (stored in dconf, can't be stowed) - action="configuring GTK file chooser" && display "task" "$action" - (sudo -u "$username" dbus-launch dconf write /org/gtk/settings/file-chooser/sort-directories-first true \ - >> "$logfile" 2>&1 ) || error_warn "$action" "$?" - - # GNOME desktop interface settings (required for fast xdg-desktop-portal-gtk startup) - # Without these, portal-gtk waits ~50s for a settings proxy timeout - action="configuring GNOME interface settings in dconf" && display "task" "$action" - (sudo -u "$username" dbus-launch bash -c " - dconf write /org/gnome/desktop/interface/color-scheme \"'prefer-dark'\" - dconf write /org/gnome/desktop/interface/gtk-theme \"'Adwaita-dark'\" - dconf write /org/gnome/desktop/interface/icon-theme \"'Papirus-Dark'\" - dconf write /org/gnome/desktop/interface/cursor-theme \"'Bibata-Modern-Ice'\" - dconf write /org/gnome/desktop/interface/cursor-size 24 - " >> "$logfile" 2>&1 ) || error_warn "$action" "$?" + action="configuring system dconf defaults" && display "task" "$action" + ( + install -d -m 0755 /etc/dconf/profile /etc/dconf/db/site.d + cat > /etc/dconf/profile/user <<'EOF' +user-db:user +system-db:site +EOF + cat > /etc/dconf/db/site.d/00-archsetup-defaults <<'EOF' +[org/gtk/settings/file-chooser] +sort-directories-first=true + +[org/gnome/desktop/interface] +color-scheme='prefer-dark' +gtk-theme='Adwaita-dark' +icon-theme='Papirus-Dark' +cursor-theme='Bibata-Modern-Ice' +cursor-size=24 +EOF + dconf update + ) >> "$logfile" 2>&1 || error_warn "$action" "$?" action="marking dotfile dir as safe.directory" && display "task" "$action" if git config --global --add safe.directory "$user_archsetup_dir" >> "$logfile" 2>&1; then |
