Cover image by Sergey Kuznetsov.
There are at least three ways of distributing applications in Linux: AppImage, Flatpak, and Snap. Each one of these have different advantages and disadvantages but often it is not that important as a user since the format to use is a decision to be taken by the developer. Some applications already take care of this step for you, in case they don't keep reading, in this post I will show you a way to configure AppImage applications to be available from your desktop.
First I want to say I am not an expert in the subject, it is just a problem I had been facing for some time now and today I decided to spend some time putting the pieces together and documenting my solution, if you happen to know a bit more about the topic I encourage you to leave a note in the comments and I'll be happy to update. First some questions you will probably need to answer at some point.
Where to put the app file?
This is totally opinionated, my only important recommendation is to move them out of the ~/Downloads
, ~/Desktop
or ~/Documents
common folders. I like to use /opt
, since I believe it is a nice way to keep things in a place I know I have to look for when moving my things from one computer to another.
How to find mime types?
If you happen to need a mime type for the configuration, you can use this command that will be available in most Linux distros,
xdg-mime query filetype README.md
For a more detailed explanation read How to Determine MIME Type of a File in Linux.
How desktop environments find apps?
Fortunately for us, the users, desktop environments like GNOME adopted a standard configuration file to describe how an application will be displayed in the start menu and later launched, you can read about it in the latest Desktop Entry Specification.
Where are those files located?
One common place to look for these files is /usr/share/applications/
, it is good for learning and looking for examples of categories, but probably not a good idea to put your files there. Apparently the recommendation is to use ~/.local/share/applications/
where ~
stand for your home directory. This recommendation makes sense because it is usually better to have system configuration you made contained in your own directory.
Inside of these directories you will find a dozen of files using the desktop extension. Those are just text files that describe how to display and launch your applications.
How does a .desktop file looks like?
As I mentioned above, there is a full specification, but for the sake of learning, I'll show here the file I created for Beekeeper Studio:
[Desktop Entry]
Name=Beekeeper Studio
Comment=Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more.
TryExec=/opt/Beekeeper-Studio-3.5.1.AppImage
Exec=/opt/Beekeeper-Studio-3.5.1.AppImage
Icon=beekeeper-studio
Terminal=false
StartupWMClass=Beekeeper
Type=Application
Categories=Development;
Keywords=sql;db;database;
X-GNOME-UsesNotifications=true
X-GNOME-SingleWindow=true
To be honest I don't know if all lines are valid, I used another file as a template and left most properties that seemed to make sense.
One important note is that the Icon
refers to an icon I downloaded from the project's Github repository and placed in ~/.local/share/icons/beekeeper-studio.png
, I saw in StackOverflow that svg seemed to be valid, but didn't try that. About the Category
I just copied it from another entry as well, but in this answer you can read a bit more about it.
Why not use an automated method?
There seem to be two ways of doing this automatically and are explained in AppImage's documentation for desktop integration.
Probably those are better suited, but I was looking for something very straight-forward and the description there was not something like copy & paste solution, it implied more reading, and after seeing that Alacritty included the desktop file I thought it was way easier to just type a few lines in a text file instead of reading documentation and installing another thing in my system.
While I was looking for how to do it, I came to some YouTube videos, while I am not much of a video guy I did use some of the description as confirmation of what I was doing, and I think it is probably worth watching them, so here are the links:
If you found this information useful, please give it a like to let me know you care and continue writing. You can follow me here or in Twitter to keep you informed when I write a new post.
Top comments (0)