You are not logged in.

#1 2015-02-20 11:45:51

ggg377
Member
Registered: 2015-02-20
Posts: 43

Thunar trash icon incorrectly showing as empty

Hey,

I'm suffering from a well-known, but not that well documented bug, where Thunar shows the trash bin as empty on boot even if there's trash. Closing the first thunar window and opening another one fixes this problem. From what I've found it has to do with Thunar starting before gvfs I'm very aware this topic is explicitly discussed in the wiki, but the offered solution is possibly the only one on the Arch wiki that I find to be unclear.

I'll address the proposed wiki solution first. This is where my newbieness also comes in. The wiki has this advice:

Trash/network icons disappear randomly

Make sure all Thunar instances start after gvfs. For thunar --daemon, you can create a wrapper that waits until GVFS is active:

Note: /usr/local/bin should come before /usr/bin in $PATH.

and this code:

#!/bin/bash
if [[ $1 == --daemon ]]; then
  until pgrep gvfs >/dev/null; do
    sleep 1
  done
  exec /usr/bin/Thunar "$@"
else
  exec /usr/bin/Thunar "$@"
fi

I understand what this does, but where exactly do I add this script? Do I add it as thunar.sh into /etc/profile.d to make it into an environment variable? Also my /usr/local/bin directory is empty and the Thunar executable resides in /usr/bin only if this helps.

Some things I unsuccessfully tried while struggling with this bug: 1) adding "exec dbus-launch openbox-session" to my .xinitrc (instead of just "exec openbox-session"), 2) tried getting rid of thunar-volman, 3) tried removing thunar --daemon from my Openbox autostart, 4) also tried adding a sleep 5s setting to it, 5) tried removing the Arch wiki automatic startx login script from .bash_profile. Additional information: I have had gvfs installed since I installed Thunar. I don't use a login manager.

Thanks for your help!

Last edited by ggg377 (2015-02-20 13:52:59)

Offline

#2 2015-02-20 12:25:29

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Thunar trash icon incorrectly showing as empty

I think I understand... The wiki provides a script (that you posted above). You can name it whatever you want (for example, "Thunar") and you can save it wherever you want (for example, "/usr/local/bin"). Wherever you save it, make sure that path is set before the real Thunar executable is located (for example, "PATH=/blarg:/usr/local/bin:/usr/bin:/blargitty/blarg"). That way, when you run "Thunar", it will actually run the script, wait for gvfs to start, then run the actual Thunar executable.

Does that make sense?

...I don't know if it will actually fix your issue though... tongue

Offline

#3 2015-02-20 13:12:37

ggg377
Member
Registered: 2015-02-20
Posts: 43

Re: Thunar trash icon incorrectly showing as empty

Thanks for your reply drcouzelis! I created a shell script file (no extension) named Thunar in /usr/local/bin, included the code bit in the file and rebooted with thunar --daemon in my autostart. Unfortunately, the problem persists. Honestly I don't even know if I should go with a hacky solution on this. Maybe it would be wiser to wait until developers fix this (even though this bug can be traced back to many years ago). Then again if the wiki has this as a solution, it has to originate from somewhere and have at least some type of meaning and purpose.

Last edited by ggg377 (2015-02-20 13:17:21)

Offline

#4 2015-02-20 13:34:23

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,413
Website

Re: Thunar trash icon incorrectly showing as empty

Thunar shows the trash bin as empty on boot even if there's trash

This is a different issue than described by the wiki - the script is for when there is no trash bin at all. The empty trash is another issue I've had - it may be related to .Trash folders on external drives. You could restart GVFS when the issue arises, and as it seems intermittent, put this script plus a sleep delay in your autostart file:

#!/usr/bin/env bash
pkill gvfs
pkill Thunar

fusermount -u $HOME/.gvfs
sleep 1; /usr/lib/gvfs/gvfsd >/dev/null 2>&1 <&1 & disown
sleep 1; Thunar --daemon >/dev/null 2>&1 <&1 & disown

save it as thunar-fix or similar (using gvfs in the title makes the process kill itself - you can hack around this but a name change is simpler).

Last edited by Alad (2015-02-20 13:38:11)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#5 2015-02-20 15:10:38

ggg377
Member
Registered: 2015-02-20
Posts: 43

Re: Thunar trash icon incorrectly showing as empty

Alad, what window manager are you using? This script doesn't look compatible with Openbox autostart and I currently lack the skills to implement it.

Offline

#6 2015-02-20 15:14:24

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Thunar trash icon incorrectly showing as empty

Alad wrote:

save it as thunar-fix

Alad wrote:

put this script plus a sleep delay in your autostart file

Offline

#7 2015-02-20 15:16:09

ggg377
Member
Registered: 2015-02-20
Posts: 43

Re: Thunar trash icon incorrectly showing as empty

drcouzelis wrote:
Alad wrote:

save it as thunar-fix

Alad wrote:

put this script plus a sleep delay in your autostart file

Oh I think I got it now. The post order had me a bit confused. I'll try and report back.

Edit: I copied the script into a file named "thunar-fix", which I then moved to ~/thunar-fix. I added

(sleep 3s && ~/thunar-fix) &

to Openbox autostart and rebooted. Still nothing.

Edit2: Thunar refuses to play nice. I also noticed it crashes during some simple operations (easily reproduced) and won't show basic thumbnails without tumbler. I dropped it for pcmanfm, which has none of these flaws by default - even the trash issue is resolved. I can solve this case if someone presents a viable solution, but for the time being, I'm blaming the program. This thread can be considered closed for now.

Last edited by ggg377 (2015-02-20 17:26:51)

Offline

#8 2015-02-21 22:21:36

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,413
Website

Re: Thunar trash icon incorrectly showing as empty

You did make it executable also? (chmod +x) .. but if it works in PCManFM I've no further ideas.


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

Board footer

Powered by FluxBB