Ubuntu – How to use xdg-desktop-icon

desktop-iconsxdg

I am on Ubuntu 12.04 with KDE. I'd like to use the xdg-desktop-icon tool because it can be scripted and works cross desktop.

Made a minimal file: test.desktop

[Desktop Entry]

Encoding=UTF-8
Type=Application

Exec=test
Icon=test

Name=test

Used xdg-desktop-icon…

xdg-desktop-icon install --novendor test.desktop

Exit code is 0. (Success.) But… I do not see any new icons on my desktop. Also not after reboot. How to use the xdg-desktop-icon tool correctly?

Best Answer

This is perhaps on what is expected as a desktop icon. The answer for me was to install the menu:

$ xdg-desktop-menu install --novendor test.desktop

Only after that xdg-desktop-menu command (and not the -icon command) the .desktop program appeared when searching it in the dash (a.k.a. the menu).

A reboot was not necessary.

Tested on Ubuntu 18.04.1 LTS.

Related Question