mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
fix getting query from search history or input
This commit is contained in:
parent
a5033db481
commit
cc9a0a870f
14
ani-cli
14
ani-cli
@ -207,10 +207,11 @@ get_search_query() {
|
|||||||
query=$(printf "%s\n" "${hist[@]}" |
|
query=$(printf "%s\n" "${hist[@]}" |
|
||||||
rofi -dmenu -l 12 -p "Search Anime:" \
|
rofi -dmenu -l 12 -p "Search Anime:" \
|
||||||
-mesg "$span" \
|
-mesg "$span" \
|
||||||
-config "$CFG_DIR/${ROFI_CFG}" | awk '{print $NF}')
|
-config "$CFG_DIR/${ROFI_CFG}")
|
||||||
|
|
||||||
|
# Strip the list entry number from string
|
||||||
|
query="${query//[1-9]\. /}"
|
||||||
[ "$VERBOSE" -eq 1 ] && printf "%s\n" "Query: $query"
|
[ "$VERBOSE" -eq 1 ] && printf "%s\n" "Query: $query"
|
||||||
# printf "Search Anime: "
|
|
||||||
# read -r query
|
|
||||||
else
|
else
|
||||||
query=$*
|
query=$*
|
||||||
fi
|
fi
|
||||||
@ -470,7 +471,7 @@ is_playlist=0
|
|||||||
playlist_remove=0
|
playlist_remove=0
|
||||||
playlist_add=0
|
playlist_add=0
|
||||||
playlist_file="$CFG_DIR/playlists/playlist.txt"
|
playlist_file="$CFG_DIR/playlists/playlist.txt"
|
||||||
while getopts 'hd:Hlpad' OPT; do
|
while getopts 'hd:HlpadP:' OPT; do
|
||||||
case $OPT in
|
case $OPT in
|
||||||
h)
|
h)
|
||||||
help_text
|
help_text
|
||||||
@ -502,6 +503,11 @@ while getopts 'hd:Hlpad' OPT; do
|
|||||||
is_delete=1
|
is_delete=1
|
||||||
scrape=delete
|
scrape=delete
|
||||||
;;
|
;;
|
||||||
|
P)
|
||||||
|
is_playlist=1
|
||||||
|
playlist_file="$OPTARG"
|
||||||
|
[ -z "$playlist_file" ] && die "Eneter in path to playlist"
|
||||||
|
mpv "$playlist_file"
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
14
aniwrapper
14
aniwrapper
@ -14,7 +14,7 @@ CFG_FILE="meh.rasi"
|
|||||||
|
|
||||||
options="1. Stream|2. Download|3. Continue|4. Queue|5. Quit"
|
options="1. Stream|2. Download|3. Continue|4. Queue|5. Quit"
|
||||||
|
|
||||||
choice=$(echo "${options[@]}" | rofi -dmenu -sep '|' -config "$CFG_DIR/$CFG_FILE" -l 4 -i -p "Enter choice:")
|
choice=$(echo "${options[@]}" | rofi -dmenu -sep '|' -config "$CFG_DIR/$CFG_FILE" -l 5 -i -p "Enter choice:")
|
||||||
|
|
||||||
[ "$choice" == "5. Quit" ] && (
|
[ "$choice" == "5. Quit" ] && (
|
||||||
echo 'Quitting...'
|
echo 'Quitting...'
|
||||||
@ -42,8 +42,20 @@ elif [[ "$selection" == "4." ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
)
|
)
|
||||||
selection=$(printf "%s\n" "$choice" | awk '{ print $1 }')
|
selection=$(printf "%s\n" "$choice" | awk '{ print $1 }')
|
||||||
|
if [[ "$selection" == "1." ]]; then
|
||||||
|
options="1. Streaming|2. From file|3. Quit"
|
||||||
|
choice=$(echo "${options[@]}" | rofi -dmenu -sep '|' -config "$CFG_DIR/$CFG_FILE" -l 4 -i -p "Enter choice:")
|
||||||
|
[ "$choice" == "4. Quit" ] && (
|
||||||
|
echo 'Quitting...'
|
||||||
|
exit 0
|
||||||
|
)
|
||||||
|
selection=$(printf "%s\n" "$choice" | awk '{ print $1 }')
|
||||||
if [[ "$selection" == "1." ]]; then
|
if [[ "$selection" == "1." ]]; then
|
||||||
"$CMD" -p
|
"$CMD" -p
|
||||||
|
elif [[ "$selection" == "2." ]]; then
|
||||||
|
"$CMD" -P
|
||||||
|
fi
|
||||||
|
# selection=$(printf "%s\n" "$choice" | awk '{ print $1 }')
|
||||||
elif [[ "$selection" == "2." ]]; then
|
elif [[ "$selection" == "2." ]]; then
|
||||||
"$CMD" -a
|
"$CMD" -a
|
||||||
elif [[ "$selection" == "3." ]]; then
|
elif [[ "$selection" == "3." ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user