Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ~/.local/share/Trash/files/ on linux? #80

Open
leb-kuchen opened this issue Mar 16, 2024 · 4 comments
Open

Use ~/.local/share/Trash/files/ on linux? #80

leb-kuchen opened this issue Mar 16, 2024 · 4 comments

Comments

@leb-kuchen
Copy link
Contributor

I was wondering, what would speak against using this folder, since it preserves metadata.

@joshuamegnauth54
Copy link
Contributor

Are you referring to the same issue as in #66 ?

I've wondered about watching XDG_DATA_HOME/Trash for changes while researching how to fix that issue as well. It turns out that the trash isn't so clean and tidy that only one folder can be monitored for changes.

The trash in terms of the Freedesktop spec is closer to a virtual file system that may consist of multiple folders across mount points. This is to avoid copying files across mount files when trashed which may be expensive. There may be a global trash folder in the top directory of a mount to support cross mount trashing. There may also be .Trash-$(uid) folders in the top dir of a mount if the global trash is supported but invalid in some way.

So, XDG_DATA_HOME/Trash is the "home trash" folder, but there may be others that need to be watched as well. I would really like to fix this issue so I've thought about the trash a lot. 😹 Maybe soon. Finding the trash directories is a bigger hassle than I imagined. trash-rs implements it by calling the getmnt series of functions. However, these functions are not thread safe and therefore scary to a newbie like myself. trash-cli actually had segfaults a while back due to the same functions.

@jackpot51
Copy link
Member

Since trash-rs already knows, we should get the trash directory list from there.

@leb-kuchen
Copy link
Contributor Author

Nautilus shows the deleted timestamp, which I consider to be more useful. I do not know, if trash-rs knows the deleted timestamp( and I currently do not have the time to do research), or you would have to parse the info files for that.
@joshuamegnauth54 I am referring to the blank modified field.

@jackpot51
Copy link
Member

trash-rs does provide the deleted time if we want to show that in the modified column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants