Uxn Desktop Entries
I’ve been following the fantastic Uxn project for a few years and enjoy using many of the tools Devine has put together for this unique platform—programs like Left, Noodle, Notepad, and m291.
To make it easy to launch these in GNOME, I’ve added custom desktop entries which are picked up by most Linux GUI launchers. Creating these files can be curiously fiddly (especially if you need to reference files in your home directory) so I thought I’d post an example here for reference.
User-specific desktop entries are registered by adding .desktop
files in ~/.local/share/applications
—my entry for Left, the Uxn writing tool, is called left.desktop
and contains the following:
[Desktop Entry]
Type=Application
Version=1.0
Name=Left
Comment=A writing tool
Exec=sh -c "$HOME/.local/bin/uxn11 $HOME/roms/left.rom"
Icon=left.turnip
Terminal=false
Categories=Development;
There’s a couple of things in here which weren’t obvious to me and might benefit from calling out. Both of these are related to the lack of support for path expansion in desktop entries:
User-specific icons must be placed in
~/.local/share/icons
and referenced by their filename excluding the path extension1. In the example above, I’m using one of the PNG files from the Hundredrabbits projects page, saved as~/.local/share/icons/left.turnip.png
and referenced asleft.turnip
.You need to jump through
sh
if the executable is located in your home directory (or you need to reference user-specific paths). Since all the Uxn projects are configured to install ROMs to the~/roms
directory, usingsh -c
makes it possible to use the$HOME
environment variable to specify both the path ofuxn11
(the X11 Uxn emulator) and my local copy of the Left ROM.
With a collection of entries like this, I’m able to launch Uxn programs using the GNOME launcher and tools like rofi. Since they all live in my user directory and only use relative paths, I can easily keep them in sync across my various devices using chezmoi.