I am using nemo as my default file and desktop manager using How to set Nemo as the default file manager in Ubuntu?
In brief it looks like:
sudo apt install nemo
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
And ~/.config/autostart/nemo-desktop.desktop file looks like:
[Desktop Entry]
Type=Application
Name=Nemo
Comment=Start Nemo desktop at log in
Exec=nemo-desktop
X-GNOME-AutoRestart=true
NoDisplay=true
The refered answer suggest using Desktop Icons NG (DING) extension and the following:
gsettings set org.gnome.shell.extensions.ding use-nemo true
However, that replace the nemo-destop, which will break my UX, so I refrained from it.
Everything is alright till now except the file picker or file chooser.
The Gtk / GIO FileChooser:
- Add some extra folders in Places Sidebar which I do not want.
- There is no address bar in the file picker (I know i can press Ctrl+L to get the address bar, but I want it by default).
I would like to have something like (lookswise):
zenity --file-selection
zenity --file-selection --save
kdialog --getopenfilename
kdialog --getsavefilename
I found that xdg-desktop-portal is the new tool to do this sort of stuff (please correct me if i am wrong).
There are some posts which suggest using GTK_USE_PORTAL=1, XDG_CURRENT_DESKTOP=KDE. I am not optimistic about it. What does GTK_USE_PORTAL=1 mean? Here, 1 is a hard coded value, why not 2 or 3. How is it processed? Again if I use XDG_CURRENT_DESKTOP=KDE in a gnome system, then will it not break stuff?
Is there a simpler way to tell gnome that use file picker from X portal?
I found the following files so there are dbus interfaces for file picker.
/usr/share/glib-2.0/schemas/org.gtk.gtk4.Settings.FileChooser.gschema.xml
/usr/share/glib-2.0/schemas/org.gtk.Settings.FileChooser.gschema.xml
In my machine, I also found multiple xdg-desktop-portal
$ ls -la /usr/share/xdg-desktop-portal/portals
.rw-r--r-- 100 root 23 Mar 14:48 gnome-keyring.portal
.rw-r--r-- 99 root 20 Mar 02:25 gnome-shell.portal
.rw-r--r-- 548 root 18 Oct 2022 gnome.portal
.rw-r--r-- 495 root 29 Nov 2022 gtk.portal
.rw-r--r-- 664 root 6 Jul 12:27 kde.portal
So, what is the easiest way to switch to a different xdg-desktop-portal to have a different file picker? (I am open to any suggestions to address my issue as long as the file picker is changed or modified to address my needs, i am not fixated at xdg-desktop-portal, i just have a feeling that it is the tool for the job, i might be absolutely wrong).