0

I've tried on and off for several weeks now to create a .desktop file for the Ungoogled Chromium AppImage I use. I had tried to install the browser through other means, such as through the instructions on its github which includes building binaries, but they either didn't work, didn't produce anything use-able, or, in the case of the binaries, was left to work for around 12 hours and did not seem to make anything I could use, or figure out how to use. I've tried asking in the Xubuntu help channel several times in regards to making a .desktop file for the AppImage I end up having to use, as well as searching for a solution on my own, but nothing I could find ended up working properly, leading me to just have to navigate to the AppImage and open it every time.

Now, on a new install of Xubuntu, I tried doing the same thing, but the AppImage wont start, asking me what application I wish to use to open it, while recommending none, instead of allowing me to simply execute it as I had done on my other Xubuntu system. It would be greatly appreciated If I could also get some help on making Xubuntu accept it as my default browser, as right now I currently get an error, but my primary issue is I've got absolutely no idea what I can do to create a functioning .desktop file which allows the AppImage to be searchable and then launchable. I'm using 22.04 Xubuntu installed from a USB onto a fresh storage device. Just started using Linux recently, so being thorough would be greatly appreciated.

Neuw1
  • 3
  • What did you try? What is the .desktop file you came up with this far? Your question actually is quite unclear - does the AppImage run properly? What Ubuntu version are you using? Add all essential information to your question (and try to make your question more concise and clear by shorting the text). – vanadium Aug 31 '22 at 07:46
  • What specifically do you mean by Ubuntu version? I specified it's Xubuntu 22.04, but you don't make it very clear what extra information about the version you want other than that. The AppImage runs fine, as I said in my post. I tried to make a .desktop file, followed two different guides on making one, and then tried to put those files where was specified in the guides. The .desktop files did nothing either time, so my question, as it says in the title, is about how to make a .desktop file for Ungoogled Chromium. Not sure how you managed to get confused, hopefully its clear now. – Neuw1 Sep 02 '22 at 04:45
  • I see. I guess I was confused because the post is quite lengthy and not quite quickly coming to the point. Anyway, others may have a better grip at it. It would likely be useful to show the contents of the launcher you created unless you are absolutely sure the content is not the issue. – vanadium Sep 02 '22 at 07:25
  • I'm not absolutely sure about anything regarding the launcher I had made, and after it did not work I deleted it. I don't know what specifically does or doesn't need to be in the launcher, where it needs to go, or where the AppImage has to go as well for it to work. That is why I asked how to make a .desktop file and not why my attempt won't work, as some thorough instructions would likely prove more successful in guiding me to creating a working .desktop file, especially when I can provide ample amounts of information and when I can specify what specifically I'm creating the file for. – Neuw1 Sep 13 '22 at 00:22
  • 2

1 Answers1

2

With a text editor, create a text file with the .desktop extension in the directory ~/.local/share/applications (~ represents your home directory, .local is a hidden directory - turn "show hidden files" on in the file manager to see these hidden directories and files).

Paste following content

[Desktop Entry]
Exec=/full/path/to/your/executable.AppImage
Name=Ungoogled Chromium
Comment=A free and open source web browser
Type=Application

There is probably no need to indicate that you need to replace the path after Exec= with the actual path and name of your AppImage file.

That is the minimum you need for a valid .desktop file. It will automatically be included in your application menu because it resides in ~/.local/share/applications.

You probably want a dedicated icon for that launcher. Then add following line to the .desktop file:

Icon=/path/to/your/icon.png

Alternatively, place your icon file in ~/local/share/icons. Then you can simply refer to the icon by the file name without extension:

Icon=icon

Alternatively, use a graphical application like "menulibre" or "alacarte" to create a menu item (which creates a .desktop launcher file for you).

vanadium
  • 88,010
  • I greatly appreciate the thorough step by step explanation, I think I know a few of the errors with my previous attempts after successfully managing to produce a .desktop file using your instructions. One error I did encounter was related to having a space in file names, resulting in an error message saying that no file or folder exists at ".../example " when the path I had given was ".../example text/..." Just changing the names of the involved folders fixed that issue, though. – Neuw1 Sep 15 '22 at 07:18
  • Likely you also can quote pathnames with spaces. – vanadium Sep 15 '22 at 08:00