I have read this link, but there it's talking about nautilus, i am using a different file manager (PCManFm), but i want to add an item to all the right-click menus of the directory.
I have done the following:
added a file ~/.local/share/file-manager/actions/mkthumb.desktop
with the following context:
[Desktop Entry]
Type=Action
Tooltip=Generate all the thumbs on the folder
Name=Generate all the thumbs
MimeTypes=inode/directory
Exec=mkthumb.sh -s %u
this doesn't work (i don't even get the menu).
What am i doing wrong, how do i accomplish this? In the event if it's impossible to do this for both Nautilus and PCManFm, i will ask how to do that for the latter.
Though this source confirms that PCManFM version 1.2.0 shipped with 14.04 LTS supports Actions feature, it seems that it doesn't work properly.
I found another source which confirms that. It's mentioned there that version 1.2.2 works properly, so you can try that version, or upgrade your distro to the next LTS, which is 16.04.
Some examples of custom actions can be found here.
As regards Nautilus, it's easy to add custom actions even without additional packages which simplify that process. Just put your scripts into
~/.gnome2/nautilus-scripts/
folder, make them executable, and new submenu 'Scripts' will appear in the context menu. Adding subfolders is possible and this will help to make categories within 'Scripts' submenu.Add
Profiles=profile-zero;
to the[Desktop Entry]
section, and append the following to the bottom of the file:Replace
/path/to
with the path of the script, and remove theMimeTypes
andExec
lines from the[Desktop Entry]
section(credit to @whtyger for posting a link that led to instructions, I'm making it into a full answer so it's clearer)