Can Nautilus display a .desktop file by its real name?

With newer versions of Nautilus (2.31.5 and later) renaming .desktop files actually changes the filename, not the Name field of the file itself.

Nautilus will show the full filename (with the .desktop extension), if the .desktop file is not executable.

For example, if Firefox.desktop is executable:

alt text

Now to see the actual filename, make Firefox.desktop un-executable. Right click -> Properties -> Permissions -> Uncheck Allow executing file as a program.

alt text
Now Nautilus will show the full file name:

alt text

alt text There seems to be a bug with renaming un-executable .desktop files in Nautilus.
If you don't erase the .desktop extension, the file will
have a double-extension (i.e Firefox.desktop.desktop).


Apart from nautilus' strangeness, here's a nautilus script.

You can select multiple files, click ok and gedit will show them (requires zenity).

#!/bin/sh

FILE=$(ls -1 | zenity --list --hide-header --multiple --separator "\n" --title "List directory contents" --width 400 --height 300 --column "ls")
IFS="
"
test -z "$FILE" || gedit $FILE

Put it in ~/.gnome2/nautilus-scripts and make it executable.

Tags:

Nautilus

Files