configure wallpaper tags on the fly
This commit is contained in:
parent
d7190cee8d
commit
0743307cac
2 changed files with 8 additions and 1 deletions
|
@ -65,6 +65,7 @@ _: {
|
|||
|
||||
files = [
|
||||
".config/gh/hosts.yml"
|
||||
".config/wallpaper_tags"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,8 +5,14 @@ set -eu
|
|||
DIR="${1:-/tmp}"
|
||||
mkdir -p "$DIR"
|
||||
|
||||
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
TAGS="$(<$CONFIG_DIR/wallpaper_tags)"
|
||||
if [ -n "$TAGS" ]; then
|
||||
TAGS="q=$TAGS&"
|
||||
fi
|
||||
|
||||
notify-send -r 9897 -i information -t 1000 "Wallpapers" "Downloading..."
|
||||
URL="https://wallhaven.cc/api/v1/search?categories=100&purity=100&atleast=3840x2160&ratios=16x9&sorting=random"
|
||||
URL="https://wallhaven.cc/api/v1/search?${TAGS}categories=100&purity=100&atleast=3840x2160&ratios=16x9&sorting=random"
|
||||
ID="$(curl --silent "$URL" | jq -r '.data[0].id')"
|
||||
IMAGE_META=$(curl --silent "https://wallhaven.cc/api/v1/w/$ID")
|
||||
IMAGE_URL="$(echo "$IMAGE_META" | jq -r '.data.path')"
|
||||
|
|
Loading…
Reference in a new issue