Nemo Custom actions help
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Nemo Custom actions help
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
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
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
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.
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;
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
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
I think you need to add the option -f to force shred to change permissions to allow overwritingmintman112 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.
Nathan
- hatteras
- Level 11
- Posts: 3886
- Joined: Fri Sep 24, 2010 6:43 pm
- Location: En el paraiso en la tierra
- Contact:
Re: Nemo Custom actions help
If you can read spanish , this
http://hatteras-blog.blogspot.com.es/20 ... al-de.html
http://hatteras-blog.blogspot.com.es/20 ... -menu.html
could help you
http://hatteras-blog.blogspot.com.es/20 ... al-de.html
http://hatteras-blog.blogspot.com.es/20 ... -menu.html
could help you
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.
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.
Re: Nemo Custom actions help
Not really reading spanish, but it helped me a lot anyway (intuition + dictionary), thankshatteras wrote:If you can read spanish , this
http://hatteras-blog.blogspot.com.es/20 ... al-de.html
http://hatteras-blog.blogspot.com.es/20 ... -menu.html
could help you
Re: Nemo Custom actions help
I would change a some parameters in the nemo_action file:grizzler wrote:Code: Select all
Exec=/usr/bin/shred -uzn 10 %F Selection=S
- 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.
See also viewtopic.php?f=42&t=230092
Sadhu
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
Re: Nemo Custom actions help
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:
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:
~/.local/share/nemo/actions/gitext-clone.nemo_action
/opt/GitExtensions/nemo-scripts/launch-gitext-clone.sh
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;
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
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
Code: Select all
#!/bin/bash
/usr/bin/mono "/opt/GitExtensions/GitExtensions.exe" clone "$@" &