How to add the shred utility to the context menu in Dolphin (Linux Mint 18 KDE) for removing files and folders?
How to add shred to KDE context menu for safe deletion of file/folder?
1.5k Views Asked by mixalbl4 At
2
There are 2 best solutions below
0

This is a slightly changed version that implements a confirmation dialog and a more appropriate icon (imho)
- Files
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/allfiles;
Actions=Shred
#X-KDE-Submenu=Shred
[Desktop Action Shred]
Name=Safe Remove
Icon=edit-delete-shred
Exec=/bin/bash -c 'kdialog --title "Safe Delete" --warningcontinuecancel "Safe Delete: Are you sure?" && shred -u -f -z -n3 %u'
- Directories
[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=inode/directory;
Actions=Shred
#X-KDE-Submenu=Shred
[Desktop Action Shred]
Name=Safe Folder Remove
Icon=edit-delete-shred
Exec=/bin/bash -c 'kdialog --title "Safe Delete" --warningcontinuecancel "Safe Delete: Are you sure?" && find %u -type f -exec shred -u -f -z -n3 {} \; && rmdir %u'
shred.desktop
with this content:shred_folder.desktop
with this content:/usr/share/kservices5/ServiceMenus/
(how to find this path?)Result:
Additional info:
MimeType
for files isall/allfiles
, for folders it'sinode/directory