From dc068955692811b99c954e2d948516639babf935 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 19 May 2026 07:33:26 -0500 Subject: fix(archsetup): write desktop defaults as a system dconf db MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- archsetup | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/archsetup b/archsetup index 53679b8..d044d1c 100755 --- a/archsetup +++ b/archsetup @@ -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 -- cgit v1.2.3