m1gin 599

#ubuntu #linux #filemanager #spacefm #movetotrash #customcommand #disablebuiltincommand

I'd like the files to be moved to trash when deleted. But SpaceFM, as I see, doesn't offer this option. So I have created a custom command in the right menu as follow.

  1. Right click for any files. Then right click on any item of the right menu.
  2. A new menu will appear. Click "New > Command"
  3. A new window will appear asking a name for new command. I entered "Move to Trash" and pressed OK
  4. A new window appeared asking for the custom command. I entered the following command:

    zenity --list --width=400 --height=150 --title='Confirmation' --text='Are you sure you want to move the following files to trash?' --column='Path' %F; (( $? == 0 )) && trash %F

That's it.

Tip: Hide Built-in Delete Menu Item

By the way I wanted to hide the built-in "Delete" option from the right context menu. I couldn't remove the built-in command. But in the properties of the menu item, I found "Context" tab which is offers rules when to appear and when disappear. I created a new rule something like "show" when "filename ends with .xyz". So the built-in "Delete" commands start to appear only on ".xyz" files. :)

Hope it helps.

Add to: