X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Fbin%2Fwallpaper_review;h=8b15bcb677d0822ed3fd1237115bd8ce631bdef7;hb=24fe724930dfa50bde13d88f4d56b29585541d5b;hp=b4662551417c9202d78c112cb89eb861ac43b7fd;hpb=8c5e077fe3264197a4182c8db8f0a6fb2abf1070;p=khome.git diff --git a/home/bin/wallpaper_review b/home/bin/wallpaper_review index b466255..8b15bcb 100755 --- a/home/bin/wallpaper_review +++ b/home/bin/wallpaper_review @@ -109,7 +109,7 @@ paths_preview() { (( i = (i + 1) % n ));; CMD_FAVORITE_ADD) printf 'Adding to favorites set: "%s"\n' "$path" >&2 - wallpaper_fav;; + wallpaper_fav "$path";; CMD_FAVORITE_REMOVE) printf 'Removing from favorites set: "%s"\n' "$path" >&2 digest=$(sha256sum "$path" | awk '{print $1}') @@ -134,18 +134,57 @@ paths_preview() { done } +help_print() { + cat <&2 + +Navigation help: + +key | action +----+---------------------------------------------- + q | quit + h | move back + l | move forward + f | add to favorites + r | remove from favorites + s | set current + z | fuzzy search for next file path + :N | goto Nth image +----+---------------------------------------------- + +EOF +} + +usage() { + cat <&2 + +$(basename "$0") [cmd] + +cmd | args | meaning +----+-------+------------------------------------------------ + f | | favorites + d | | from given dir + a | | all from $DIR_WALLPAPERS <- DEFAULT if no cmd. + h | | usage help. i.e. this message. +----+-------+------------------------------------------------ + +EOF +} + main() { case "$1" in f | fav) paths_set_from_favs;; d | dir) paths_set_from_dir_find "$2";; a | all) paths_set_from_dir_find "$DIR_WALLPAPERS";; + h | -h | help | -help | --help) + usage; + exit 1;; '') paths_set_from_dir_find "$DIR_WALLPAPERS";; *) printf 'Error: unknown source "%s"\n' "$1" >&2 exit 1;; esac - + help_print paths_preview }