If you’re like me, you probably like to launch your GUI applications from the terminal at least occasionally… or from scripts… or from a quick launcher which doesn’t search
.desktop names because you find it annoying to have your intent second-guessed by poor ergonomics in “multiple things match” situations.
However, as shown by the Flatpak developers closing #1188: Improve cli application experience and then locking it because real-world reports of how awkward the current situation is (eg. for invoking a Flatpak-installed copy of Meld from
git merge) are apparently “abusive comments”,
/var/lib/flatpak/exports/bin is the best we’ll get out of them, and I don’t like typing
org.inkscape.Inkscape in the terminal.
I still think Flatpak is the best solution for a lot of other things which I don’t want to have to do myself (especially when paired with using Flatseal to lock down app permissions further), but this is ugly, it’s a usability regression, and it doesn’t even tab-complete well.
Fortunately, since I’m an end-user who doesn’t have to solve all the edge-cases, it’s easy for me to hack together a solution that works in all my use-cases.
- Query Flatpak for the list of installed application IDs (
flatpak list --columns=ref)
flatpak info -mon each application ID and parse out the application’s actual command name (if one exists) from the
.ini-esque output (not perfect, since some app developers/maintainers will use/omit launcher wrappers when they don’t expect you to have to type the name, but it gets you 99% of the way. For example, Flatseal‘s actual binary name is
flatseal, and Flatpak is a perfect way to distrust something like JDownloader that you still need to use, but its
- Add a folder to the end of your
exec flatpak run ... "$@"scripts named after the extracted command names. (Better than using
aliasbecause you don’t have to coordinate re-
source-ing the file in each open terminal for updates to apply.)
…and so, I present to you a proof of concept. It’s got shortcomings, but those are all fixable when I have time to come back to it and rewrite it in a language with a proper