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 Xdg Trash specification to stay compatible with other file managers #4
Comments
Nice addition, works like you did, but with the correct xdg specification. However, looking |
Issue added to |
Oh, thanks for checking |
@guildem |
Having 2 different behaviors for one action is not what I would encourage. Moving files from other partitions to the home trash can be time consuming and take too much space (ie. small root ssd with trash and big hdd with big files to trash), but it stays coherent. All files are trashed and can be recovered. Having trash (and recovery) on main partition and deletion on others can lead to errors when mounting multiple partitions (I have a Temporary solution : a trash action and a delete action on the home partition, and only a delete action on other partitions. Enhancement : getting trash on other partitions functional, by waiting Would that be a good compromise to you ? |
so this is my final solution for now Screencast.from.2024-04-08.19-20-58.webm |
I'm not sure to understand what you've done, but maybe the better choice is to wait for the trash package to implement other trashes itself (or make a PR) ? |
The method I currently use is to delete it directly if it is no longer local, but a confirmation message will be displayed before deletion. There is no xdg in macos, so macos currently deletes it directly. And btw i dont have any Mac so i cant test it........ |
For macos you should have this (untested) : https://github.com/Bios-Marcel/wastebasket or this https://apple.stackexchange.com/a/310084 (no lib) Globally I stay on the position that one action giving 2 different behaviors (even with a popup) isn't great, and 2 actions could be better, one for trash, one for delete (like ranger with |
OK i will try this But the biggest problem with macos is that I don’t have a machine to test :( |
@AnshumanNeon Sorry to tag you :( |
yeah sure |
Oh I know why. |
Ok thanks for your testing! |
superfile.log logs. so you are trying to call "xdg-open" which is a program that needs to be installed? |
// ...
} else if len(panel.element) > 0 && !panel.element[panel.cursor].directory {
cmd := exec.Command("xdg-open", panel.element[panel.cursor].location)
_, err := cmd.Output()
if err != nil {
outPutLog("err when open file with xdg-open:", err)
}
}
// ...
}
I think this is another error. |
https://superuser.com/a/913226 |
this is the error when trying again after installing xdg-utils |
Ok i got it. And about the Macos trash can, I think I'll fix it tomorrow :( |
no problem |
@mhnightcat i found a really easy solution. It is in this thread https://apple.stackexchange.com/a/310084 mentioned by @guildem |
bb55ece |
but this is what is already there. That osascript isn't working. |
Oh~ ok got it i will update again! |
@AnshumanNeon I update it in 5dfbcb9 |
Does this work? |
no it doesn't. Here is the log:
|
sorry for being late |
It's fine! |
yes it works now! it moves it to trash dir without errors. Congrats |
OK, thanks for testing! I close this issue for now. still can’t put the files on the external hard drive into the trash btw |
Seems you use a
trash
folder into your config folder. This is not compatible with XDG Trash specification and can lead to incompatibilities with other file managers. Also when trashing files on other disks it will make a full copy when moving the file, this can take a lot of time and will abnormally grow the config folder and home (or root) partition.The specifications : https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html (with multi device folders)
Some trash management softwares (none in archlinux extra, only aur) : https://wiki.archlinux.org/title/Trash_management
The text was updated successfully, but these errors were encountered: