strcmp.org

nautilus trash patch

Page license: Creative Commons
Page updated:
Code updated:

Description

By default GNOME's filemanager Nautilus doesn't ask the user before a file is moved to trash, this can be dangerous if the trash will be emptied before you notice a file was accidently moved to trash. It also does not give you any method to set a maximum trash size. Both features are provided by the nautilus trash patch. It is published in the Public Domain.

Download

Alternatively the files are also available via FTP.

Installation

Note: On Debian based systems you may use the debian.sh to install the patch (do not run it with root rights, it'll manage that itself).
  1. Get the Nautilus source code.
  2. Patch the nautilus-file-operations.c in libnautilus-private:
    patch nautilus-file-operations.c nautilus-file-operations.c.patch
  3. Compile and install Nautilus:
    ./configure --prefix=/usr && make && make install
  4. Copy the file trash_script to ~/.trash_script and make it executable:
    cp trash_script ~/.trash_script && chmod +x ~/.trash_script

Uninstallation

Just reinstall Nautilus from the repository.
On Debian based systems: apt-get -y --reinstall install nautilus