.desktop, Symlinks, and Xonotic

0xBlue

Background:

So there’s a game I like to play - Xonotic. If you haven’t played it, it’s kind of like if Diabotical and Halo arena had a baby, and then raised that baby on a constant transfusion of caffeine. Unfortunately, it has yet to receive a Debian package, which means 2 things:

  1. The download is really simple: unzip and double-click on the appropriate binary for your OS
  2. You don’t get the benefits of larger downloads, like menu/desktop links

Luckily, we can remove #2 from the equation with the power of .desktop entries!

The plan goes something like this:

  1. Make a .desktop file with specs from the Arch wiki - https://wiki.archlinux.org/title/Desktop_entries#Application_entry
  2. Put that file in the appropriate locations
  3. Click and run!(hopefully) Otherwise, troubleshoot

1 - Making the .desktop file:


[Desktop Entry]
Name=Xonotic
Comment=3D arena shooter
Keywords=shooter;arena;fps;game;
Exec=/home/0xBlue/Downloads/Xonotic/xonotic-linux64-glx -basedir /home/0xBlue/Downloads/Xonotic/
Icon=/home/0xBlue/Downloads/Xonotic/myXonoticLogo.png
Terminal=false
Type=Application
Categories=Games;

Most of the stuff here is self explanatory, but there are 2 things I want to mention:


2 - Put the file in the right place:

Part A - Placing it in the appropriate system dir:

From the Arch wiki(hallowed be thy name):

Desktop entries for applications, or .desktop files, are generally a combination of meta information resources and a shortcut of an application. These files usually reside in /usr/share/applications/ or /usr/local/share/applications/ for applications installed system-wide, or ~/.local/share/applications/ for user-specific applications. User entries take precedence over system entries.

Pick whatever suits you best - I put mine in ~/.local/share/applications/, but that’s just me.

Part B - making a desktop icon:

If you want a desktop icon to click on, you can make a symlink to it:


ln -s source destination

Note: the destination can’t already exist, or you’ll get an error.

Example:


ln -s ~/.local/share/applications/xonotic.desktop ~/Desktop/myDesktopXonotic.desktop

ln -s is to make a symbolic link(file points to original) instead of a normal hard link(file is a copy of the original)

Note: On PopOS, you have to two-finger-click on the desktop icon and select “Allow Launching”. There’s probably a similar process for other distros, but I haven’t tried them yet.


3 - Troubleshooting/other notes:

{Here’s where I’ll put setup info for other distros, plain Ubuntu, plain Debian, etc}

That’s it - glhf! 🖖