5

What elements should I define in a Desktop Entry file of Directory type for xfce? Although it can be created using thunar file manager by right clicking on the folder, so what I want to know is that if its possible to create one manually.

I wish XFCE was well documented as other DEs

5 Answers 5

2

This is what I found. This will look and behave in nautilus/nemo like a normal folder instead of a symlink. Being a link it can have any name or image while being de facto a GUI folder. It can also link to a distant folder. And contrary to some solutions here, it will not open a new window if opened from nemo.

For /mnt/HDD/Videos/:

[Desktop Entry]
Name=Videos
Icon=folder-video.png
Type=Link
URL=file:///mnt/HDD/Videos/

For sftp://192.168.1.7/mnt/HDD/Videos/:

[Desktop Entry]
Name=Videos
Icon=folder-video.png
Type=Link
URL=sftp://192.168.1.7/mnt/HDD/Videos/
3
  • 1
    Should be URL=file:///mnt/HDD/Videos/, not URL=/mnt/HDD/Videos/ Jul 14, 2020 at 0:22
  • I was able to do the same thing by right clicking on xfce4 desktop, and create a URL link with file:///mnt/HDD/Videos
    – Yvon
    Dec 7, 2021 at 0:54
  • This is not directory type. It says Type=Link. Directory type is described here
    – jaam
    Mar 26, 2022 at 20:39
1

You will find detailed information on desktop entry files here.

I'm unable to find XFCE's desktop entry specifications, but in Gnome desktop entry specifications, the desktop entry for a directory must be ending with .directory, and not .desktop.

1
  • 2
    Actually that link is the origin of my question. I tried setting type to Directory but xfce perceives it as an invalid .desktop file and it does not recognize .directory. Sep 27, 2012 at 12:32
1

Create a symlink, for example:

ln -s /home/pi/resources /home/pi/Desktop/Course\ Resources

The first part is the folder you want to link and the second part is the link on the desktop.

2
  • And what does the third argument (Resources) mean?
    – mook765
    Sep 19, 2018 at 19:14
  • 1
    @mook765 That's part of the second argument; it's just a folder name with a space in it, but bash needs paths with spaces to be escaped with a backslash. Jul 14, 2020 at 2:56
1

To create an entry in menu you can use the command,

exo-desktop-item-edit --create-new ~/.local/share/applications

for creating a directory shortcut, you can provide command as

thunar /path/to/dir/

thunar can be replaced with any other file manager commands like nautilus

In my case, I used this command to create a shortcut for an AppImage downloaded.

Reference: howto:customize-menu | Xfce Wiki

0

If I understand this correctly, Type=Directory does not create a launcher, but provides metadata for a menu.

Although I couldn't find any official documentation how to create a directory launcher, this worked for me:

[Desktop Entry]
Name=foobar
Exec=xdg-open /path/to/foobar
Icon=folder
Terminal=false
Type=Application

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .