Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Flatpak for command line tools #1188
Comments
aiamuzz
commented
Nov 22, 2017
|
Yup i second that ... better command access needed to the flatpak ecosystem. |
|
The best it could do is export |
|
Probably your best option is an alias, e.g. |
alexlarsson
added
the
enhancement
label
Dec 6, 2017
patriziobruno
commented
Dec 14, 2017
•
|
Ubuntu's snap gives a good example on how to support this: it creates in /usr/bin a symlink to a script launching the app. Flatpak could create the symlink either in /usr/bin or in ~/bin based on the --user/--system arg. Symlinks would allow to handle different versions seamlessly |
|
Creating a symlink/wrapper is easy, not allowing a fart app to install a "firefox" symlink is less so. |
patriziobruno
commented
Dec 14, 2017
|
Any alias hiding the complexity of using flatpak run complete.long.package.name, being it either a shell alias or a symlink would take its toll on security, but that's true for .desktop files as well. Unless you check under the hood before clicking on an icon in gnome-shell you will never know what you're going to run. |
|
The design of flatpak is such that desktop files and icons cannot conflict by name. It is true however that they can have the same description and icon, but then you will get two firefox icons and be confused, rather than silently replacing the real one. |
patriziobruno
commented
Dec 14, 2017
•
|
That depends on the DE you're using and the way you launch apps. My MO on Gnome is to press Super, start typing the name of the app I want to run and click on the first icon on the top left. In this case typing libreoffice to start the libreoffice's file-selector will provide a not-complete-because-too-long list of the icons with a description beginning with "libreoffice", so I can see only one "Libreoffice" icon, but in fact I have two installations, one from the Ubuntu repo, the other from flathub. How would I know that I'm not clicking on the wrong one, unless I dig a little deeper, something an average desktop user usually doesn't do. You can't control what users install on their machine outside flatpak, what you can do is to check at installation time that:
After this, if a user run a malicious script that messes up with the symlinks and/or the .desktop files pointing to flatpak apps, it's completely out of control for flatpak, at least for this issue, it could still be matter for a different user-story though: "add a flatpak check-consistency command to verify that flatpak apps have not been tampered with". My 2 cents |
cra0zy
commented
Dec 14, 2017
•
How about having a designated flatpak bin folder for aliases and giving the user an option to either add it to their PATH variable or not? (same can be done for autocomplete files and man pages) |
|
@cra0zy Opting into insecurity is questionable, the end result is just new user forums will have copy paste guides on enabling it, user friendly distros will start enabling it out of the box, etc and nothing was actually improved. |
cra0zy
commented
Dec 15, 2017
|
@TingPing What specific insecurities are you trying to avoid? If its flatpak apps installing fake commands for stuff like |
Because users are known for being very attentive and things like warning messages are known for being successful. The only way it can be done "securely" is if we require app-id's for commands with the assumption that important cli tools never do that. |
|
Yes, i could see exporting wrappers like Also, given such wrappers, it is much easier for a user to (manually) create an alias for a more readable name. |
alexlarsson
referenced this issue
Dec 15, 2017
Closed
Export binary wrappers for easier CLI use #1254
|
I just merged #1254 which lets you opt-in (by adding to your PATH) exported wrappers of the main binary in flatpak apps named by the appid. I realize this is less than some people want, but it is also, simple, safe and easily tweakable by aliases. I don't want to auto-add the wrapper dirs to the real PATH, because such a modification is bound to break a lot of users setups. |
vadyalex
commented
Dec 22, 2017
@cra0zy I am assuming you mean shell command completion.. if you are using zsh you can try flatpak plugin for oh_my_zsh |
cra0zy
commented
Dec 22, 2017
|
@vadyalex we are not talking about the |

cra0zy commentedNov 22, 2017
From what I've read of the documentation there are 3 things that seem to be missing for command line tools:
flatpak --run org.bla.blaevery time seems tedious