8

I found myself always holding Shift when I delete a file with Thunar (the XFCE file manager).

When I was using Windows I was always disabling "recycle bin" immediately after installation. I've looked for similar option in Thunar settings but had no luck finding it.

Do you happen to know a way?

  • 2
    Since I assume that XFCE conforms to the FreeDesktop.org Trash Specification, a workaround would be to run a cron job every minute calling trash-empty (from the package trash-cli). – Marco Oct 14 '12 at 18:23
  • Looks like an ugly "crutch" of a kind for me on first sight but may be a nice compromise at the same time: at least I will be able to restore a file during some time after deletion if I realize I've done it by a mistake (happened to me about 5 times during 20 years - had to use special undeletion utilities to restore). – Ivan Oct 14 '12 at 18:27
  • 1
    It definitely is! If you want finer control of what is deleted and when, I would suggest having a look at the package autotrash. Calling it from a user crontab I would consider a clean solution. It however does not answer your question, that's why I leave it as a comment. – Marco Oct 14 '12 at 18:34
4

According to the Xfce FAQ, you cannot disable the Trash.

They provide three suggestions, two of which which are also mentioned in the comments above:

  1. Use Shift + del to bypass the trash bin and immediately delete something for real.

  2. use cron to clean the trash every now and then.

  3. or create custom action for permanent delete(like in gnome) with action: rm %f then in context menu you'll have button “permanent delete”

Personally, I use the a cron job that runs every 24 hours that calls trash-empty. You can simply call the command by itself, or give an option(in days) to remove files that have been in the trash longer than that specified number of days.

|improve this answer|||||
3

I found this thread while looking for the solution of the same problem as OP. Later I found there is a simpler workaround. Pressing DEL will behave as real delete when you disable gvfs-trash command, e.g. by creating no-op command somewhere on PATH:

sudo ln -s /usr/bin/true /usr/local/bin/gvfs-trash

Then you can also hide the trashcan from desktop and from left pane in Thunar using GUI configuration and everything will look like it never existed.

|improve this answer|||||
2

If you haven't used the concept of "Trash" since Windows 3.1, like me, you could use:

chmod 0 /home/username/.local/share/Trash/files

While this throws an error when you just use DEL, at least that error reminds you to press Shift+DEL.

|improve this answer|||||
1

I don't like using a wastebasket, and I don't understand why they usually aren't optional with Linux DE's/file managers.

Anyway whatever, here's a stupid but functional workaround with whatever DE. You'll need inotifywait, which is in the inotify-tools package on Arch and Debian:

#/bin/bash

# Once at the start for good measure
rm -rf .local/share/Trash/files/*

while [ true ]
do
    inotifywait ~/.local/share/Trash/files

    # Don't get stuck in a CPU-melting loop if something goes wrong
    if [ $? -ne 0 ]
    then
        exit $?
    fi

    # Good riddance
    rm -rf .local/share/Trash/files/*
done

Save this as a script somewhere, make it executable (chmod +x script.sh) and have it run on startup (Settings > Session and Startup > Application Autostart in XFCE). All it does is wait until anything happens inside your trash directory, then nukes everything in there. So it will still say 'send to trash' in context menus and so on, but anything that goes in there will suffer a mysterious disappearance.

|improve this answer|||||
  • Ha, I just accidentally deleted everything in my home directory including all the hidden files not 10 minutes after posting this and running the script. Karma is brutal. Sorry wastebasket. I trashed you, so you trashed my files. – bewilderex63 Nov 4 '18 at 23:47

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.