Sponsored Link
Open terminal and run the following commands
First you need to create emptytrash file
gksudo gedit /usr/local/bin/emptytrash
Now you need to copy and paste the following lines
#!/bin/bash
zenity --question --text "Permanently remove all items from the trash?" && rm -rf ~/.Trash/*
Save and exit the file
Zenity is a tool that allows you to display Gtk+ dialog boxes from the command line and through shell scripts. It is similar to gdialog, but is intended to be saner. It comes from the same family as dialog, Xdialog, and cdialog, but it surpasses those projects by having a cooler name.
Now you need to give execute permissions for our script
sudo chmod +x /usr/local/bin/emptytrash
Now you need to open configuration editor using the following command from your terminal
gconf-editor &
Once you get the configuration editor window go to navigate to Apps > Metacity > global_keybindings > run_command_1. Right-click the value and select Edit Key and put in the keyboard shortcut you want
<Control><Shift>e
go to Apps > Metacity > keybinding_commands > command_1. Right-click the value and select Edit Key and put in the command
emptytrash
Now, the keyboard shortcut Control-Shift-E should bring up the empty trash dialogue.
Credit goes here
You need single quotation marks though in the script step.
Thanks for this, it worked great and opened up a whole world of possibilities.
I just ran this, it empties the trash and is much simpler.
[you@yourbox ~]$ rm -rf ~/.local/share/Trash/files/*
For some reason Gnome isn’t displaying an empty trash can, but the free space has just increased by more than 8 Gb. I’ve been through this previously and the can will empty on after a while, or after reloading X, I don’t recall. Fedora 10 mind you, but it would be the same thing in Ubuntu. Kurt
Thanks a lot for helping with this topic. 🙂