Compare commits

..

No commits in common. "7907e809b8ac9195a6f3f1f23e4516e706fe6b91" and "f1fbb643aa6f42d140f21ed516ba9714fde69db9" have entirely different histories.

2 changed files with 22 additions and 11 deletions

30
ani-cli
View File

@ -918,18 +918,30 @@ main() {
Q) Q)
if ((IS_ROFI == 1)); then if ((IS_ROFI == 1)); then
qualities="1. best|2. 1080p|3. 720p|4. 480p|5. 360p|6. worst" qualities="1. best|2. 1080p|3. 720p|4. 480p|5. 360p|6. worst"
while IFS='|' read -ra quals; do case "$quality" in
for q in "${quals[@]}"; do best)
if [[ "$(awk '{ print $NF }' <<< "$q")" == "$quality" ]]; then cur_quality=0
cur_quality="$((${q:0:1} - 1))" ;;
break 1080p)
fi cur_quality=1
done ;;
done <<< "$qualities" 720p)
cur_quality=2
;;
480p)
cur_quality=3
;;
360p)
cur_quality=4
;;
worst)
cur_quality=5
;;
esac
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 -only-match -sep '|' -a "$cur_quality" -mesg "$(generate_span "Current quality: $quality")" \
-p "Choose quality:" -selected-row "$cur_quality" <<< "$qualities") -p "Choose 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

@ -426,12 +426,11 @@ main() {
# choose theme # choose theme
# ----------------------------------------------------------------- # -----------------------------------------------------------------
[ -z "$THEMES" ] && seppuku "No themes provided... exiting" [ -z "$THEMES" ] && seppuku "No themes provided... exiting"
theme_idx="$(get_theme_idx)"
choice=$(rofi -dmenu -config "$CFG_FILE" -dpi "$DPI" \ choice=$(rofi -dmenu -config "$CFG_FILE" -dpi "$DPI" \
-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 '|' \ -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 "$(get_theme_idx)" <<< "$THEMES")
theme=$(awk '{ print $1 }' <<< "$choice") theme=$(awk '{ print $1 }' <<< "$choice")
set_theme "$theme" set_theme "$theme"
main main