Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/xdg-desktop-portal/hyprland-portals.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[preferred]
default=hyprland;gtk
org.freedesktop.impl.portal.FileChooser=folio;gtk
org.freedesktop.impl.portal.Secret=gnome-keyring
4 changes: 4 additions & 0 deletions default/hypr/apps/system.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ o.window("org.omarchy.about", { size = { 920, 480 } })
-- to fit the screen.
o.window("folio-preview", { float = true })

-- Files is the file chooser other apps get through the portal (see
-- hyprland-portals.conf), and its dialogs float as the GTK ones did.
o.window("folio-chooser", { tag = "+floating-window" })

o.window("omacalc", { float = true })

-- Popped window rounding.
Expand Down
2 changes: 1 addition & 1 deletion docs/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ The input method's candidate window is drawn by Fcitx's classicui, from `default
Qt apps are themed by the qtengine platform theme (`QT_QPA_PLATFORMTHEME=qtengine` in `default/hypr/envs.lua`), configured by `~/.config/qtengine/config.json`, seeded from `config/qtengine/config.json`. Its `colorScheme` points at `~/.local/state/omarchy/current/theme/qtengine.colors`, a KDE color scheme rendered from `default/themed/qtengine.colors.tpl`; a theme can ship its own `qtengine.colors` instead. qtengine layers `~/.config/kdeglobals` under that file, so the template defines colour roles for both normal and inactive groups. KColorScheme selects an existing inactive subgroup instead of the normal group; omitting one would let a KDE install supply its unfocused-window colours. Content (lists, text fields, editors) sits on `background`, the color a theme's hues are drawn against in the terminal, and the window chrome around it on `dark_background`.
Switching themes needs no retint for the palette. The first Qt process to start (normally the shell) claims `org.qtengine.ConfigWatcher` on the session bus and watches the config and the color scheme file; swapping in the new theme directory replaces the file, and that process tells every Qt app to reload. QWidget apps repaint with the new palette; Qt Quick apps only pick it up at their next launch. KDE apps that choose Breeze and their own color scheme are left to do so.

The icon theme lives in the config rather than the theme, so `omarchy-theme-set-qt` writes `Adwaita`, the icons every theme uses as GTK does, into `.theme.iconTheme` on each switch, leaving the rest of the file alone. That write also makes running apps reload their icons. Native file dialogs are delegated to the XDG desktop portal (`misc.dialogTheme`), and `config/xdg-desktop-portal/hyprland-portals.conf` falls through to the GTK backend for the file chooser, so Qt apps keep the GTK file chooser.
The icon theme lives in the config rather than the theme, so `omarchy-theme-set-qt` writes `Adwaita`, the icons every theme uses as GTK does, into `.theme.iconTheme` on each switch, leaving the rest of the file alone. That write also makes running apps reload their icons. Native file dialogs are delegated to the XDG desktop portal (`misc.dialogTheme`), and `config/xdg-desktop-portal/hyprland-portals.conf` sends the file chooser to Files (`folio chooser`), falling back to the GTK one where Files doesn't provide it, so Qt and GTK apps alike get Files' Open and Save dialogs.

## App icons

Expand Down
28 changes: 28 additions & 0 deletions migrations/1794775358.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
echo "Use Files for other apps' Open and Save dialogs"

portal_config="${XDG_CONFIG_HOME:-$HOME/.config}/xdg-desktop-portal/hyprland-portals.conf"

# Only the portal config Omarchy installs, and only where no file chooser has
# been picked in it: a user's own portals.conf or choice stays as it is.
if [[ ! -f $portal_config ]]; then
echo "No Omarchy portal config, skipping..."
exit 0
fi
if grep -q '^org\.freedesktop\.impl\.portal\.FileChooser=' "$portal_config"; then
echo "File chooser already configured, skipping..."
exit 0
fi
if ! grep -qx '\[preferred\]' "$portal_config"; then
echo "Portal config has no [preferred] section, skipping..."
exit 0
fi

# Files first, GTK where Files doesn't provide the chooser yet.
sed -i '/^\[preferred\]$/a org.freedesktop.impl.portal.FileChooser=folio;gtk' "$portal_config"
Comment thread
dhh marked this conversation as resolved.
Resolved

# Activate it immediately in a live desktop
if systemctl --user is-active --quiet xdg-desktop-portal.service 2>/dev/null; then
if ! systemctl --user restart xdg-desktop-portal.service; then
echo "Failed to restart xdg-desktop-portal" >&2
fi
fi