Add Earth View wallpaper download script

This commit is contained in:
coolneng 2023-01-13 21:36:18 +01:00
parent 32d869d7e0
commit 814bbbc1b5
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/bin/sh
IMAGE_URL="https://earthview.withgoogle.com/download"
ID_FILE="${HOME}/Documents/Misc/earthview-ids"
MAX_ID="$(wc -l <"${ID_FILE}")"
OUTPUT_FILE=/tmp/earthview-wallpaper.jpg
get_random_id() {
RANDOM_ID="$(shuf -n 1 -i 1-"${MAX_ID}")"
ID="$(sed -n "${RANDOM_ID}p" "$ID_FILE")"
}
set -e
get_random_id
curl -fLs "${IMAGE_URL}/${ID}.jpg" -o "${OUTPUT_FILE}"
swaymsg "output * bg $OUTPUT_FILE fill"

View File

@ -297,6 +297,8 @@ bindsym $mod+Shift+a exec ~/.local/share/scripts/recurrent-actions
bindsym $mod+Shift+s exec ~/.local/share/scripts/tmuxp-session bindsym $mod+Shift+s exec ~/.local/share/scripts/tmuxp-session
# power menu # power menu
bindsym $mod+Shift+p exec ~/.local/share/scripts/power-menu bindsym $mod+Shift+p exec ~/.local/share/scripts/power-menu
# earth view wallpaper
bindsym $mod+Shift+w exec ~/.local/share/scripts/earth-view-wallpaper
# theme switcher menu # theme switcher menu
bindsym $mod+Shift+t mode "$Theme-switch" bindsym $mod+Shift+t mode "$Theme-switch"