aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xwaldl13
1 files changed, 7 insertions, 6 deletions
diff --git a/waldl b/waldl
index 6333590..13384d4 100755
--- a/waldl
+++ b/waldl
@@ -1,6 +1,6 @@
#!/bin/sh
-# https://git.xgenos.me/waldl
+# https://git.surgot.tech/waldl
# script to find and download wallpapers from wallhaven
version="0.0.1"
@@ -15,8 +15,9 @@ version="0.0.1"
## User variables ##
####################
+[ -z $VIEWER ] && VIEWER=sxiv
# the dir where wallpapers are stored
-walldir="$HOME/pix/wall"
+walldir="$HOME/.local/share/wallhaven"
# the dir used to cache thumbnails
cachedir="$HOME/.cache/wallhaven"
# sxiv options
@@ -29,7 +30,7 @@ sorting=relevance
# quality : large original small
quality=large
# atleast : least res
-atleast=3840x2160
+atleast=1920x1080
# allow the user to customize the defaults
[ -e "$HOME/.config/waldlrc" ] && . "$HOME/.config/waldlrc"
@@ -69,7 +70,7 @@ dep_ck () {
command -v $pr >/dev/null 2>&1 || sh_info "command $pr not found, install: $pr" 1
done
}
-dep_ck "sxiv" "curl" "jq"
+dep_ck "$VIEWER" "curl" "jq"
# clean up command that would be called when the program exits
@@ -137,7 +138,7 @@ done | curl -Z -K -
###########################
# extract the id's out of the thumbnail name
-image_ids="$(sxiv $sxiv_otps "$cachedir")"
+image_ids="$($VIEWER $sxiv_otps "$cachedir")"
[ -z "$image_ids" ] && exit
#########################
@@ -157,4 +158,4 @@ do
done | curl -K -
sh_info "wallpapers downloaded in:- '$walldir'"
-sxiv $(ls -c)
+$VIEWER $(ls -c)