Nemo Custom actions help

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Locked
mintman112
Level 1
Level 1
Posts: 38
Joined: Mon Apr 23, 2012 6:30 am

Nemo Custom actions help

Post by mintman112 » Thu Dec 19, 2013 7:42 pm

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

mintman112
Level 1
Level 1
Posts: 38
Joined: Mon Apr 23, 2012 6:30 am

Re: Nemo Custom actions help

Post by mintman112 » Fri Dec 20, 2013 7:18 am

Anybody?

grizzler
Level 5
Level 5
Posts: 657
Joined: Wed Jun 15, 2011 5:19 pm
Location: The Hague, NL

Re: Nemo Custom actions help

Post by grizzler » Fri Dec 20, 2013 9:58 am

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.

mintman112
Level 1
Level 1
Posts: 38
Joined: Mon Apr 23, 2012 6:30 am

Re: Nemo Custom actions help

Post by mintman112 » Fri Dec 20, 2013 5:05 pm

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.

FM33
Level 1
Level 1
Posts: 17
Joined: Sat Feb 02, 2013 7:32 am

Re: Nemo Custom actions help

Post by FM33 » Mon Jan 27, 2014 6:06 am

Hello,

Is there a documentation for nemo actions ?

nathant
Level 1
Level 1
Posts: 13
Joined: Sun Sep 04, 2011 2:13 am

Re: Nemo Custom actions help

Post by nathant » Sat Feb 08, 2014 4:19 am

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

User avatar
hatteras
Level 9
Level 9
Posts: 2864
Joined: Fri Sep 24, 2010 6:43 pm
Location: En el paraiso en la tierra
Contact:

Re: Nemo Custom actions help

Post by hatteras » Sat Jul 26, 2014 9:54 am

Todos somos muy ignorantes. Pero no todos ignoramos las mismas cosas.
Es un placer ayudar, y ver que a alguien le es útil.
Es un placer pedir ayuda y ver que alguien te la da desinteresadamente.

Image

FM33
Level 1
Level 1
Posts: 17
Joined: Sat Feb 02, 2013 7:32 am

Re: Nemo Custom actions help

Post by FM33 » Sat Jul 26, 2014 11:33 am

Not really reading spanish, but it helped me a lot anyway (intuition + dictionary), thanks :D

sadhu
Level 5
Level 5
Posts: 507
Joined: Fri Nov 22, 2013 9:48 am
Contact:

Re: Nemo Custom actions help

Post by sadhu » Mon Sep 19, 2016 8:04 am

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
sabbe sattā bhavantu sukhitattā. LN 18.3-64 Cinn 3.4.6, Mobo: ASUSTeK STRIX B250G GAMING v, Dual core Pntm G4560, Intel Gfx. Laptop:Dell Inspiron 15-3000, Core i3, 4G RAM Intel Gfx

User avatar
zpangwin
Level 1
Level 1
Posts: 1
Joined: Sun Mar 04, 2018 2:21 am
Location: Southeast U.S.

Re: Nemo Custom actions help

Post by zpangwin » Sun Mar 04, 2018 2:50 am

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 "$@" &

Locked

Return to “Cinnamon”