Post by enigma9o7 on Apr 8, 2023 19:12:25 GMT
Preamble
This is an area I had never ventured into before, and man I don't understand it.
I just did clean install of Bodhi 7 alpha on my athlon64, and decided to embrace flatpak. In the past I've added PPAs for most every app I wanted a new version of, and this method actually works fine and my Bodhi 5.x machines I have pretty much up to date software because of it, but having everything come from one place seems easier, plus even more stuff is available on flathub than ppa. I also expect Bodhi 7 to remain the OS on this machine indefinitely - for one thing, it has old nvidia with a proprietary driver isn't supported by newer kernels, but with flatpak I'll be able to keep apps up to date forever. The main downside of flatpak seems to be that that it takes more disk space (and thus bandwidth) but those arent a big concern for me.
I've tried gnome-software with flatpak plugin as an app store, and its actually a very nice user interface, offering ratings and such, other than its RIDICULOUSLY SLOW. I don't get why. Click on a category, it takes 30+ seconds before it shows anything. It also remains resident in memory when you exit it (unless you run gnome-software --quit) so that it can be your update manager.... but it takes *lots* of memory, like 500MB sometimes. And it lists everything that's native and flatpak mixed together but separate entries, can't tell it to hide native packages for example and only browse flatpaks.
The flathub website, and the beta version of flathub website, are pretty unimpressive. You can browse and search, but no way to sort. Regardless, it's still useful, and when you click on the "Install" button on an app's page, it downloads a flatpakref file.
Body
if I tried to open the flatpakref file from chromium browser, by default it was using epiphany to open it. Later, after I installed abiword, they would open in abiword. I created my own install-flatpak.desktop file that includes "Exec=terminology -e flatpak install" and associated it with flatpakrefs in thunar as default, works fine now to double click. However, it wouldn't open with that from the browser (and it doesnt have an "open with"), and I learned that the browser uses "xdg-open" which uses mimetypes to open it, and sure enough when I tested with xdg-open it would open it in abiword because it considered it plain text.
I read archwiki and manpages and tried lots of things.... what I thought should work was described at the bottom of this page: man.archlinux.org/man/xdg-mime.1
I created ref-flatpak.xml like this:
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/x-flatpak">
<comment>Flatpak Ref</comment>
<glob pattern="*.flatpakref"/>
</mime-type>
</mime-info>
But it just wouldn't work even tho I think I did everything right. This mime type stuff is quite confusing to understand btw. So then I gave up on that, and made it work with magic - literally a file called /etc/magic and I put this into it:
0 string [Flatpak\ Ref] Flatpak Ref
!:mime application/vnd.flatpak.ref
And now it works to open it from xdg-open and chromium, by checking the first line of the file, instead of the extension. But I'm still dunno why it didnt work with the xml filename extension method.
Epiphany WebApp Fail
Epiphany WebApp Fail
So I decided to make a "flathub" webapp (for my kids to install games from mainly) so tried to do that with epiphany. When I open flathub with epiphany and click on install, works fine. However, once I convert it to a webapp, when I click on install, it opens the flatpakref in chromium then installs fine. I have no idea why its opening chromium when in webapp form but not when in full form, nor do I want chromium opened.
And epiphany crashes when i try to use beta.flathub.org which I guess is the new/upcoming web appstore version.
(FYI, epiphany 44 doesnt work with nvidia gpu! there's an active bugzilla entry about webkit for it... so I can't test with newer version).
Conclusion
So mainly I wanna know if anyone actually understands xdg-open and xdg-mime stuff and why my xml method failed. And wanna know is this magic method a bad idea? And of course, any hints on why epiphany as a webapp behaves differently.