rwallpaper: reemplazo de bgs por ImageMagick
This commit is contained in:
parent
cd8e8016e4
commit
3329fbc254
|
@ -1,11 +1,27 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# Dependencias: ImageMagick
|
||||||
|
|
||||||
|
deps() {
|
||||||
|
if ! command -v magick >/dev/null; then
|
||||||
|
printf '%s\n' "ImageMagick no disponible, instálelo"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
DIR_WALL="$HOME/Datos/Imágenes/Wallpapers"
|
||||||
|
RES=$(sed 's/,/x/g' /sys/class/graphics/fb?/virtual_size)
|
||||||
|
|
||||||
dir_wall="$HOME/Datos/Imágenes/Wallpapers"
|
|
||||||
list() {
|
list() {
|
||||||
for file in "$dir_wall"/*; do
|
for file in "$DIR_WALL"/*; do
|
||||||
[ -f "$file" ] || continue
|
[ -f "$file" ] || continue
|
||||||
printf '%s\n' "$file"
|
printf '%s\n' "$file"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
wallpaper=$(list | grep -E '(jpeg|jpg|png)$' | sort -R | tail -1)
|
|
||||||
bgs -z "$wallpaper"
|
WALLPAPER=$(list | grep -E '(jpeg|jpg|png)$' | sort -R | tail -1)
|
||||||
|
if deps; then
|
||||||
|
# Al añadir ! cuando se define la resolución, si la imagen
|
||||||
|
# tiene resolución pequeña la ajusta para ocupar toda la pantalla
|
||||||
|
# de tal forma que la imagen no quede en mosaico
|
||||||
|
display -resize "!$RES" -window root "$WALLPAPER"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue