mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-11-22 03:19:53 -08:00
Compare commits
2 Commits
d2611e6e33
...
1461c3bc62
Author | SHA1 | Date | |
---|---|---|---|
|
1461c3bc62 | ||
|
4c2d7ae27e |
16
ani-cli
16
ani-cli
@ -394,9 +394,9 @@ find_media() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
get_directory_data "$inp"
|
get_directory_data "$inp"
|
||||||
selection="$(rofi -dpi "$DPI" -dmenu -only-match -async-pre-read 33 -config "$ROFI_CFG" \
|
selection="$(rofi -dpi "$DPI" -dmenu -no-custom -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" <<< "$inputlist")"
|
-p "Enter selection" -window-title 'aniwrapper' <<< "$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" < <(run_stmt "$stmt"))
|
-config "$ROFI_CFG" -window-title 'aniwrapper' < <(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 -only-match \
|
selection="$(rofi -dpi "$DPI" -dmenu -no-custom \
|
||||||
-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" <<< "$menu")"
|
-mesg "$msg" -a "$searched" -p "Enter selection" -window-title 'aniwrapper' <<< "$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" \
|
-mesg "$msg" -window-title 'aniwrapper' \
|
||||||
-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 -only-match -sep '|' -a "$cur_quality" -mesg "$(generate_span "Current quality: $quality")" \
|
-i -l 6 -no-custom -sep '|' -a "$cur_quality" -mesg "$(generate_span "Current quality: $quality")" \
|
||||||
-p "Choose quality:" -selected-row "$cur_quality" <<< "$qualities")
|
-p "Choose quality:" -window-title 'aniwrapper' -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"
|
||||||
|
21
aniwrapper
21
aniwrapper
@ -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 \
|
-l 6 -selected-row 0 -a 0 -window-title 'aniwrapper' \
|
||||||
-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 '|' -only-match <<< "$QUALITIES")
|
-sep '|' -no-custom <<< "$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:" \
|
-p "Enter video player:" -window-title 'aniwrapper' \
|
||||||
-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:"
|
-l 1 -p "Enter download dir:" -window-title 'aniwrapper'
|
||||||
)
|
)
|
||||||
# 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 -only-match -sep '|' \
|
choice=$(echo "${options[@]}" | rofi -dpi "$DPI" -dmenu -no-custom -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")
|
-config "$CFG_FILE" -l 7 -i -p "Aniwrapper" -window-title 'aniwrapper')
|
||||||
|
|
||||||
[ "$choice" == "$quit" ] && quit
|
[ "$choice" == "$quit" ] && quit
|
||||||
|
|
||||||
@ -351,11 +351,12 @@ 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 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")")
|
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")")
|
||||||
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 < <(sqlite3 -noheader -list "$CFG_DIR/history.sqlite3" <<< "SELECT directory FROM file_history WHERE filename = 'DIRECTORY' ORDER BY WATCH_DATE DESC;")
|
-async-pre-read 24 -matching 'fuzzy' -window-title 'aniwrapper' \
|
||||||
|
< <(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%% }"
|
||||||
@ -393,9 +394,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" \
|
choice=$(rofi -dmenu -config "$CFG_FILE" -dpi "$DPI" -window-title 'aniwrapper' \
|
||||||
-theme-str 'listview {columns: 1;} window {width: 45%;}' \
|
-theme-str 'listview {columns: 1;} window {width: 45%;}' \
|
||||||
-only-match -l 4 -i -p "Choose theme: " -sep '|' \
|
-no-custom -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user