PDA

View Full Version : Nautilus script request



erroneus
10th May 2006, 07:46 PM
This should probably be rather simple for those more experienced, but I'm failing pretty badly though I have made some headway into it.

I would like to be able to right-click on a file or folder and from the context menu, run a script. The script should call up gnome-terminal with the current working directory set to that folder's location or the folder the selected file is within. I haven't figured out how to do it yet, but I'd also like to have the LANG variable changed to "en_US.UTF-8" within the gnome-terminal session.

So far, I have been able to identify the file/folder being referenced through $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS but even it seems to have a problem in that the variable has an extra line feed in it causing the result to go to more than one line. (clearly a Nautilus bug... I am running 2.14.1 under FC5) So the script needs to be able to determine if the file pointed to is a directory or a file and if a file, the filename needs to be removed. Then a "cd" to that folder would be successful.

Anyway... I can't get it to happen with my feable skills... would anyone else find this to be trivial?