home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5b89700
)
Add fzf search selector command
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 26 Jan 2022 03:30:22 +0000
(22:30 -0500)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 26 Jan 2022 03:30:22 +0000
(22:30 -0500)
home/bin/wallpaper_review
patch
|
blob
|
blame
|
history
diff --git
a/home/bin/wallpaper_review
b/home/bin/wallpaper_review
index
a821bf3
..
b466255
100755
(executable)
--- a/
home/bin/wallpaper_review
+++ b/
home/bin/wallpaper_review
@@
-42,6
+42,7
@@
read_command() {
f | F) _command='CMD_FAVORITE_ADD';;
r | R) _command='CMD_FAVORITE_REMOVE';;
s | S) _command='CMD_SET_CURRENT';;
f | F) _command='CMD_FAVORITE_ADD';;
r | R) _command='CMD_FAVORITE_REMOVE';;
s | S) _command='CMD_SET_CURRENT';;
+ z | Z) _command='CMD_FZF';;
:) read_command_goto;;
*)
printf 'Error: unknown command: %s\n' "$char" >&2
:) read_command_goto;;
*)
printf 'Error: unknown command: %s\n' "$char" >&2
@@
-119,6
+120,14
@@
paths_preview() {
CMD_SET_CURRENT)
printf 'Setting as current: "%s"\n' "$path" >&2
echo "$path" > "$FILE_WALLPAPER_CURR";;
CMD_SET_CURRENT)
printf 'Setting as current: "%s"\n' "$path" >&2
echo "$path" > "$FILE_WALLPAPER_CURR";;
+ CMD_FZF)
+ i=$(
+ for j in "${!paths[@]}"; do
+ printf '%d %s\n' "$((j + 1))" "${paths[j]}"
+ done \
+ | fzf -e \
+ | awk '{print $1 - 1}'
+ );;
CMD_UKNOWN)
continue;;
esac
CMD_UKNOWN)
continue;;
esac
This page took
0.029273 seconds
and
4
git commands to generate.