-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallpaper
executable file
·26 lines (21 loc) · 947 Bytes
/
wallpaper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
## By Davoud Arsalani
## https://github.com/davoudarsalani/scripts
## https://github.com/davoudarsalani/scripts/blob/master/wallpaper
## https://raw.githubusercontent.com/davoudarsalani/scripts/master/wallpaper
## https://davoudarsalani.ir
source "$HOME"/main/scripts/gb
current_wallpaper_file=/tmp/current_wallpaper
case "$1" in
select )
readarray -t wallpapers < <(find "$HOME"/main/wallpapers/ -mindepth 1 -maxdepth 1 -type f -iname '*.jpg' | sort)
wallpaper="$(pipe_to_rofi "${wallpapers[@]##*/}" 'header=wallpaper')" || exit 37
printf '%s\n' "$wallpaper" > "$current_wallpaper_file"
feh --bg-fill "$HOME"/main/wallpapers/"$wallpaper" ;;
random )
random_wallpaper ;;
current )
cur_wall="$(< "$current_wallpaper_file")"
text="$(printf "current wallpaper:\n<span color=\"%s\">%s</span>" "$orange" "$cur_wall")"
msgn "$text" ;;
esac