Page 1 of 1

Nemo Custom actions help

Posted: Thu Dec 19, 2013 7:42 pm
by mintman112
Hi everyone i am really struggleing with how to add custom actions to nemo can someone please help?

I would like to add this action to right click in nemo so i can secure delete files with ease

shred -u -z -n 10

Re: Nemo Custom actions help

Posted: Fri Dec 20, 2013 7:18 am
by mintman112
Anybody?

Re: Nemo Custom actions help

Posted: Fri Dec 20, 2013 9:58 am
by grizzler
This works for me (using nemo 1.8.4): create a file called shred.nemo_action or something like that, making sure the extension is nemo_action, in /usr/share/nemo/actions, containing

Code: Select all

[Nemo Action]
Name=Shred file
Comment=securely delete a file
Exec=/usr/bin/shred -uzn 10 %F
Icon-Name=gtk-execute
Selection=S
Extensions=any;
You can choose another icon if gtk-execute doesn't suit you.

Make sure you read the disclaimer in the man page so you understand why shred may not be effective on ext3 (and ext4) file systems.

Re: Nemo Custom actions help

Posted: Fri Dec 20, 2013 5:05 pm
by mintman112
Many thanks for the help grizzler this worked fine with some files and then others it just wouldent delete i dont know whats wrong? im useing Mint 16 petra.

Re: Nemo Custom actions help

Posted: Mon Jan 27, 2014 6:06 am
by FM33
Hello,

Is there a documentation for nemo actions ?

Re: Nemo Custom actions help

Posted: Sat Feb 08, 2014 4:19 am
by nathant
mintman112 wrote:Many thanks for the help grizzler this worked fine with some files and then others it just wouldent delete i dont know whats wrong? im useing Mint 16 petra.
I think you need to add the option -f to force shred to change permissions to allow overwriting

Nathan

Re: Nemo Custom actions help

Posted: Sat Jul 26, 2014 9:54 am
by hatteras

Re: Nemo Custom actions help

Posted: Sat Jul 26, 2014 11:33 am
by FM33
Not really reading spanish, but it helped me a lot anyway (intuition + dictionary), thanks :D

Re: Nemo Custom actions help

Posted: Mon Sep 19, 2016 8:04 am
by sadhu
grizzler wrote:

Code: Select all

Exec=/usr/bin/shred -uzn 10 %F
Selection=S
I would change a some parameters in the nemo_action file:
  • Exec=/usr/bin/shred -uzn 2 %F; two overwrites, plus a final 'zero' overwrite is probably overkill on modern high-density drives.
  • Selection=any so that more than one file can be selected for shredding.
  • EscapeSpaces=true I added this because I was getting errors on files with spaces in the filename.
For SSDs or thumb drives, or HDDs with filesystem ext3/4 with journaling enabled, then shred is worthless. The only way to securely erase these devices is by using dd on the entire drive. And that may not even be enough. Smashing the device with a sledge hammer will also make the data unavailable, thus effectively erasing the medium.

See also viewtopic.php?f=42&t=230092

Sadhu

Re: Nemo Custom actions help

Posted: Sun Mar 04, 2018 2:50 am
by zpangwin
In case this helps anyone else stumbling in from google...

If you also want a custom icon to go along with your custom action, then the nemo source code appears to just be passing the icon name to a GTK api function and letting it do the work of resolving the name to a file (apologies in advance if I am incorrect on this.. I only skimmed the code, it's been years since I played around in C/C++, and I am unfamiliar with using the GTK framework).

I tested this by searching for a few installed installed icons:

Code: Select all

SEARCH_FOR="antimicro"
find ~/.local/share/.icons -iname "*${SEARCH_FOR}*" 2>/dev/null;
find /usr/share -iname "*${SEARCH_FOR}*" 2>/dev/null;
For the above, the most likely png was '/usr/share/pixmaps/antimicro.png'. I saw some of the other icons in other formats (xpm, svg). Not sure about jpg/gif/ico/etc (i had image magick installed so just did 'convert file.ico file.png'). I assume square icon sizes are required. Anyway, this had worked for me:

Code: Select all

sudo cp git-ext-clone.png /usr/share/pixmaps/git-ext-clone.png
sudo chown root:root /usr/share/pixmaps/git-ext-clone.png
sudo chmod ugo+r /usr/share/pixmaps/git-ext-clone.png
~/.local/share/nemo/actions/gitext-clone.nemo_action

Code: Select all

[Nemo Action]
Name=GitExt Clone
Comment=GitExt Clone
Exec=/opt/GitExtensions/nemo-scripts/launch-gitext-clone.sh %F
Icon-Name=git-ext-clone
Selection=Any
Extensions=any;
Quote=double
/opt/GitExtensions/nemo-scripts/launch-gitext-clone.sh

Code: Select all

#!/bin/bash
/usr/bin/mono "/opt/GitExtensions/GitExtensions.exe" clone "$@" &