Thunar has an option when right-clicking the desktop to create desktop-files/launchers.
Is there a command behind this GUI that could be used in other contexts?
This is just creating a .desktop file in the
You can create these files manually with a text editor or using any other program that can write an INI style file.
A .desktop file can be also be installed with the
To find the process that has created a window under X.
xwininfoand click in the window you are interested in, note the "Window id"
xprop -id XXXX | grep PIDwhere
xwininfo, note the PID
ps aux | grep XXXXwhere
XXXXis the PID from
On Xfce, the program is:
exo-desktop-item-edit --display=:0.0 --create-new --type Application file:///home/$USER/Desktop
As a complement based on the first answer and its comments:
For a Thunar action in order to create a launcher in the current directory: open Thunar, select 'Edit - Configure custom actions', add the command:
sh -c 'exo-desktop-item-edit --create-new --type Application .'
The last dot (
.) specifies the current directory as location for the creation of the file. (Source link.)
Under "Appearance conditions" check 'Directories'.