GNOME Bugzilla – Bug 341657
Scripts don't work on the desktop
Last modified: 2008-08-30 10:11:31 UTC
Please describe the problem: When a script is executed with a file on the desktop as argument, it is invoked from $HOME instead of $HOME/Desktop and so the script cannot find the file. Steps to reproduce: Create a file on the desktop. Create a script whose contents are 'rm "$1"' (without the single quotes) Execute said script on said file. Actual results: Nothing. Fails silently. Expected results: The file should be deleted. Does this happen every time? Yes. Other information: It would be nice if nautilus were to report the exit status of a script.
I confirm this. The "Open Terminal" script leads you to your Home Folder, and the AudioConvert script fails as well (silently). This happens when trying to run scripts on the Desktop, but NOT when opening ~/Desktop as a folder. Version is Nautilus 2.16.1 (Ubuntu Edgy)
Same bug still exists in 2.18.
It also doesn't work in the .Trash folder.
I can confirm this in 2.22.0. Create a script like this: --------------------- #!/bin/bash zenity --info --text=$* --------------------- If you run it on any normal file, it gives the name of the file. If you run it from the desktop, it gives nothing.
This bug shouldn't be "UNCONFIRMED" any more, and (presumably) should be labelled as applying to Gnome 2.22.0.
And this bug should actually be marked as a duplicate of #429447. Sorry to flood the place with comments.
*** Bug 429447 has been marked as a duplicate of this bug. ***
Thanks Tom, confirming with 2.22.0.
Created attachment 108335 [details] [review] patch As suggested by Alex on IRC, this seems to be a better way to check for local/not local files, and it fixes this bug.
Created attachment 108336 [details] [review] patch Wrong patch attached, sorry for the spam.
I think that looks ok. However, I'm not sure why we just pass basename into the script instead of absolute paths. It will break if you're e.g. in a list view with a file in an expanded subdirectory selected.
Can we get the patch into trunk now please? Else it won't make the target I fear...
Thanks, I committed a patch to trunk in the spirit of Cosimo's work: http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14502 However, I changed the actual command launch helper to accept an array of parameters, and quote each parameter separately. I also added a TODO comment for the issue mentioned by Alex in comment 11. Closing as fixed.
*** Bug 549910 has been marked as a duplicate of this bug. ***