Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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) -> Keyboard -> Shortcuts 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.

share|improve this answer
    
It worked wonderfully. Better this way, as I can't work around it, I'll just learn to use regular Delete. Many thanks, jnv! –  mdrg May 13 '12 at 0:32
    
Now I understand what you meant by 'within any application'. The alert sometimes pop up on text editors while shift-selecting text and deleting it in rapid succession. A small quirk, but this is not a real shortcut on any application so far, so no big deal. –  mdrg May 17 '12 at 19:48
    
I clicked on + and created custom shortcut, but I am not able to assigh Shift+Delete to it. BTW, I am using 12.04. –  Praveen Sripati Jun 8 '12 at 6:33
    
@PraveenSripati Once the shortcut is created, double click Disabled in the right column, it will change to New shortcut…, then press Shift+Del. If you can't assign this one particular shortcut, it's possible the shortcut is already handled by Compiz. Or maybe it's not assignable in Precise; I am still on Oneiric so I can't test this. –  jnv Jun 10 '12 at 0:29
1  
Thanks a lot for this tip, jnv. From now on, I won't accidentally delete my files for good anymore. :) –  brunces Jun 29 '13 at 0:25

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.