- #!/usr/bin/env sh
-
-
-
-
-
-
-
-
-
-
-
-
-
- selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
-
- if command -v qmv >/dev/null 2>&1; then
- batchrenamesel="qmv -fdo -da"
- batchrename="qmv -fdo -a"
- elif command -v vidir >/dev/null 2>&1; then
- batchrenamesel="vidir"
- batchrename="vidir"
- else
- printf "there is not batchrename program installed."
- exit
- fi
-
- if [ -s "$selection" ]; then
- printf "rename selection? "
- read -r resp
- fi
-
- if [ "$resp" = "y" ]; then
-
- xargs -o -0 $batchrenamesel < "$selection"
- elif [ ! "$(LC_ALL=C ls -a)" = ".
- .." ]; then
-
- $batchrename
- fi
|