Add home/.config/ranger/scripts/dotify.sh
This commit is contained in:
parent
5b493d5888
commit
3de17747c6
27
home/dot_config/ranger/scripts/executable_dotify.sh
Normal file
27
home/dot_config/ranger/scripts/executable_dotify.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/env bash
|
||||
|
||||
# File : conf.d/ranger/scripts/dotify.sh
|
||||
# Author : Jeff Lance <email@jefflance.me>
|
||||
# Date : 01.10.2023 19:06:09
|
||||
# Last Modified Date: 01.10.2023 19:06:09
|
||||
# Last Modified By : Jeff Lance <email@jefflance.me>
|
||||
#
|
||||
# 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
|
Loading…
Reference in New Issue
Block a user