fix anime selection menu styling

getting list of active elements for rofi was broken due to bad not actually
incrementing the loop each iteration
This commit is contained in:
ksyasuda
2022-01-01 18:59:11 -08:00
parent ef5e8b6ec3
commit ce75838882
2 changed files with 33 additions and 14 deletions

11
ani-cli
View File

@@ -351,21 +351,24 @@ anime_selection() {
check_db "$anime" "search"
if [[ $? -gt 0 ]]; then
log "SEARCHED BEFORE"
if [[ "$searched" == "" ]]; then
searched="$((cnt++))"
if [ -z "$searched" ]; then
searched="$cnt"
else
searched="$searched, $((cnt++))"
searched="$searched, $cnt"
fi
fi
((++cnt))
done
log "SEARCHED: $searched"
# get the anime from indexed list
msg="<span foreground='peachpuff' style='italic' size='small' weight='normal'>Query: $query</span>"
user_input=$(printf "${menu[@]}" |
rofi -dmenu -config "$CFG_DIR/${ROFI_CFG}" \
-a "$searched" \
-l 12 -i -p "Enter number:")
-l 12 -i -p "Enter number:" \
-mesg "$msg")
[ -z "$user_input" ] && return 1
choice=$(printf '%s\n' "$user_input" | awk '{print $1}')