11

App installed using apt package manager starts running when I type the app name in terminal like firefox. [Using Kubuntu 22.04]

which firefox

This command will show the path of firefox in my system.

In case of Flatpak apps, how to run the the flatpak app without

flatpak run org.mozilla.firefox

So, how can I find flatpak app's path like which firefox.

I need it so that I can set brave browser app in $CHROME_EXECUTABLE path for flutter development.

Shezan
  • 651

2 Answers2

12

which returns the full pathname of an executable, provided it exists in one of the directories listed in the search PATH. flatpak exposes executables for installed applications in /var/lib/flatpak/exports/bin. However, that directory is not automatically included in the PATH when you install flatpak. You could include it in the PATH yourself. Then, you could launch the Firefox version installed by flatpak with the command org.mozilla.firefox.

You can always launch an executable by providing the full path name:

/var/lib/flatpak/exports/bin/org.mozilla.firefox

So you can just set the variable as:

CHROME_EXECUTABLE=/var/lib/flatpak/exports/bin/org.mozilla.firefox

So, how can I find flatpak app's path like which firefox.

Just by being informed about how flatpak does it, or from the documentation. No tool can provide that information if the executable is not in the path or if you do not know the name of the executable.

vanadium
  • 98,427
  • Thanks again vanadium bro. You have helped me twice. – Shezan Jul 05 '22 at 14:24
  • somehow I also got soltuion a few moment ago by randomly use locate firefox/firefox and it lead me to /var/lib/flatpak/app/org.mozilla.firefox/x86_64/stable/SOME_BIG_VALUE/files/lib/firefox/firefox-bin . – Shezan Jul 05 '22 at 14:26
2

The suggestion in the first answer that executables are in /var/lib/flatpak/exports/bin isn't necessarily reliable when trying to evaluate paths of say, plug-in applications that are also installed via flatpak and won't appear in the flatpak/exports subfolders.

Another method of seeing where a flatpath executable path is can be done using the flatpak info --show-location your.application.ID . You may need to run flatpak list beforehand to check and see what the desired application ID is.

(this answer is inspired by this comment on reddit)