.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:
- The download is really simple: unzip and double-click on the appropriate binary for your OS
- 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:
- Make a
.desktop
file with specs from the Arch wiki - https://wiki.archlinux.org/title/Desktop_entries#Application_entry - Put that file in the appropriate locations
- 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:
-
-basedir
- It’s used so Xonotic knows where to find config files(maps, weapons, user settings, etc)
-
Icon=
- Theres a MacOS X icon in
Xonotic/Xonotic.app/Contents/Resources
, but I don’t think .desktop files support Mac icons - https://wiki.archlinux.org/title/Desktop_entries#Common_image_formats) - So, I used https://xonotic.org/favicon-194x194.png, but you can get a different image or image size by going to the site, opening Inspect, and filtering by image files in the Network tab
- Theres a MacOS X icon in
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:
- for Linux, you have 2 choices:
xonotic-linux64-sdl
andxonotic-linux64-glx
- to the best of my knowledge, they’re two different graphics options- if one doesn’t work, try the other, but there isn’t a “best” choice for every distro/computer
- more info here - https://forums.xonotic.org/showthread.php?tid=2640
{Here’s where I’ll put setup info for other distros, plain Ubuntu, plain Debian, etc}