Trash icone not changing when empriying the trashcan

When I empty the trashcan the icon does not change.

When I go to the trashcan with dolphin, there are no files.

After a reboot the icon is changed.

This issue started, after I accidentally deleted the trashcan, and then put a new trashcan widget on the desktop.

Is this maybe KDE?

Please always start with telling what you use!!!

Operating System: openSUSE Tumbleweed 20230708
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10
Kernel Version: 6.3.9-1-default (64-bit)
Graphics Platform: X11
Processors: 12 Ă— AMD Ryzen 5 2600 Six-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 570 Series

This issue can be solved by using the “right” Trash directory…do not use the “widget”.

Open Dolphin → on left side (under places) click on Trash → hold and drag it to desktop.
Screenshot_20230716_180918
If you dont have the left sidepanel, go to view->sidepanel->places
(the translation may vary…)

Thank you, but this did not change anything.

Here it worked as intended. If you use a self created shortcut, the icon won’t change properly. But if you drag the Trash icon/place from dolphin to the desktop it creates a proper desktop entry with changing icon…

How did you create this “new trashcan widget” exactly?

I have this issue for along time, I can’t recall what I did the first time.

The weird part though, when I reboot my pc the icon does get updated.

It just does not update in real time.

Does the icon update as you expect, if you create a new user, and try it there?

If the suggestions from above do not work, did you already try deleting the contents of your /home/$USER/.cache directory?

Quit all programs and in the Konsole terminal emulator enter cd && sudo rm -r .cache/* and log out and in again or reboot.
This is best done before logging in at all from a tty, though.

PS: Another solution could be to temporarily disable “save user session” in System Settings.

I am not sure that something within the user’s reponsability should be attacked using root.

An error is easy to make.

2 Likes

I have to agree with Henk. Using sudo to delete user owned files is absolute nonsense and dangerous as you can easily delete more files than you really want (when you chose wrong directories)…
Don’t advertise such bad habits…

Better do:

rm -r /home/$USER/.cache/* 
2 Likes

I agree. I would even go one step further and I prefer

cd /home/$USER/.cache
rm -r *

because working the working directory does not get his name for nothing. Better “go there” and then do your thing.

I have seen that a small typing error in a long path created havoc.
Well, that was done by root, but a normal user can also benefit from a good habit. Oh, and another one is to use the path completion function to avoid typing errors (and increase tyoing speed).

1 Like

The background why I usually use sudo here is that in the past both in *Ubuntu and Debian there have been corrupt user cache files in several installations that were owned by root only and nobody else.
So calling this “nonsense” depends on the perspective and use case.

If rm -r /home/$USER/.cache/* does remove everything, all is fine - if it doesn’t use sudo or log in as root.

It is dangerous, specially as an example to others. Better post that in the proper place, the forums of Ubuntu and Debian.

1 Like

*buntu is not openSUSE or any other rpm based distribution.
And using sudo to delete files in user directories is still nonsense. IF you find that there are files in your user directory which are owned by other users/root you can still switch to use sudo/su - AFTER you have properly investigated why they are owned by them. And then delete ONLY this files with sudo and not by default all files…

1 Like

I cleared the cache as a normal user. It did however not delete all files in .cache, because after ls some files still showed. I then rebooted.

If I then, drag from within dolphin, the trash to the desktop, it shows full right away although the folder looks empty.

I then added the trashcan widget, and it does show a closed lit , so trash is empty.

Then made a text document and moved it to the trash can.
Emptied the trash can and icon does not change to the empty symbol.

When I then restart my computer, the trash does show as empty.

So it does not seem to update the icon in real time.

Check if you have any “invalid” files lingering in:

.local/share/Trash

… if yes, then delete them … there should only be files and info directories.

Just to be clear, your .local/share/Trash should look like this:

[sfalken@T420 ~]$ ls -l .local/share/Trash/
total 0
drwxr-xr-x. 1 sfalken sfalken 0 May 27 21:19 files
drwxr-xr-x. 1 sfalken sfalken 0 May 27 21:19 info

Restarting is a bit drastic. What happens when you logout and login?