Skip to content

Instantly share code, notes, and snippets.

@linhusp
Last active January 21, 2026 05:34
Show Gist options
  • Select an option

  • Save linhusp/05f8f7e0af3fa0fbb944dec17a75aa78 to your computer and use it in GitHub Desktop.

Select an option

Save linhusp/05f8f7e0af3fa0fbb944dec17a75aa78 to your computer and use it in GitHub Desktop.
(Not Really) A Guide To Setup Dolphin & KDE File Picker On Niri - Arch Linux

(Not Really) A Guide To Setup Dolphin & KDE File Picker On Niri - Arch Linux

My Thought On Making This

I have looked around online and noticed a lot of users that moved to Niri come from KDE, or were using Dolphin on their previous WM/DE and want to use it on Niri. The problem is that unlike Nautilus, the Dolphin experience on Niri is not out of the box, it has a lot of issues. 90% of the time you open Dolphin the first time it doesn't work properly and it looks horrible. So I try to write this to stealgather all the fixes that I have found and turn it into a guide for newcomers to make Dolphin functions as close as it was on KDE.

This guide focuses on Vanilla Niri. I personally don't use any plugin or theming shell so I don't know exactly how they work.

At the time I'm writing this I'm thinking of upload it into a gist or something at some point, to make it easier to update things and to access/download. Edit: gist

You should read the Niri wiki before this.

Goal

Is to simply make Dolphin, KDE file picker and KDE theming kinda work in Niri. The setup covers:

  • Thumbnails supports
  • Environment configuration
  • Dolphin losing default applications
  • KDE file picker as the default
  • Force KDE file picker on Firefox instead of the GTK one
  • Optional packages
  • Theming on Dolphin & KDE file picker

Bonus:

  • File pickers appears too big/fullscreen

1. Required Packages

These are the packages that SHOULD be installed:

+ dolphin
+ systemsettings
+ xdg-desktop-portal-kde
+ ffmpegthumbnailer
+ ffmpegthumbs

Note:

  • systemsettings is the preferable way to change icons, themes and fonts on KDE that you can still use on Niri. It also let you customize other things that is not possible on alternatives like qt6ct.

  • xdg-desktop-portal-kde comes with a bunch of depencencies but they are needed to replace the QT/GTK file picker with the KDE one.

  • ffmpegthumbnailer and ffmpegthumbs provide thumbnails for images and videos on Dolphin/KDE file picker.

If you still want to use screen sharing/recording then DO NOT remove xdg-desktop-portal-gnome and xdg-desktop-portal-gtk. Unless you did something really wrong there is no problem using them along side xdg-desktop-portal-kde.


2. Environment Configuration (Critical)

2.1 Put the environment variables in ~/.config/environment.d/

~/.config/environment.d/
├── 01-xdg-base.conf
├── 10-kde-on-niri.conf
├── 80-gtk-no-btn.conf
└── 99-electron.conf

Only 01-xdg-base.conf and 10-kde-on-niri.conf are really needed. The others are optional. I just want to show an example how I structure the files for easier to overview or change certain variables you want.

  1. 01-xdg-base.conf

    XDG_CONFIG_HOME=/home/<USER>/.config
    XDG_DATA_HOME=/home/<USER>/.local/share
    XDG_CACHE_HOME=/home/<USER>/.cache
    XDG_STATE_HOME=/home/<USER>/.local/state
    
    # REQUIRED: exposed native and Flatpak apps the same way KDE did
    XDG_DATA_DIRS=/home/<USER>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
    
  2. 10-kde-on-niri.conf

    QT_QPA_PLATFORM=wayland
    
    # REQUIRED: make sure portal uses KDE Qt platform theme
    QT_QPA_PLATFORMTHEME=kde
    QT_QPA_PLATFORMTHEME_QT6=kde
    
    # REQUIRED: helps fixing Dolphin default applications issue
    XDG_MENU_PREFIX=plasma-
    
    QT_AUTO_SCREEN_SCALE_FACTOR=1
    QT_ENABLE_HIGHDPI_SCALING=1
    QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor
    
  3. 80-gtk-no-btn.conf

    GTK_DECORATION_LAYOUT=
    
  4. 99-electron.conf

    ELECTRON_OZONE_PLATFORM_HINT=auto
    

Remember to run:

$ systemctl --user daemon-reexec

and then logout/login to apply.

2.2 Why not putting them in Niri's config file instead?

When you open for example Firefox or a flatpak application, it will activate the portal, in this case xdg-desktop-portal-kde. I believe it only inherits environment variables from systemd --user right after login.

Because niri-session starts after that, puting those variables in Niri config.kdl will not work as the portal cannot see it. So KDE apps spawned from these applications will still appear unthemed.


3. Dolphin Losing Default Applications

I think the direct cause comes from installing/removing packages and flatpak. If you:

  1. Have exposed native & Flatpak paths and set XDG_MENU_PREFIX=plasma- like in the above.

  2. Running once:

    $ kbuildsycoca6 --noincremental
  3. Auto start kded6

    spawn-at-startup "kded6"

The problem will likely not happen again.


4. KDE File Picker As The Default

Edit ~/.config/xdg-desktop-portal/niri-portals.conf, make sure the default is gnome.

[preferred]
default=gnome;
org.freedesktop.impl.portal.FileChooser=kde;

5. Force KDE File Picker On Firefox

You need to make KDE file picker the default one first.

Then on Firefox, go to about:config and set

widget.use-xdg-desktop-portal.file-picker = 1

6. Optional Packages/Applications

These are not necessarily required or anything but they (could) provide a better experience for a Niri + Dolphin + KDE portal setup:

  • kde-gtk-config to sync KDE settings to GTK apps. I'm not sure it will work 100% of the time, so you probably need the next one.

  • nwg-look is a GUI option to change icons, themes and fonts on GTK apps.

  • breeze is a universal theme so it's a good way to check if everything works. These are the ones to install:

    • breeze
    • breeze-gtk
    • breeze-icons
    • (flatpak) org.gtk.Gtk3theme.Breeze
  • ark to open and manage archives, is integrated into Dolphin context menu.

  • filelight to view disk usage, is integrated into Dolphin context menu.

  • (AUR) qimgv is an order of magnitude faster than any distro targeted image viewer that is not borderline featureless. You can choose whatever version you want. Personally I recommend the qt6 version as I use qimgv-qt6-kde-git.

  • (AUR) gdk-pixbuf2-noglycin as a workaround to GNOME upstream breaking changes on loading images involving glycin. You can read about it here and here.

  • (AUR) librsvg-noglycin same reason as the above. Use this to replace librsvg if you have one on your system.

  • (AUR) libadwaita-without-adwaita

    • As the pkgname already said.
    • It also replaces libadwaita as dependency so you can freely remove libportal and nautilus if you want, while still keeping Portal GNOME intact.

7. Theming

Although the guide is primary for Dolphin & KDE file picker. You probably want other applications to look the same.

7.1 Dark variant

For example if you are using the default Breeze theme:

  • KDE apps

    $ lookandfeeltool -a org.kde.breezedark.desktop
  • For GTK apps

    $ gsettings set org.gnome.desktop.interface gtk-theme 'Breeze-Dark'
    $ gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

Or just use ksettings and nwg-look.

7.2 Hide decorations/buttons

  • For GTK, you can only hide the buttons on the title bar:

    $ gsettings set org.gnome.desktop.wm.preferences button-layout "''"
  • For QT/KDE, if you set prefer-no-csd in niri it will hide title bar entirely.

7.3 Theming GTK2/3 and KDE/QT

There are quite of them that support both KDE/QT and GTK, like the Arc themes, Breeze, Matcha, Catppuccin etc. I don't have the best one to recommend.

7.4 Theming Flatpaks

  • The theme should be available on Flathub for Flatpak GTK apps to use it. If the theme are not there settings GTK_THEME in Flatpak's environment variables might work for a theme that support KDE/GTK3.

  • You may want to override these files to match custom fonts and settings on your system. Or easier use com.github.tchx84.Flatseal.

    flatpak override --user --filesystem=xdg-config/gtk-3.0:ro
    flatpak override --user --filesystem=xdg-config/gtk-4.0:ro
    flatpak override --user --filesystem=~/.local/share/fonts:ro
    flatpak override --user --filesystem=~/.config/kdeglobals:ro

7.5 Theming LibAdwaita apps

Now this's a tough one, here are the options I can think of:

  1. Live with the default hardcoded by the developers and deal with it.

  2. Stop using it and find the alternatives that your theme supports.

    Personally I think this is the best option as I never like the gigantic title bars and elements. Plus the whole application looks completely out of place on everywhere else except Vanilla GNOME. In general I don't support this walled garden approach.

  3. Replacing libadwaita with libadwaita-without-adwaita. As long as your theme supports GTK4, this will pickup the setting in org.gnome.desktop.interface.gtk-theme to load the GTK's palette into LibAdwaita. For example the Arc theme will work on LibAdwaita this way. There are still a few apps not looking correctly and this won't work on Flatpak LibAdwaita apps.

  4. Use some programs to theme it like gradience or rewaita.

    Not "truly theming", but at least you can tune the color palette to match your GTK/QT theme. I'm not sure about rewaita but I still keep some Breeze and Gruvbox gtk.css files generated from gradience. Even though the project already archived long ago it still works, probably will keep working until the next breaking changes of LibAdwaita.

    There are some "theming engines" for QT+GTK+LibAdwaita out there. I could be wrong but most if not all of them are scripts that generated a material you palette from e.g pywal, then hacking the css file of Adw-GTK, while applying the same palette to Breeze. In a sense they are not much different than gradience.

    There is a material you theming project but focus more on KDE kde-material-you-colors. I haven't had the time to look into this and test if it can work on Dolphin on Niri.


Bonus


8. File Pickers Appear Too Big/Fullscreen

This could be fixed by a window rule, something like this:

window-rule {
    # match title="^(Open|Choose|Save)(.*)$"
    match app-id="(xdg-desktop-portal)(.*)"
    match app-id="filepicker"
    match app-id="org.freedesktop.impl.portal.desktop.kde"
    default-column-width { proportion 0.5; }
    default-window-height { proportion 0.8; }
    open-floating true
    open-fullscreen false
}

8.1 Some applications still ingore window rule

There are some that are able to change the window's title immediately after spawning, so the window rules can't be applied. The biggest offender is Firefox.

It really depends on the application. For example with Firefox you can try this and see if it helps:

window-rule {
    match app-id="firefox" title="- (.*) Mozilla Firefox"
    default-column-width { proportion 0.5; }
    default-window-height { proportion 0.6; }
    open-fullscreen false
}
@linhusp
Copy link
Author

linhusp commented Jan 14, 2026

KDE file picker on zen-browser, niri

2026-01-14.22-01-58.mp4

@MegasVN
Copy link

MegasVN commented Jan 17, 2026

putting environment variables on ~/.config/environment.d/ does nothing but putting it on niri config works flawlessly. Unsure why even though I ran SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator and it did shows environments variables get set

Also this part

XDG_CONFIG_HOME=%h/.config
XDG_DATA_HOME=%h/.local/share
XDG_CACHE_HOME=%h/.cache
XDG_STATE_HOME=%h/.local/state

breaks everything for some reason it create a new home directory under home called %h, maybe change it to

XDG_CONFIG_HOME=$HOME/.config
XDG_DATA_HOME=$HOME/.local/share
XDG_CACHE_HOME=$HOME/.cache
XDG_STATE_HOME=$HOME/.local/state

might works or it just make a new home directory called $HOME, to be honest that would be funny

Anyways very nice guide super helpful thanks :D

@MegasVN
Copy link

MegasVN commented Jan 17, 2026

I forgot about the
XDG_DATA_DIRS=%h/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

but yeah same issues as others

@MegasVN
Copy link

MegasVN commented Jan 17, 2026

Update here change to $HOME does make it works however the environment still does nothing so still have to use the niri config

environment {

    QT_QPA_PLATFORM "wayland"

    QT_QPA_PLATFORMTHEME "kde"
    QT_QPA_PLATFORMTHEME_QT6 "kde"

    XDG_MENU_PREFIX "plasma-"

    QT_AUTO_SCREEN_SCALE_FACTOR "1"
    QT_ENABLE_HIGHDPI_SCALING "1"
    QT_SCALE_FACTOR_ROUNDING_POLICY "RoundPreferFloor"

    ELECTRON_OZONE_PLATFORM_HINT "auto"

add this to your niri.kdl and it should works after a reboot or log out

@linhusp
Copy link
Author

linhusp commented Jan 18, 2026

putting environment variables on ~/.config/environment.d/ does nothing but putting it on niri config works flawlessly. Unsure why even though I ran SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator and it did shows environments variables get set

Also this part

XDG_CONFIG_HOME=%h/.config
XDG_DATA_HOME=%h/.local/share
XDG_CACHE_HOME=%h/.cache
XDG_STATE_HOME=%h/.local/state

breaks everything for some reason it create a new home directory under home called %h, maybe change it to

XDG_CONFIG_HOME=$HOME/.config
XDG_DATA_HOME=$HOME/.local/share
XDG_CACHE_HOME=$HOME/.cache
XDG_STATE_HOME=$HOME/.local/state

might works or it just make a new home directory called $HOME, to be honest that would be funny

Anyways very nice guide super helpful thanks :D

Hi, it was my mistake. I copied the thing from a service file and forgot to reformat to .conf file. It has to be specific like /home/<YOUR USER>/. For example /home/linhusp/.config, as it doesn't allow syntax like $HOME. I have updated it, sorry for the issue.

@linhusp
Copy link
Author

linhusp commented Jan 18, 2026

Update here change to $HOME does make it works however the environment still does nothing so still have to use the niri config

environment {

    QT_QPA_PLATFORM "wayland"

    QT_QPA_PLATFORMTHEME "kde"
    QT_QPA_PLATFORMTHEME_QT6 "kde"

    XDG_MENU_PREFIX "plasma-"

    QT_AUTO_SCREEN_SCALE_FACTOR "1"
    QT_ENABLE_HIGHDPI_SCALING "1"
    QT_SCALE_FACTOR_ROUNDING_POLICY "RoundPreferFloor"

    ELECTRON_OZONE_PLATFORM_HINT "auto"

add this to your niri.kdl and it should works after a reboot or log out

I think the PLATFORMTHEME variables should be in ~/.config/environment.d so the KDE portal can see it. If it's on niri config file I think for example KDE filepicker will still appear as default theme.

@MegasVN
Copy link

MegasVN commented Jan 18, 2026

yeah I keep both of the environment just in case but without the environment on the niri config nothing works :(

@linhusp
Copy link
Author

linhusp commented Jan 18, 2026

That's strange... Because putting them in ~/.config/environment.d means systemd will have all variables to pass to anything it spawns, like portal-kde or niri.

How did you run niri, through a display manager or you launch niri directly from the TTY? Did you use niri or niri-session?

@MegasVN
Copy link

MegasVN commented Jan 18, 2026

i use sddm to launch niri

@linhusp
Copy link
Author

linhusp commented Jan 18, 2026

Have you tried using sddm to launch niri-session instead of niri?

@Juts2
Copy link

Juts2 commented Jan 18, 2026

Something weird to note, if you are using quickshell/dms then running kded6 breaks the system tray.
Not sure why.

@linhusp
Copy link
Author

linhusp commented Jan 18, 2026

Something weird to note, if you are using quickshell/dms then running kded6 breaks the system tray. Not sure why.

Interesting. Well that's why I made a statement that I try to focus on vanilla Niri only. I haven't had much time for dms/notalia yet. For now you can try disable kded6 and see if Dolphin will later lose default applications again or not.

@MegasVN
Copy link

MegasVN commented Jan 19, 2026

Something weird to note, if you are using quickshell/dms then running kded6 breaks the system tray. Not sure why.

it's the quickshell problem, I use Noctalia, tray also gone, a Noctalia dev told me it's kded6 conflicting with Quickshell tray so kded6 overrides it. They also gave me a work around you can try it out yourself too, for me it works great

spawn-at-startup "dbus-update-activation-environment --systemd --all"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment