Skip to content

Instantly share code, notes, and snippets.

@merrickluo
Created August 9, 2021 11:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merrickluo/8785c4e8e062bdb70dbc9af939b8e03d to your computer and use it in GitHub Desktop.
Save merrickluo/8785c4e8e062bdb70dbc9af939b8e03d to your computer and use it in GitHub Desktop.
bash script to fetch bingwallpaper
#!/usr/bin/env bash
resolution=3840
api="https://bing.biturl.top/?resolution=$resolution"
store="$HOME/Pictures/Bing"
mkdir -p $store
img_url=`curl -s $api | jq -r .url`
img_name=${img_url##*=}
echo $img_url
echo $img_name
curl -s "$img_url" -o $store/$img_name
echo "Wallpaper saved to $store/$img_name"
rm $store/current
ln -s $store/$img_name $store/current
* */6 * * * ~/.bin/binwall >> /dev/null 2>&1
i3lock -t -i ~/Pictures/Bing/current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment