Possible Duplicate:
How to customize the context menu in Nautilus?
I'm trying to make a Mark as executable
command for the right click in nautilus for a faster work flow. I came up with this script:
#! /bin/bash
for file in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
gksudo "chmod +x $file" &
done
How do I get this to work though. I currently have a .sh
file and have no idea where to put it.
Just save this file as 'Mark as executable', make itself executable and drop it to
~/.gnome2/nautilus-scripts
It will be shown at your right-click menu, under the submenuScripts
You may want to remove the
gksudo
from there if you are planning to mark as executable only files that you own (under your home directory), otherwise, every time that you run the script through the right click menu, it will ask you for password...BUT the script you have up there is not going to work for files which contain spaces to their filename. In order to make it work for them, you have to alter the script to the following:
ALSO, you can have your very own entry for your "Mark as executable" thingy. But, in order to enable this you will need to install the python-nautilus package:
Then save this file as
mark_as_executable.py
under~/.local/share/nautilus-python/extensions/
:The above will only work for single files as well, if you want to add support for multiple files, you have to paste this inside the python script, though:
In order to be able to use the functionality, you will need to restart nautilus too:
and then open a nautilus window.