cmc/cleberg.net
My personal web garden & blog.
clone: git clone https://gitbay.org/cmc/cleberg.net.git
main: content/blog/2023-01-21-flatpak-symlinks.org · raw
1#+date: [2023-01-21 Sat 00:00:00]
2#+title: Flatpak Symlinks: Shorten the Command
3#+description: Creating symlinks for Flatpak apps to make them easier to launch.
4#+slug: flatpak-symlinks
5#+filetags: :linux:
6
7* Running Flatpak Apps Should Be Faster
8
9If you're like me and use Flatpak for those pesky apps that cannot run
10on your system for one reason or another, you likely get annoyed with
11opening a terminal and manually running the Flatpak app with the lengthy
12=flatpak run ...= command.
13
14In the past, I manually created aliases in my =.zshrc= file for certain
15apps. For example, an alias would look like the example below.
16
17This would allow me to run the command fast within the terminal, but it
18wouldn't allow me to run it in an application launcher.
19
20#+begin_src sh
21# ~/.zshrc
22alias librewolf = "flatpak run io.gitlab.librewolf-community"
23#+end_src
24
25However, I now use a much faster and better method that integrates with
26the tiling WMs I use and their application launchers - =dmenu= and
27=bemenu=.
28
29* Creating Symlinks for Flatpak Apps
30
31Let's use the example of Librewolf below. I can install the application
32like so:
33
34#+begin_src sh
35flatpak install flathub io.gitlab.librewolf-community
36#+end_src
37
38Once installed, I can create a symlink to link the flatpak app to my new
39symlink in a location commonly included in your PATH. In this case, I
40chose =/usr/bin=. You may need to choose a different location if
41=/usr/bin= isn't in your PATH.
42
43#+begin_src sh
44ln -s /var/lib/flatpak/exports/bin/io.gitlab.librewolf-community /usr/bin/librewolf
45#+end_src
46
47Once complete, you should be able to launch the app using the command
48name you chose above in the symlink (=librewolf=) from a terminal or
49from your application launcher!