patriciogonzalezvivo / glslViewer

Console-based GLSL Sandbox for 2D/3D shaders
BSD 3-Clause "New" or "Revised" License
4.57k stars 352 forks source link

Setting Icon= in desktop file not always working #344

Closed jnsh closed 12 months ago

jnsh commented 1 year ago

Working on Arch Linux PKGBUILD for glslViewer, I noticed that the icon was not added to the desktop entry for me.

The problem is that the build tries to echo the Icon=... line to a .desktop file in ${CMAKE_INSTALL_FULL_DATAROOTDIR}/applications/ while the desktop file was in fact installed in ${CMAKE_INSTALL_DATAROOTDIR}/applications/ on the line above.

The simple fix would be to fix the path for echo redirection target, however this whole process could probably be simplified:

When the icon is installed in /usr/share/icons, you don't need to define the full icon path in the .desktop file, but just the filename without extension (i.e. Icon=glslViewer) is enough (as per icon theme specification).

Therefore you should be able to just hardcode the icon in the desktop file, and avoid writing it during build altogether.

patriciogonzalezvivo commented 1 year ago

Thank you @jnsh! do you mind making a PR for this?