diff --git a/home/dot_config/ranger/scripts/executable_dotify.sh b/home/dot_config/ranger/scripts/executable_dotify.sh new file mode 100644 index 0000000..1b7aedd --- /dev/null +++ b/home/dot_config/ranger/scripts/executable_dotify.sh @@ -0,0 +1,27 @@ +#!/bin/env bash + +# File : conf.d/ranger/scripts/dotify.sh +# Author : Jeff Lance +# Date : 01.10.2023 19:06:09 +# Last Modified Date: 01.10.2023 19:06:09 +# Last Modified By : Jeff Lance +# +# Script that alter visibility of a set of selected files. +# It renames files prefixing a dot in the name. + + + +for path in "$@"; do + file_name="$(basename "$path")" + dir_name="$(dirname "$path")" + case "$file_name" in .*) + mv -v -- "$path" "$dir_name/${file_name#.}" + ;; + *) + mv -v -- "$path" "$dir_name/.$file_name" + ;; + esac +done + +printf "Press ENTER to continue" +read -r