Expand Nautilus into usage as file picker in Open/Save dialog (provides space to preview)#6019
Expand Nautilus into usage as file picker in Open/Save dialog (provides space to preview)#6019tyvsmith wants to merge 2 commits into
Conversation
Routes the FileChooser portal to xdg-desktop-portal-gnome so file dialogs use the Nautilus-style picker with sidebar and preview instead of the basic GtkFileChooser shown by xdg-desktop-portal-gtk. Other portal interfaces continue to be served by hyprland and gtk.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR configures Hyprland setups to use the GNOME portal implementation specifically for the FileChooser interface (to enable previews in Open/Save dialogs), while keeping other portals preferred as Hyprland/GTK.
Changes:
- Adds a migration script that installs
xdg-desktop-portal-gnome, writes portal config, and restarts the user portal service - Adds
xdg-desktop-portal-gnometo the base package list - Introduces an
xdg-desktop-portalconfig file to prefer GNOME forFileChooser
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| migrations/1780365321.sh | Installs GNOME portal, copies portal config into user config dir, restarts portal service |
| install/omarchy-base.packages | Ensures GNOME portal is included by default for fresh installs |
| config/xdg-desktop-portal/hyprland-portals.conf | Sets portal backend preferences, forcing FileChooser to GNOME |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "Use GNOME file picker portal for previews in Open/Save dialogs" | ||
|
|
||
| omarchy-pkg-add xdg-desktop-portal-gnome | ||
|
|
||
| mkdir -p ~/.config/xdg-desktop-portal | ||
| cp $OMARCHY_PATH/config/xdg-desktop-portal/hyprland-portals.conf ~/.config/xdg-desktop-portal/ | ||
|
|
||
| systemctl --user restart xdg-desktop-portal |
There was a problem hiding this comment.
Not applying this one — it conflicts with the established convention for omarchy migrations.
- Shebang: Migrations are never executed directly.
omarchy-migrateruns each one withbash "$file", so a#!/usr/bin/env bashline would be inert. 311 of the 313 existing migrations have no shebang. - Strict mode: Exactly one existing migration uses
set -e, and none useset -euo pipefail. Failure handling is already centralized in the runner: if a migration exits non-zero,omarchy-migratecatches it and offers agum confirm"Skip and continue?" prompt. Addingset -euo pipefailto a single migration would diverge from the whole corpus and change failure semantics inconsistently.
(The SC2148 shellcheck warning that prompted this fires on every migration in the repo and is intentionally ignored.)
| omarchy-pkg-add xdg-desktop-portal-gnome | ||
|
|
||
| mkdir -p ~/.config/xdg-desktop-portal | ||
| cp $OMARCHY_PATH/config/xdg-desktop-portal/hyprland-portals.conf ~/.config/xdg-desktop-portal/ |
There was a problem hiding this comment.
Addressed in 646db06. Replaced the manual mkdir -p + cp with the idiomatic omarchy-refresh-config xdg-desktop-portal/hyprland-portals.conf, which quotes its paths internally — so there is no longer an unquoted $OMARCHY_PATH in the migration.
| mkdir -p ~/.config/xdg-desktop-portal | ||
| cp $OMARCHY_PATH/config/xdg-desktop-portal/hyprland-portals.conf ~/.config/xdg-desktop-portal/ |
There was a problem hiding this comment.
Addressed in 646db06. Switched to omarchy-refresh-config, which is omarchy's standard helper for this. Before overwriting it writes a timestamped backup (hyprland-portals.conf.bak.<epoch>), diffs old vs new, and only keeps the backup if the file actually changed — so a user with local customizations keeps a copy rather than losing them silently.
| mkdir -p ~/.config/xdg-desktop-portal | ||
| cp $OMARCHY_PATH/config/xdg-desktop-portal/hyprland-portals.conf ~/.config/xdg-desktop-portal/ | ||
|
|
||
| systemctl --user restart xdg-desktop-portal |
There was a problem hiding this comment.
Not applying this one.
- Restarting only
xdg-desktop-portalis correct. Theorg.freedesktop.impl.portal.FileChooser = gnomepreference is read by the frontendxdg-desktop-portalservice, which then dispatches to backends. The GNOME backend is D-Bus–activated on demand, so restarting the frontend is sufficient to pick up the new routing — restartingxdg-desktop-portal-gnomeitself is unnecessary. This matches the existing portal-config migrationmigrations/1763478660.sh, which restarts onlyxdg-desktop-portal-hyprlandfor the same reason. try-restartvsrestart: Duringomarchy-migratethe portal is already running inside the live graphical session, so the two behave identically here — and plainrestartadditionally (re)starts it if needed, which is the desired outcome. No migration in the repo usestry-restart; plainsystemctl --user restartis the established pattern.- "No user systemd session" case: doesn't apply — omarchy is a systemd/uwsm/Hyprland session and migrations run within it.
Replaces the manual mkdir -p + cp with the idiomatic omarchy-refresh-config helper, which creates the target dir, quotes paths, and makes a timestamped backup before overwriting so any existing user customizations are preserved. Addresses Copilot review feedback on PR basecamp#6019. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
org.freedesktop.impl.portal.FileChooserportal interface toxdg-desktop-portal-gnomeso Open/Save dialogs use the Nautilus-style file picker (sidebar, preview, modern layout) instead of the basicGtkFileChoosershown byxdg-desktop-portal-gtk.hyprlandandgtk— the override is scoped to FileChooser only.What changed
install/omarchy-base.packagesxdg-desktop-portal-gnomeconfig/xdg-desktop-portal/hyprland-portals.conf~/.config/by the existinginstall/config/config.sh)migrations/1780365321.shxdg-desktop-portalfor existing usersWhy
The current default —
xdg-desktop-portal-gtkhandling FileChooser — gives the legacyGtkFileChooserdialog: no sidebar, no space to preview, single-column file list. This is jarring next to Nautilus, which is already Omarchy's default file manager and which the floating-window rule atdefault/hypr/apps/system.lua:3already expects to see for save/open dialogs.xdg-desktop-portal-gnomelaunches Nautilus itself as the picker (verified viahyprctl clients: the picker window's class isorg.gnome.Nautilus, matching the existing floating-window rule), so no Hyprland rule changes are needed.Trade-offs
xdg-desktop-portal-gnomeas an explicit dep. It pullsgnome-desktop-4andlibadwaita; most of its other deps (nautilus,gtk4,gdk-pixbuf2) are already installed via Omarchy's base set.Test plan
xdg-desktop-portal-gnomeis pulled in and~/.config/xdg-desktop-portal/hyprland-portals.confis in placehyprland)