Disable shift-delete for file deletion

As an re-education procedure in order to reduce (likely) future data loss, I wish to disable the Shift+Del functionality to delete files in Ubuntu (11.10 and 12.04). Also, if I could replace it with a "Stop that!" popup alert, even better.

I know there are data recovery tools for such cases, but better never put my important data at risk due to such mistakes. And I found nothing similar around, so I hope someone here can show me how, if possible.


Solution 1:

If you define a shortcut on window manager's level, it won't go to Nautilus. Combined with Zenity, you can even show yourself an alert.

First make sure Zenity is installed

sudo apt-get install zenity

Now go to System Settings (or run gnome-control-center) → KeyboardShortcuts tab, select Custom shortcuts (last item in the left menu), click + to create new shortcut. Call it however you want, and set this command:

zenity --error --text='Stop doing that!'

Once you add the shortcut, assign Shift+Delete to it. Now every time you press Shift+Delete, you get a warning box. Unfortunately this means you can't use this shortcut within any application, but it's rather quick workaround to get rid of a habit.

Solution 2:

You can generally prevent the files from being deleted either by Shift + Del or the normal deletion by adjusting the permission of the directories to read-only for users. Set it in a way that administrators can only modify any content.