3 ### XXX Chose not to 'set -e' because arithmetic evaluation can cause a non-zero exit.
4 ### XXX Chose not to 'set -u' because unset params ($1, $2, ...) cause failures.
5 ### Solutions to the above are ugly.
15 q | Q
) echo 'CMD_QUIT';;
16 h | H
) echo 'CMD_MOVE_BACK';;
17 l | L
) echo 'CMD_MOVE_FORWARD';;
18 f | F
) echo 'CMD_FAVORITE';;
19 *) echo 'CMD_UKNOWN';;
24 local -r root_dir
="$1"
28 for path
in $
(find "$root_dir" -type f
)
30 if file "$path" |
grep 'image data' > /dev
/null
33 # \r jumps to the beginning of the line:
34 printf '\rFound %d images.' "$n" >&2
35 paths
["$(( n - 1 ))"]="$path"
46 printf '%d of %d %s\n' "$(( i + 1 ))" "$n" "$path"
47 feh
--bg-scale "$path"
52 local path
="${paths[$i]}"
54 set_wallpaper
"$i" "$path"
58 if [[ "${paths[$i]}" != "$path" ]]
61 set_wallpaper
"$i" "$path"
64 case "$(read_command)" in
68 (( i
= i
== 0 ?
(n
- 1) : i
- 1));;
70 (( i
= (i
+ 1) % n
));;
83 '') root_dir
="$DIR_WALLPAPERS";;
87 paths_find
"$root_dir"
This page took 0.085779 seconds and 4 git commands to generate.