How to Disable “Undo” Popup When Deleting Files in Ubuntu 20.04, 20.10

When deleting files using “Move to Trash” option or delete keyboard key in Ubuntu, a ‘xxx’ deleted dialog will pop up with Undo button.

It is quite annoying as the notification bubble locates in the top center of file browser. It makes some files un-clickable before you closing the popup.

Unfortunately, there’s no option to turn it off so far. And here’s a workaround to fix the problem.

1. Check what’s the current GTK theme in use:

Firstly open Gnome Tweaks, install it from Ubuntu Software if you don’t have it, and go to Appearance tab.

There find out the GTK theme in use for your applications (Yaru-light in the case):

2. Hack the CSS code for the Theme:

While the system wide GTK theme is usually located in /usr/share/themes, single user use themes may be installed in .themes folder.

Depends on your theme, path to the CSS file may different. For Yaru-light in the case, you can edit the file via command:

sudo gedit /usr/share/themes/Yaru-light/gtk-3.20/gtk.css
For other themes, e.g., Yaru, Yaru-dark, Numix, Ambiance themes, just replace Yaru-light in the command. So the command could be (Numix for instance): 

sudo gedit /usr/share/themes/Numix/gtk-3.20/gtk.css

When the file opens, add the new line in the end and save it.

.app-notification { padding: 0; margin: -80px 0 0 0; opacity: 0;}

3. Re-select the theme to apply change:

To apply the change, go to Gnome Tweaks > Appearance, select another theme and go back to the previous.

That’s it. Enjoy!

Merilyn Ne
Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.