share
Unix & LinuxHow to disable trash?
[+3] [3] Danny Beckett
[2013-04-07 04:14:23]
[ centos rhel gnome ]
[ https://unix.stackexchange.com/questions/71547/how-to-disable-trash ]

This is a nice and straightforward question: how can I disable the Trash Can in Gnome running on CentOS/RHEL 6.4?

I know I can use Shift + Del, instead of Del to bypass the Trash; but how can I completely disable it?

Or otherwise, how can I remap Del to Shift + Del?

You probably don't want to remap the del key. - user13742
@don_crissti What command can I run to get that? It's up to date with yum anyway. - Danny Beckett
@don_crissti -bash: gnome-shell: command not found - Danny Beckett
[+1] [2013-04-07 05:03:18] slm

Run dconf-editor, and open:

org -> gnome -> desktop -> interface

Enable "can-change-accels".

Open nautilus, select any file/directory, then click "Edit" from menubar, and hover on "Move to Trash" menuitem. While hovering, click on your delete key. The accel should change from "ctrl+del" to "del".

Make sure you have selected a file, else the "Move to Trash" menuitem will be greyed out.

NOTE: I suggest you disable "can-change-accels" afterwards, to prevent accidental accel changes.

If the above doesn't work take a look at this archlinux wiki article [1] on how to change your hotkeys in Gnome 3.x. This article has specific steps for a couple of versions of Nautilus.

[1] https://wiki.archlinux.org/index.php/GNOME#Changing_hotkeys

(1) What this does is changing the accel for <Actions>/DirViewActions/Trash to DEL. It does not bypass the Trash. - don_crissti
Did you try the other method mentioned in the archlinux wiki? - slm
I get -bash: dconf-editor: command not found when running dconf-editor and No package dconf-editor available with yum install dconf-editor. - Danny Beckett
Use gconf-editor if you do not have dconf-editor, yum install gconf-editor, if it doesn't show up. - slm
1
[+1] [2018-09-24 15:54:38] Michael Stumpfl

I've found that the real solution is to create a custom-compiled version of libgio (ยป GIO [1]) which is modified to call g_file_delete() every time an application calls g_file_trash().

A step-by-step guide on GitHub can be found here:

Globally disable GNOME's Trash in Debian-based distributions [2]

[1] http://en.wikipedia.org/wiki/GIO_(software)
[2] http://htmlpreview.github.io/?https://github.com/Cordic77/libgio-disable-trash/blob/master/Globally%20disable%20GNOME's%20Trash%20in%20Debian-based%20distributions.htm

2
[0] [2013-04-13 11:39:32] Petr R.

According to the archlinux wiki article [1] slm mentioned, in file ~/.config/nautilus/accels find the following line:

; (gtk_accel_path "<Actions>/DirViewActions/Delete" "<Shift>Delete")

and replace it with:

(gtk_accel_path "<Actions>/DirViewActions/Delete" "Delete")

Then kill nautilus to apply the changes:

killall nautilus

Please note you still can move the file to the trash using CTRL + delete.

Tested on Fedora 18 with GNOME Shell 3.6.3.1

[1] https://wiki.archlinux.org/index.php/GNOME#Changing_hotkeys

3