This is already a thing somewhat with XDG desktop portals. Both GTK+
and Qt (and other toolkits) are able to take advantage of them, and
you can swap out the portals being used to switch between file
pickers, among other things.

See: https://github.com/flatpak/xdg-desktop-portal,
https://github.com/flatpak/xdg-desktop-portal-gtk,
https://github.com/KDE/xdg-desktop-portal-kde.

-- Carson Black [ jan Pontaoski ]

Am Sa., 11. Jan. 2020 um 10:10 Uhr schrieb Cezary Drożak <cza...@drozak.net>:
>
> Hello,
> since there is no standard for implementing a file picker in applications, 
> each application uses a different one.
> If the application has been written in GTK+, it will use the GTK+ file 
> picker, if it has been written in QT it will use QT file picker.
>
> The problem with this approach is that they differ in look, feature set, 
> accessibility and most importantly in the usage. It also contradicts with the 
> UNIX philosophy of modularity. While I can replace almost every part of my 
> operating system, I cannot do that with the file picker.
>
> Therefore, I am suggesting a standard for calling a default or a user chosen 
> file picker by a standard command. For example:
> * Show a file picker with applied filters:
> * `xdg-filepicker --mime text/plain` or `xdg-filepicker -m text/plain`
> * `xdg-filepicker --extension *.txt` or `xdg-filepicker -e *.txt`
> * Allow selecting multiple files:
> * `xdg-filepicker --multi`
>
> These commands would return the list of paths to the chosen files. For 
> example:
> ```
> $ xdg-filepicker --multi         # File picker with multi select and no 
> filters applied opens
> /home/user/Documents/lorem_ipsum.txt    # After selecting the files in file 
> picker,
> /home/user/Documents/photo.jpg          # the command returns file list to 
> the standard output
> ```
>
> I do not know what would be the best approach for setting the file picker. I 
> think that there could alternatively be an environmental variable like 
> `XDG_FILE_PICKER`. There are also a few more things to consider, such as 
> backward compatibility and extensibility. As for extensibility, emacs with 
> GUI shows a hint at the bottom of a GTK file dialog and Libreoffice shows 
> checkbox for opening in read-only mode and choosing file version.
>
> Regards,
> Cezary Drożak
>
> _______________________________________________
> xdg mailing list
> xdg@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/xdg
_______________________________________________
xdg mailing list
xdg@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/xdg

Reply via email to