Compare commits

..

No commits in common. "1461c3bc62ce91472674af3a7d88077bd4e61493" and "d2611e6e337fcd1d109e8b5699a8b942f665f19b" have entirely different histories.

2 changed files with 18 additions and 19 deletions

16
ani-cli
View File

@ -394,9 +394,9 @@ find_media() {
fi fi
get_directory_data "$inp" get_directory_data "$inp"
selection="$(rofi -dpi "$DPI" -dmenu -no-custom -async-pre-read 33 -config "$ROFI_CFG" \ selection="$(rofi -dpi "$DPI" -dmenu -only-match -async-pre-read 33 -config "$ROFI_CFG" \
-l 15 -i -sep '|' -mesg "$(generate_span "Current directory: $inp")" -a "$watched" \ -l 15 -i -sep '|' -mesg "$(generate_span "Current directory: $inp")" -a "$watched" \
-p "Enter selection" -window-title 'aniwrapper' <<< "$inputlist")" -p "Enter selection" <<< "$inputlist")"
lg "SELECTION: $selection" 1> /dev/stderr lg "SELECTION: $selection" 1> /dev/stderr
case "$selection" in case "$selection" in
Back | ../) Back | ../)
@ -439,7 +439,7 @@ get_search_query() {
msg="Choose from list of searched anime below, or enter a unique name of an anime to search for" msg="Choose from list of searched anime below, or enter a unique name of an anime to search for"
query=$(rofi -dpi "$DPI" -dmenu -l 15 -p "Search Anime:" \ query=$(rofi -dpi "$DPI" -dmenu -l 15 -p "Search Anime:" \
-mesg "$(generate_span "$msg")" \ -mesg "$(generate_span "$msg")" \
-config "$ROFI_CFG" -window-title 'aniwrapper' < <(run_stmt "$stmt")) -config "$ROFI_CFG" < <(run_stmt "$stmt"))
query="${query//[1-9]*\. /}" query="${query//[1-9]*\. /}"
elif [ "$IS_ROFI" -eq 0 ]; then elif [ "$IS_ROFI" -eq 0 ]; then
prompt "Search Anime" prompt "Search Anime"
@ -496,9 +496,9 @@ anime_selection() {
# get the anime from indexed list # get the anime from indexed list
msg="$(generate_span "Query: $query")" msg="$(generate_span "Query: $query")"
selection="$(rofi -dpi "$DPI" -dmenu -no-custom \ selection="$(rofi -dpi "$DPI" -dmenu -only-match \
-async-pre-read 33 -config "$ROFI_CFG" -l 15 -i -sep '|' \ -async-pre-read 33 -config "$ROFI_CFG" -l 15 -i -sep '|' \
-mesg "$msg" -a "$searched" -p "Enter selection" -window-title 'aniwrapper' <<< "$menu")" -mesg "$msg" -a "$searched" -p "Enter selection" <<< "$menu")"
choice="${selection%%.*}" # remmove everything from . to end choice="${selection%%.*}" # remmove everything from . to end
lg "CHOICE: $choice" lg "CHOICE: $choice"
if ((choice == cnt)); then if ((choice == cnt)); then
@ -559,7 +559,7 @@ episode_selection() {
-theme-str 'window {width: 45%;}' \ -theme-str 'window {width: 45%;}' \
-a "$watch_history" \ -a "$watch_history" \
-p "Select Episode [$first_ep_number, $last_ep_number]:" \ -p "Select Episode [$first_ep_number, $last_ep_number]:" \
-mesg "$msg" -window-title 'aniwrapper' \ -mesg "$msg" \
-config "$ROFI_CFG" -config "$ROFI_CFG"
) )
ep_choice_start=$(printf '%s\n' "${choice}" | awk '{print $1}') ep_choice_start=$(printf '%s\n' "${choice}" | awk '{print $1}')
@ -908,8 +908,8 @@ main() {
done <<< "$qualities" done <<< "$qualities"
choice=$(rofi -dmenu -dpi "$DPI" -config "$ROFI_CFG" \ choice=$(rofi -dmenu -dpi "$DPI" -config "$ROFI_CFG" \
-theme-str 'listview {columns: 1;} window {width: 25%;}' \ -theme-str 'listview {columns: 1;} window {width: 25%;}' \
-i -l 6 -no-custom -sep '|' -a "$cur_quality" -mesg "$(generate_span "Current quality: $quality")" \ -i -l 6 -only-match -sep '|' -a "$cur_quality" -mesg "$(generate_span "Current quality: $quality")" \
-p "Choose quality:" -window-title 'aniwrapper' -selected-row "$cur_quality" <<< "$qualities") -p "Choose quality:" -selected-row "$cur_quality" <<< "$qualities")
quality=$(awk '{ print $2 }' <<< "$choice") quality=$(awk '{ print $2 }' <<< "$choice")
else else
qualities="best|1080p|720p|480p|360p|worst" qualities="best|1080p|720p|480p|360p|worst"

View File

@ -113,10 +113,10 @@ run() {
get_quality() { get_quality() {
if ((IS_ROFI == 1)); then if ((IS_ROFI == 1)); then
selection=$(rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \ selection=$(rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \
-l 6 -selected-row 0 -a 0 -window-title 'aniwrapper' \ -l 6 -selected-row 0 -a 0 \
-theme-str 'listview {columns: 1;} window {width: 25%;}' \ -theme-str 'listview {columns: 1;} window {width: 25%;}' \
-p "Choose video quality:" \ -p "Choose video quality:" \
-sep '|' -no-custom <<< "$QUALITIES") -sep '|' -only-match <<< "$QUALITIES")
QUALITY=$(awk '{print $2}' <<< "$selection") QUALITY=$(awk '{print $2}' <<< "$selection")
else else
qualities="best|1080p|720p|480p|360p|worst" qualities="best|1080p|720p|480p|360p|worst"
@ -241,7 +241,7 @@ get_player() {
PLAYER_FN=$( PLAYER_FN=$(
awk '{print $NF}' < <(rofi -dmenu -config "$CFG_FILE" -DPI "$DPI" \ awk '{print $NF}' < <(rofi -dmenu -config "$CFG_FILE" -DPI "$DPI" \
-l 4 -theme-str 'listview {columns: 1;} window {width: 40%;}' \ -l 4 -theme-str 'listview {columns: 1;} window {width: 40%;}' \
-p "Enter video player:" -window-title 'aniwrapper' \ -p "Enter video player:" \
-mesg "$(printf "%s\n%s\n" "$(generate_span "$msg1")" "$(generate_span "$msg2")")" \ -mesg "$(printf "%s\n%s\n" "$(generate_span "$msg1")" "$(generate_span "$msg2")")" \
-a 0 -sep '|' <<< "$SUPPORTED_PLAYERS") -a 0 -sep '|' <<< "$SUPPORTED_PLAYERS")
) )
@ -299,7 +299,7 @@ get_dl_dir() {
rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \ rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \
-theme-str 'listview {columns: 1;} window {width: 45%;}' \ -theme-str 'listview {columns: 1;} window {width: 45%;}' \
-mesg "$(generate_span "Enter the path to the download directory, or leave blank to go with the default: $HOME/Videos/sauce/")" \ -mesg "$(generate_span "Enter the path to the download directory, or leave blank to go with the default: $HOME/Videos/sauce/")" \
-l 1 -p "Enter download dir:" -window-title 'aniwrapper' -l 1 -p "Enter download dir:"
) )
# if dl_dir is none set to current directory # if dl_dir is none set to current directory
[ "$dl_dir" == "" ] && dl_dir="$DEFAULT_DOWNLOAD" [ "$dl_dir" == "" ] && dl_dir="$DEFAULT_DOWNLOAD"
@ -314,9 +314,9 @@ get_dl_dir() {
main() { main() {
((SILENT != 1)) && lg "CONFIG DIR: $CFG_DIR" ((SILENT != 1)) && lg "CONFIG DIR: $CFG_DIR"
((SILENT != 1)) && lg "ROFI CFG: $CFG_FILE" ((SILENT != 1)) && lg "ROFI CFG: $CFG_FILE"
choice=$(echo "${options[@]}" | rofi -dpi "$DPI" -dmenu -no-custom -sep '|' \ choice=$(echo "${options[@]}" | rofi -dpi "$DPI" -dmenu -only-match -sep '|' \
-theme-str 'listview {columns: 1;} window {width: 45%;}' \ -theme-str 'listview {columns: 1;} window {width: 45%;}' \
-config "$CFG_FILE" -l 7 -i -p "Aniwrapper" -window-title 'aniwrapper') -config "$CFG_FILE" -l 7 -i -p "Aniwrapper")
[ "$choice" == "$quit" ] && quit [ "$choice" == "$quit" ] && quit
@ -351,12 +351,11 @@ main() {
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
lg "Play from file selected" lg "Play from file selected"
IS_PLAY_FROM_FILE=1 IS_PLAY_FROM_FILE=1
span=$(printf '%s\n%s\n' "$(generate_span "Provide a path to a valid directory, or choose from the list below")" "$(generate_span "The program will begin searching for media files from the supplied directory")") span=$(printf '%s\n%s\n' "$(generate_span "Provide a valid path to a directory or leave blank to go with the default: $HOME/Videos/sauce/")" "$(generate_span "The program will begin searching for media files from the supplied directory")")
play_dir=$( play_dir=$(
rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \ rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \
-l 12 -mesg "$span" -p "Enter path to starting directory:" \ -l 12 -mesg "$span" -p "Enter path to starting directory:" \
-async-pre-read 24 -matching 'fuzzy' -window-title 'aniwrapper' \ -async-pre-read 24 < <(sqlite3 -noheader -list "$CFG_DIR/history.sqlite3" <<< "SELECT directory FROM file_history WHERE filename = 'DIRECTORY' ORDER BY WATCH_DATE DESC;")
< <(sqlite3 -noheader -list "$CFG_DIR/history.sqlite3" <<< "SELECT directory FROM file_history WHERE filename = 'DIRECTORY' ORDER BY WATCH_DATE DESC;")
) )
# trim trailing whitespace # trim trailing whitespace
play_dir="${play_dir%% }" play_dir="${play_dir%% }"
@ -394,9 +393,9 @@ main() {
# ----------------------------------------------------------------- # -----------------------------------------------------------------
[ -z "$THEMES" ] && seppuku "No themes provided... exiting" [ -z "$THEMES" ] && seppuku "No themes provided... exiting"
theme_idx="$(get_theme_idx)" theme_idx="$(get_theme_idx)"
choice=$(rofi -dmenu -config "$CFG_FILE" -dpi "$DPI" -window-title 'aniwrapper' \ choice=$(rofi -dmenu -config "$CFG_FILE" -dpi "$DPI" \
-theme-str 'listview {columns: 1;} window {width: 45%;}' \ -theme-str 'listview {columns: 1;} window {width: 45%;}' \
-no-custom -l 4 -i -p "Choose theme: " -sep '|' \ -only-match -l 4 -i -p "Choose theme: " -sep '|' \
-theme-str 'listview { columns: 2; }' \ -theme-str 'listview { columns: 2; }' \
-a "$theme_idx" -selected-row "$theme_idx" <<< "$THEMES") -a "$theme_idx" -selected-row "$theme_idx" <<< "$THEMES")
theme=$(awk '{ print $1 }' <<< "$choice") theme=$(awk '{ print $1 }' <<< "$choice")