feat(bash): move functions

This commit is contained in:
Nikurasu 2024-03-04 09:00:13 +01:00
parent badeeba6a9
commit 448afa4574
Signed by: Nikurasu
GPG Key ID: 9E7F14C03EF1F271
1 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,17 @@
function tp {
if [ -d $1 ]
then
if ! gum confirm "$(basename $1) is directory! Do you really want to delete it?"
then
exit 1
fi
fi
mv $(realpath $1) $HOME/.local/share/Trash/files/
echo -e "[Trash Info]\nPath=$(realpath $1)\nDeletionDate=$(date "+%Y-%m-%dT%H:%M:%S")" > $HOME/.local/share/Trash/info/$(basename $1).trashinfo
gum style --bold --border rounded --border-foreground "#F5A9B8" --foreground "#5BCEFA" "$(basename $1) has been thrown in the bin"
}
function secure_erase {
dd if=/dev/urandom of=/dev/$1 bs=1M status=progress
dd if=/dev/urandom of=/dev/$1 bs=1M status=progress