For one of my Linux applications, I have the application binary, a launcher.sh script (for the LD_LIBRARY_PATH) and a .desktop file, all in the same folder.
I\'d like to
After doing some more research it doesn't look like it's possible to specify relative paths for an icon in a desktop entry file as far as I can see.
The workaround I used was to add the following code to the end of my launcher.sh script:
mv myapp.desktop myapp.desktop-bak
sed -e "s,Icon=.*,Icon=$PWD/app.svg,g" myapp.desktop-bak > myapp.desktop
rm myapp.desktop-bak
This will update the path of the icon each time the launcher script is run, and since the .desktop file points to the launcher script, clicking the .desktop file effectively updates its icon.
I know you could use cat
or the -i option to shorten the above code but I've read that the solution I used is more reliable. If anyone has further information on that please do post a comment.