Request for a file picker standard.

Cezary Drożak czarek at drozak.net
Sat Jan 11 15:09:50 UTC 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/xdg/attachments/20200111/138ecc1b/attachment.htm>


More information about the xdg mailing list