this post was submitted on 11 Apr 2024
48 points (100.0% liked)

Linux

48181 readers
1422 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I wrote a simple script in order to help someone in a recent reply from me, to make running Flatpak applications from terminal easier. After that I worked a little bit on it further and now ended up with 2 completely different approaches.

  1. flatrun: Run an app by a matching search filter. If multiple matches, then print all matching app ids instead.
  2. flatapp: Show list of installed apps in an interactive menu. Plus show a description of the app in a preview window. Run the selected application. Requires fzf.
  3. flatsearch: Show search results from repository in an interactive menu. A selected entry will be installed or uninstalled if it exists already (with confirmation from flatpak). Requires fzf.
# Show all matching apps
$ flatrun F
com.github.tchx84.Flatseal
io.freetubeapp.FreeTube

# Run io.freetubeapp.FreeTube
$ flatrun freetube

# Show help for com.obsproject.Studio
$ flatrun obs --help

or flatapp: (requires fzf)

and new flatsearch youtube (requires fzf)

you are viewing a single comment's thread
view the rest of the comments
[–] mwguy@infosec.pub 6 points 7 months ago (1 children)

Can we just have flatpak apps added to the system path by default? Like have a directory /usr/local/flatpak/bin and have links to all the executable show up there. Then users can choose to add that to their path if they wish.

[–] thingsiplay@beehaw.org 9 points 7 months ago (2 children)

We have that already: $ ls "/var/lib/flatpak/exports/bin/"

[–] mwguy@infosec.pub 4 points 7 months ago (1 children)

Well now I feel silly. Brb changing my default path.

[–] thingsiplay@beehaw.org 3 points 7 months ago

No need to feel silly. If you didn't ask, you wouldn't learn about it. I learned about it yesterday in the post where I initially gave the first version of the script. It's a documentation issue I would say, in some way. Such an important part should have been made clear for every user.

I "insist" you feel not sorry, because I'm in the same boat as you. :D

[–] Dirk@lemmy.ml 1 points 7 months ago (1 children)

... and this part is before /usr/local/bin making it impossible to override Flatpak bins or desktop files.

[–] thingsiplay@beehaw.org 2 points 7 months ago* (last edited 7 months ago) (1 children)

One can just move the path to another place in the $PATH. Not really impossible. Not an elegant solution, just proof of concept:

export PATH="$(echo "${PATH}" | sed 's+:/var/lib/flatpak/exports/bin++'):/var/lib/flatpak/exports/bin"

Edit:

Or if it makes you uncomfortable to change the placement of this folder in the $PATH, instead you can just add a new directory solely for this purpose. In example add "/home/yourname/.local/flatpak/bin" (or whatever else you like) and put it in front of the flatpak exports directory.

[–] boredsquirrel@slrpnk.net 2 points 5 months ago* (last edited 5 months ago) (1 children)

Or use ~/.local/bin/

Didnt know about the preferences. These only depend on the order of placement in PATH?

Or do they get by directory hierarchy, i.e. HOME can always override the System.

Unix stuff is so simple sometimes

[–] thingsiplay@beehaw.org 2 points 5 months ago (1 children)

No, the order of the directories in the $PATH is important. If you run command by name like grep, then the system will lookup in $PATH beginning from first directory. If its not in the first entry, then it falls back to next entry. If you have a command with same name multiple times in different directories, then you display all found paths with which -a grep in example; the first entry is what is used when running the command grep .

[–] boredsquirrel@slrpnk.net 2 points 5 months ago

Thanks, good to know!