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

Linux

48338 readers
475 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
[–] barbara@lemmy.ml 4 points 7 months ago* (last edited 7 months ago) (2 children)

those commands are gold! Thank you for sharing! Saved them. They work flawlessly so far.

If flatpak search would work with fzf, it would be easier to use and faster than GNOME software

edit:

I added echo "${app}" to flatapp in order to print the app in terminal to have a visual response which app will run. (some apps take some seconds to open on my slow machine)

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

I thought about additional echo for confirmation too! I will add it too (give me 2 minutes), but it will output to stderr, so it's not part of regular output.

Edit: So I added

echo "flatpak run" "${app}" "${@}" >&2

, which as said will output to stderr instead. And I also decided to add flatpak run and the arguments too, but that's just an "aesthetic" choice.

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

Hey, I just created a search with fzf menu for install or uninstall app. It's not pretty, because its a bit unorganized looking and I could not find a good and easy way to solve this. But it seems to be working so far.

flatsearch

[–] barbara@lemmy.ml 2 points 7 months ago

That is awesome as well. Incredible what you can do with just a few lines of code.