Skip to content

Commit

Permalink
feat: add rofi flag (#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
masha-sh authored Aug 2, 2023
1 parent bdb878c commit 1eb18c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ani-cli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

version_number="4.5.3"
version_number="4.5.4"

# UI

Expand Down Expand Up @@ -60,7 +60,9 @@ help_info() {
-e, --episode, -r, --range
Specify the number of episodes to watch
--dub
play dubbed version
Play dubbed version
-- rofi
Use rofi instead of fzf for the interactive menu
-U, --update
Update the script
-N, --non-interactive
Expand Down Expand Up @@ -180,10 +182,10 @@ get_episode_url() {
provider=1
i=0
cache_dir="$(mktemp -d)"
while [ "$i" -lt 6 ]; do
providers="1 2 3 4 5 6"
for provider in $providers; do
generate_link "$provider" >"$cache_dir"/"$i" &
provider=$((provider % 6 + 1))
: $((i += 1))
done
wait
# select the link with matching quality
Expand Down Expand Up @@ -368,6 +370,7 @@ while [ $# -gt 0 ]; do
;;
-N | --non-interactive) no_menu=1 ;;
--dub) mode="dub" ;;
--rofi) use_external_menu=1 ;;
-U | --update) update_script ;;
*) query="$(printf "%s" "$query $1" | sed "s|^ ||;s| |+|g")" ;;
esac
Expand Down Expand Up @@ -408,7 +411,7 @@ case "$search" in
printf "\33[2K\r\033[1;36mSearch anime: \033[0m" && read -r query
done
else
query=$(printf "" | external_menu "" "Search anime: ")
[ -z "$query" ] && query=$(printf "" | external_menu "" "Search anime: ")
[ -z "$query" ] && exit 1
fi
query=$(printf "%s" "$query" | sed "s| |+|g")
Expand Down
3 changes: 3 additions & 0 deletions ani-cli.1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Selects nth entry.
.TP
\fB\--dub\fR
Play the dubbed version. Without this flag, it'll always play the subbed version.
.TP
\fB\--rofi\fR
Use rofi instead of fzf for the interactive menu
.PP
.SH
ENVIRONMENT VARIABLES
Expand Down

0 comments on commit 1eb18c9

Please sign in to comment.