I want to assign Delete key to my script. It works when I add to scripts-accels:

<Primary>Delete myScript.sh


Delete myScript.sh

keeps default behavior (move to trash) and ignores my script. Any ideas? (btw. It was possible in older distros - shortcut in accels file worked, but accels file is not used anymore)


scripts-accels does still work (fortunately), as you noted yourself. However, it will not allow you to override shortcuts that are already defined in the application (as you also noted). You will need to work around by using a different keyboard combinations not already used by nautilus.

This answer will be disappointing, and I would be very happy to see an answer appear that indicates how to do it. However, to my knowledge, it is not possible without editing source code.

| improve this answer | |

Go to System settings > Keyboard shortcuts > Add your own shortcut

Name it whatever you want, and in the command, use use /full/path/to/script.sh. Set the shortcut key to the delete key.

| improve this answer | |
  • I want to run script before moving file to trash. Your solution would lock Delete key globally. Is it possible in bash script to pass delete key forward unless active window is nautilus? – ingwarus Jun 24 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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