Open gregorni opened 1 year ago
This issue raises some questions, like: If the app can be set as default for images, why not also make a button for setting it as default for text files, PDFs, audio, etc.? But how should all these buttons fit in the welcome window? And if that's already there, why not just make one button that sets the app as default for everything in one go?
that sets the app as default for everything in one go?
Maybeeeee? We would have to ship the list of all known mime types and add an option in Junction "Remember" so you can opt out for certain types.
If the app can be set as default for images, why not also make a button for setting it as default for text files, PDFs, audio, etc.? But how should all these buttons fit in the welcome window?
My first thought was to do something similar to gcc "Default Apps" panel. But I agree it doesn't work too well with Junction.
Perhaps we could do a list of well known types and let user add new mime types.
IIRC @BrainBlasted had thoughts on this when I released Junction
This is how we currently set Junction as default app https://github.com/sonnyp/Junction/blob/d4b34d731a6b561e01e2976b4d97337b1c99eefd/src/welcome.js#L37
Note that spawn_sync
uses flatpak-spawn --host
in Flatpak.
We would have to ship the list of all known mime types and add an option in Junction "Remember" so you can opt out for certain types.
There is also a problem here, because "all mimetypes" also includes stuff like AppImages, which you might not want to open in Junction.
Also, I noticed going through all image and video mimetypes is also a hassle, because you have really many uncommon formats like heic, avif and bmp, and sometimes even app-specific ones like totem-stream, whatever that is, where I'm not sure if they belong in Junction. So the sheer amount of mimetypes might already become a problem.
This is how we currently set Junction as default app
https://github.com/sonnyp/Junction/blob/d4b34d731a6b561e01e2976b4d97337b1c99eefd/src/welcome.js#L37
Note that
spawn_sync
usesflatpak-spawn --host
in Flatpak.
Yeah, that's fine. A slightly modified version of that function can be used to set Junction as default for whatever mimetypes you want, but making 50+ setAsDefaultApplicationForX
functions seems kind of clunky to me.
Mimetypes/Filetypes are a mess.
gio mime
isn't the only way to set associations
There is also ~/.config/mimeapps.list
gio mime
isn't the only way to set associationsThere is also
~/.config/mimeapps.list
I guess that could also be used. How would that make things easier?
We can add numerous entries at once by writing to that file.
GLib has a parser/serializer for this format https://docs.gtk.org/glib/struct.KeyFile.html
We can add numerous entries at once by writing to that file.
GLib as a parser/serializer for this format https://docs.gtk.org/glib/struct.KeyFile.html
Oh, okay, that's smart. Should be fairly easy in terms of code
According to feedback from app reviews, setting Junction as default for opening images and videos with a button (similar to how it's set for web links right now) would be a nice feature.