From 448afa4574d0e3b88b820d25fcb1db246bb9a867 Mon Sep 17 00:00:00 2001 From: Nikurasu Date: Mon, 4 Mar 2024 09:00:13 +0100 Subject: [PATCH] feat(bash): move functions --- {shell => bash}/functions.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) rename {shell => bash}/functions.sh (56%) diff --git a/shell/functions.sh b/bash/functions.sh similarity index 56% rename from shell/functions.sh rename to bash/functions.sh index 0c948d8..3f37f1f 100755 --- a/shell/functions.sh +++ b/bash/functions.sh @@ -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