diff --git a/bash/tamakirc b/bash/tamakirc index 1e39e12..b7d782b 100644 --- a/bash/tamakirc +++ b/bash/tamakirc @@ -26,3 +26,17 @@ if [ -f "$HOME/Documents/coding/dotfiles/shell/alias/alias" ]; then . $HOME/Documents/coding/dotfiles/shell/alias/alias fi . "$HOME/.cargo/env" + +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" +} diff --git a/shell/scripts/AutoDeleteDownloads.sh b/shell/scripts/AutoDeleteDownloads.sh new file mode 100644 index 0000000..2e9bc6a --- /dev/null +++ b/shell/scripts/AutoDeleteDownloads.sh @@ -0,0 +1,3 @@ +#! /usr/bin/env sh + +find $HOME/Downloads/ -type f -mtime +14 -print diff --git a/shell/scripts/trash.sh b/shell/scripts/trash.sh new file mode 100755 index 0000000..3b38e57 --- /dev/null +++ b/shell/scripts/trash.sh @@ -0,0 +1,12 @@ +#! /usr/bin/env bash +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" \ No newline at end of file