Open bim4n opened 8 months ago
Yes, it is something that should be added to trash-empty.
I'm thinking of adding a confirmation prompt, instead of a GUI confirmation. Something like this:
$ trash-empty
Are you sure? (yes/no)
I'm not confident to add a GUI prompt right now. If you already have a command that prepare the GUI prompt we can see how it can be called from trash-empty.
I found this sources for UI-Dialog: https://packages.debian.org/sid/dialog and: https://packages.debian.org/source/sid/dialog
It would be nice when the confirmation did not always come but only via a parameter.
For terminal: trash-empty --confirm
For automation with GUI Dialog: trash-empty --confirm-ui
What do y think about ?
I use your script for a custom shortcut in kali linux:
Or maybe this: https://help.gnome.org/users/zenity/stable/usage.html.de
this solution works, but is not optimal:
Script-File: empty-trash.sh
#!/bin/bash
count=$(ls -l ~/.local/share/Trash/files/ | grep -v ^- | tr -d "total ")
if [ $count -eq 0 ]
then
exit
fi
zenity --question --text="Empty all items from Trash?" --ok-label "Empty Trash" --cancel-label "Cancel"
if [ $? -eq 0 ]
then
trash-empty
fi
I think this is a good solution, and it is good that GUI elements are outside of the trash-cli package. In this way trash-cli will continue to be easy to be installed in environment that does not have zenity and/or a graphical environment.
Empty the trash worx fine, but very silently, Sometimes need a Confirmation Dialog like this:
Can you implement it ? a.E.
trash-empty --confirm