Make IndiPDF default pdf file handler in Zorin 18

Is Dolphin File Manager something I have to install?

1 Like

I installed Dolphin FIle Manager to try it but do not get the "Open WIth" option on right clicking a file.

Did you try that command? It should be the easiest way. This terminal command sets indiPDF as default app for PDF. Nothing else to do.

xdg-mime default indiPDF.desktop application/pdf

To undo that, right-click on a pdf file in your file manager, select the Document Viewer as application and turn the slider on to "Always use for this file type".

If you want to edit the indiPDF.desktop file, enter in terminal

sudo nano /usr/share/applications/indiPDF.desktop

then move with the arrows down to the Exec line and change it. Press ctrl+o to save, enter to confirm and ctrl+x to quit the editor.

Edit: Where do you right-click on the file where the context menu "open with" is missing? Is that file on your desktop? You could try it with your file manager to see if the context menu "open with" appears there.

Look, that is the right-click context menu for a pdf file on the desktop. It has only "open" and "open with other application"

That is the right-click context menu of the same file in the Nautilus file manager. It has the option "open with"

If you want to change default apps, always use the filemanager and not the files on the desktop. In the file manager you have a slider to set apps as default, on the desktop not.

3 Likes

So there is the root cause of this. The deb version of indiPDF has a small syntax missing in its .desktop file, for which it does not appear in the list. The exec line is missing %F field code, surprisingly this is present in the Flatpak version by default. Looks like the package maintainer did not consider of this properly in the deb version.

Forpli has already mentioned about it and fixed with %U field code instead in the exec line.

Anyway the simple way to fix this, first open the indiPDF.desktop file in text editor:

gnome-text-editor admin:///usr/share/applications/indiPDF.desktop

and make the following two changes:

Categories=Utility;Office;
Exec=indipdf %F

Save the changes, now it should appear in your list and you can set it as default.

%f is only for local file that are in your drive. %u is however for url. Both will work opening the local files but in their own way.

for e.g when %f is used the app receives the absolute path to the file

/path/to/the/selected.file

and when %u is used the app receives the file url path to the file which is:

file:///path/to/the/selected.file

With %u you can even pass and open web links but %f strictly for local files only.

1 Like

You're right. I'll keep that in mind in the future and try not to automatically blame the Flatpaks. Unfortunately, it's often hard to pinpoint the cause of a problem, so sometimes it's easier to try a different package format and see if that works.

Which parameter would you recommend? %U ist the most comprehensive. Is it good to set that whenever an app is not shown in the "open with" list in Nautilus?

Yes, you can use %U. It is more general.

But if the app maintainers do their job perfectly and take care of these little things while packaging their apps, then as a regular desktop users we should not be dealing with all these in the first place. It's upto them to set which field parameter to use depending upon their app functionality and end user needs.

1 Like

I totally get it. I also try the similar approach when the reasons are unsure. Making guess works and narrow down to the cause. You also have done great doing so and helping others here. So cheers to that :clinking_glasses:

1 Like

I have to remember this command! It's much easier for other users and linux beginners than using nano or dealing with admin:// in the Nautilus top bar. Thank you!

gnome-text-editor admin:///usr/share/applications/indiPDF.desktop

I just saw that you mentioned the Flatpak version contains %F. I had already wondered if the Flatpak .desktop file included such a suffix and that’s why it’s being displayed.
Since I mostly use the live session to help others in Zorin forum, where I can’t install Flatpaks due to insufficient RAM (or would have to create a separate swap file for it every day), and I don’t use Flatpaks on my own system (to save disk space), I wasn’t able to check that for myself.

1 Like

I am sorry but sometimes I have to. I always had problems with flatpak apps.
Some of the Flatpak problems I had:

  • I am using Dbeaver for database operations and flatpak had problems with mysql while Dumping or Restoring DB.
  • On Mission Center, it wasn’t showing icons but AppImage version showed it correctly. I had to create an issue for this to find out this. (Anyway later they also fixed it on flatpak)
  • On Podman Desktop, it doesn’t show the remote connections, but the normal release version (zipped one) shows correctly.
  • I use PlayOnLinux to manage wine versions and wineprefix environments with windows applications. Deb version from 15 years has 20 times more features than the current v5 flatpak version. I had to lose many days just to work with flatpak one.
  • As an example, the app needed to access to external drive but it wasn’t able to just because the it decided to only get permission for user filesystem. So I had to run with ‘sudo flatpak override org.phoenicis.playonlinux --filesystem=host’, but it didn’t work either. So I had to mount the file inside the apps’ folder etc
 You almost always need to change permissions of flatpak app using flatseal because current permissions are never enough. (It might be the responsability of whoever made that Flatpak but most of the time they release without testing enough)
  • On Brave Browser, Installing Brave on Linux | Brave official page literally states that it is not working as well as native packages and in addition, it modifies Chromium sandboxing in ways which have not been vetted by the Brave or Chromium security teams.
  • Flatpak Spotify is the first option that comes on Software store and it’s not the official application and with wayland it's even worse because it shows a blue bar on top.
  • For screenshot, I use flameshot application and and on flatpak version, it was giving me D-Bus errors so again solution was to use the native package.
  • Terminal access is another problem, normal you access to apps by writing firefox, but with flatpak you can only access with “flatpak run org.mozilla.firefox” and for most of the apps it’s not even easy to remember and with these kind of commands you cannot access to app parameters.
  • It also has with basic drag and drop. On one of the apps (I don’t remember which one) you want to drag a file and get “File: .. is empty and can't be sent.” and again you need to give access manually. Also, on Pinta app (most popular MSPaint alternative on Linux) and it didn’t even let me drag a image to an empty canvas. (Might be the problem of pinta itself)
  • I had firefox as flatpak and when I was pasting the path of a file to address bar it can’t find the path. (It finds for ~/Downloads folder so /home/myusername/Downloads/x.pdf works but doesn’t find ~/Documents folder even though they have the same permissions). If I open with “Open with” then it shows sth like file:///run/user/1000/doc/ac1fe048/

I had many more issues like this that I don’t even remember so now I only use flatpaks if there is no other method(appimage, native apt/deb, snap..). People say it’s for security but it makes me create issues for problems instead of doing my work. I have the same problem with wayland and that’s why I use x11/xorg. If you check you’ll see that on many issues on Zorin forum, the first thing they recommend is to use native packages or switch to x11 to see if it’s resolved. So maybe for this issue the problem wasn't the flatpak but in my experience, it becomes the first thing I suspect unfortunately. (If you're an app developer and develop flatpak, I respect that because I know that it's not convenient to distribute your app for .deb/.rmp/.pkg.tar.zst so I understand why you prefer flatpaks)

1 Like

Thank you for sharing your experiences with flatpaks. I can imagine how annoying it has been for you with so many hiccups. Good thing is there are other package managers available so if one have an issue then we can use the other ones whichever works best for us.

And I'm not a developer, I'm just a regular desktop user. I prefer appimage if available but these are sometimes troublesome to manage. Initially I used to not go for flatpaks but couple of months back I started trying out few of its apps and find no major issues, so my current stance on it is "They are not that bad". And just because they worked for me, I'm not saying everyone should start using them. Use the ones that you have less issues with.

1 Like

I did use that command and it worked. Also, I had been right clicking the file right on the desktop. Once I right clicked on the file in Nautilus file manager, the "Open With" option was there and I could now select IndiPDF as default PDF handler.

Thanks for all the help! Sorry I couldn't figure this one out on my own. Still getting used to Linux and Zorin. Loving the switch from Windows, though!

2 Likes

No problem, you're welcome! I'm glad it worked out for you!
I learned a lot from exploring that problem, too.

1 Like

I marked @Forpli's Post as Solution.