This PR should mostly be in shape, expect that:
- I'm not handling
g_file_trasherrors. No idea what the ncdu error handling strat is. - Static linking is broken. I won't have the time to look into this—hopefully someone else can pick up the torch.
This PR should mostly be in shape, expect that:
g_file_trash errors. No idea what the ncdu error handling strat is.I'm alright with a move to trash feature, but the biggest challenge is finding where and how to store that trash in some sort of standard way - as usual, too many standards.
Your patch defers that to glib, but I really do not want ncdu to link to a big library like glib in any way. The only real alternative is to write our own non-standard trash approach or find a tiny (optionally vendor-able) C lib to link to, but I'm not sure one exists. (I have experience with statically linking glib for ncdc, it's a pain)
Other than that, I was hoping to use 'D' for a 'delete contents of current directory' feature, but key bindings won't be a blocker.
tiny (optionally vendor-able) C lib to link to, but I'm not sure one exists
Yeah, I search quite a bit for this and couldn't find one. There's a Rust implementation, but last time I checked it didn't work 100% right because the "Trashed on" date was missing. I'm also not a big fan of pulling in glib, but that seemed most correct.
Feel free to reject this PR if you think we'll end up having to do a Zig re-implementation, I mainly wanted to get a patch up I could use for myself lol.
I was hoping to use 'D' for a 'delete contents of current directory' feature, but key bindings won't be a blocker.
Yup, no preferences here but had to pick something. :) We could go with w for waste.
Thinking out loud, maybe it's better to not implement the full complexity of a trash feature, but instead provide the infrastructure and tooling for the user to set their own policies. #165 for example could easily be used for either deferred deletion or move-to-trash.
Closing this PR for now, then.
Ooooh, yeah that'd be cool. A similar idea would be to let the user supply a command to be invoked on every "file action" (basically just a shortcut that will run the user supplied command) and then you pass in the file name either as an arg or on stdin. Then I could just pass in gio trash or #165 could append them to a file.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?