Add Earth View wallpaper download script
This commit is contained in:
parent
32d869d7e0
commit
814bbbc1b5
|
@ -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"
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue