m1gin 62

I am currently using XUbuntu 12.04 (Precise). It contains Thunar 1.2.3 as file manager.

I tried several file managers and started to use Thunar, here is a few reason

  • I can browse parent directories by clicking to buttons/labels
  • Thunar is lighter comparing to Nautilus
  • Has a good design

But I don't like the behaviour sending files/folders to the trash (rubbish bin) without asking. Sometimes delete key on keyboard accidently pressed.
So every time you should examine the trash box to check if are there any files deleted accidently without your will.

I searched more and more to fix this bad situation. But I found no way.

Today, I tought to develop simple background program to catch delete key and warn me if the active window is thunar.
I spent hours to do this due I have no experience on Linux programming.

I found some commands to use in bash script. But I was very tired. I have to sleep. :)


I woke up with a new idea. Why I don't try to edit the source code of Thunar and then compile it?

So I started to search how can I achive this.

I noticed the latest version of Thunar is 1.6.
I wonder if the delete confirmation option is integrated in this version. I installed it by following commands.

sudo add-apt-repository ppa:xubuntu-dev/xfce-4.12
sudo apt-get update
sudo apt-get install thunar
sudo add-apt-repository -r ppa:xubuntu-dev/xfce-4.12

Then Thunar version became 1.6.2.
But unfortunately, there is no asking for moving files to the trash when Delete key pressed. Bad news! :(
I don't understand the reason, why the developers of Thunar don't giving us an option for this.


So, I focused to edit the source code to ask me when sending files to the trash.
I downloaded the source code of Tuhar and while after examining the code, I found the related lines and edited them. (The lines numbers around 1800 in thunar/thunar-application.c file.)

After editing source code now I can compile it. Here is the steps for compilation.

./configure
make
sudo make install

If you want to create a package for installation later:

sudo checkinstall

And its time for testing... I select a file and pressed Delete key on keyboard.
And I get a prompt window asking me I am sure to move the file to trash! Hurray! :)

References / Thanks:


#from blog.mbirgin.com, archive, ubuntu, ubuntu tips, linux tips, file manager, thunar, linux, confirm before trash, ask before move trash, install thunar, how to add ppa, thunar with tabs, compilation, compile thunar, thunar asks when delete key pressed, thunar prompt to delete

Add to: