edit otros.sh: mejora ver_imgs
imgs con espacios en el nombre fix. ver otros directorios distintos a ./
This commit is contained in:
parent
5d9204a76d
commit
42f566ce1d
16
otros.sh
16
otros.sh
@ -44,12 +44,18 @@ ver_imgs(){
|
|||||||
[[ -z "${@}" ]] && dir_imgs="./" || dir_imgs="${@}"
|
[[ -z "${@}" ]] && dir_imgs="./" || dir_imgs="${@}"
|
||||||
[[ ! "${dir_imgs}" =~ /$ ]] && dir_imgs+='/'
|
[[ ! "${dir_imgs}" =~ /$ ]] && dir_imgs+='/'
|
||||||
if [ -d "${dir_imgs}" ] && [ "${TERM}" = "xterm-kitty" ]; then
|
if [ -d "${dir_imgs}" ] && [ "${TERM}" = "xterm-kitty" ]; then
|
||||||
for imagen in $(ls "${dir_imgs}"); do
|
ConT=0
|
||||||
img="${dir_imgs}${imagen}"
|
OIFS="$IFS"
|
||||||
|
IFS=$'\n'
|
||||||
|
while read -a LINEA; do
|
||||||
|
[[ -r "${dir_imgs}${LINEA}" ]] && imagenes[$ConT]="${dir_imgs}${LINEA}" && ((++ConT))
|
||||||
|
done <<< $(\ls -U "${dir_imgs}")
|
||||||
|
IFS="$OIFS"
|
||||||
|
for img in "${imagenes[@]}"; do
|
||||||
if [ -f "${img}" ]; then
|
if [ -f "${img}" ]; then
|
||||||
shopt -s nocasematch
|
shopt -s nocasematch
|
||||||
if [[ "${imagen}" =~ \.(jpe?g|png|svg|webp|gif|ico|bmp|tiff?)$ ]]; then
|
if [[ "${img}" =~ \.(jpe?g|png|svg|webp|gif|ico|bmp|tiff?)$ ]]; then
|
||||||
printf 'Imagen: [%b%s%s%b]\n' "${GRn}" "${dir_imgs}" "${imagen}" "${RST}"
|
printf 'Imagen: [%b%s%s%b]\n' "${GRn}" "${dir_imgs}" "${img}" "${RST}"
|
||||||
kitty +kitten icat "${img}"
|
kitty +kitten icat "${img}"
|
||||||
read -p 'continuar'
|
read -p 'continuar'
|
||||||
else
|
else
|
||||||
@ -221,7 +227,5 @@ metronomo() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
touch_exec(){
|
|
||||||
touch "${1}" && chmod u+x ${1} && nvim ${1}; }
|
|
||||||
|
|
||||||
"$@"
|
"$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user