How to add the shred utility to the context menu in Dolphin (Linux Mint 18 KDE) for removing files and folders?
shred.desktop
with this content:[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/allfiles;
Actions=Shred
#X-KDE-Submenu=Shred
[Desktop Action Shred]
Name=Safe Remove
Name[ru]=Удалить навсегда
Icon=trash-empty
Exec=shred -u -f -z -n3 %u
shred_folder.desktop
with this content:[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;
Actions=Shred
#X-KDE-Submenu=Shred
[Desktop Action Shred]
Name=Safe Folder Remove
Name[ru]=Удалить папку навсегда
Icon=trash-empty
Exec=find %u -type f -exec shred -u -f -z -n3 {} \;
#Exec=find %u -type f -exec notify-send {} '' \;
/usr/share/kservices5/ServiceMenus/
(how to find this path?)Result:
Additional info:
MimeType
for files is all/allfiles
, for folders it's inode/directory
-u - After shredding a file, deallocate it (if possible) and then remove it.
-f - Change permissions to allow writing if necessary.
-z - Add a final overwrite with zeros to hide shredding.
-n3 - Use 3 passes of overwriting.
%u - The file path for removing.