Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rofi flag #1186

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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