Skip to main content
Version: 2.1

Dux Labs

Desktop Integration

Desktop Integration

Reveal in File Manager​

While it runs, Dux Files owns org.freedesktop.FileManager1 on the session bus, so ShowFolders, ShowItems and ShowItemProperties calls from other apps land here. Browsers built on Chromium ask the desktop portal's OpenDirectory when a portal runs, and the portal forwards that to ShowItems.

Dux Files never takes the name from another file manager. It waits in the queue until that one quits. Settings → General → Register as the session file manager stops a running Dux Files from asking for the name at all.

make install and the distribution packages also install dev.duxlabs.files.FileManager1.service, so a call can start Dux Files when nothing owns the name. An instance started that way serves the call whatever the setting says, and quits if it never opens a window (for example when the call named a missing file).

note

Nautilus, Dolphin, Thunar and Nemo ship activation files for the same name. dbus-daemon(1) gives the first service directory precedence (the default PREFIX=/usr/local puts ours ahead of /usr/share) and calls the choice arbitrary inside one directory. If another file manager keeps winning, remove its activation file or install Dux Files under a prefix that sorts first.

Default File Manager​

xdg-mime default dev.duxlabs.files.desktop inode/directory

The desktop entry also claims trash, sftp and smb URIs and the archive types Dux Files can extract, so you can make it the default for those the same way.

Open and Save Dialogs​

Dux Files can serve org.freedesktop.impl.portal.FileChooser, the backend side of the desktop portal's file chooser. Apps that ask the portal for files then get a Dux Files window with the same sidebar, bookmarks, search and keys as the file manager:

  • Flatpak apps
  • Chromium browsers
  • Firefox with widget.use-xdg-desktop-portal.file-picker set to 1
  • GTK 4 apps under GDK_DEBUG=portals
  • Qt apps under QT_QPA_PLATFORMTHEME=xdgdesktopportal

Apps that draw their own dialogs are unchanged. The dialog is a standalone window: Qt 6.12 and Quickshell do not import xdg-foreign handles, so it is not attached to the calling window and the modal option is ignored.

Turning it on​

Nothing is switched on by install. The packages ship dfiles.portal and its activation file, but the choice of backend is per user, in ~/.config/xdg-desktop-portal/<desktop>-portals.conf. Two ways to flip it:

  • Settings → General → Use Dank Files for open and save dialogs
  • dfiles portal install

Both write the per-user files when the packaged ones are missing, put dfiles first in the org.freedesktop.impl.portal.FileChooser key (keeping the previous backend as the fallback and every other line as it was), and record what changed so Restore or dfiles portal uninstall puts it back. dfiles portal status shows each part.

xdg-desktop-portal reads its configuration once at startup, so the change takes effect after:

systemctl --user restart xdg-desktop-portal.service

The UI and the CLI ask before doing that, because the restart cancels file dialogs other apps have open.

How it starts​

The portal activates the backend on demand through the activation file. Without the systemd user unit that means one hidden start of Dux Files whenever xdg-desktop-portal starts (it quits again after 30 s with nothing to show) and a cold start for the first dialog. With the unit, the resident instance answers at once. See Running at Login.

Floating the dialog​

The chooser window carries the calling app's id and the title the app asked for. A niri rule that floats it:

window-rule {
match app-id=r#"^dev\.duxlabs\.files$"# title=r#"^(Open|Save|Select|Upload|Export|Import)"#
open-floating true
}

Packaging and Nix​

Packagers install dfiles.portal under share/xdg-desktop-portal/portals/ and the service file under share/dbus-1/services/ with the binary path substituted, and do not ship a portals.conf that prefers it. On NixOS and home-manager, programs.dank-files.portal.enable registers the backend and portal.preferred writes the preference. See NixOS Installation.

The Flatpak cannot register the backend: Flatpak exports no share/xdg-desktop-portal files.

Lifetime​

The systemd user unit starts Dux Files with --keep-running, so the close button hides the last window there. Started any other way, closing the last window quits unless Settings → General → Close behavior says to keep running.

Theme​

Dux Files follows Dux Shell's colors when Settings → Appearance → Color source is Auto and Dux Shell runs. Pick Preset for a bundled palette or Custom for your own theme file. Light and dark follow the desktop portal's color scheme setting.

Next Steps​

  • Keyboard - Every shortcut
  • IPC - Drive Dux Files from keybinds and scripts