Skip to content

Commit df3e0a9

Browse files
m0squdevport19x
andauthored
feat: add possibility to display rofi menus as normal windows (#1481)
Co-authored-by: port19 <[email protected]>
1 parent e48843b commit df3e0a9

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

ani-cli

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/bin/sh
22

3-
version_number="4.9.8"
3+
version_number="4.9.9"
44

55
# UI
66

77
external_menu() {
8-
rofi "$1" -sort -dmenu -i -width 1500 -p "$2"
8+
rofi "$1" -sort -dmenu -i -width 1500 -p "$2" "$3"
99
}
1010

1111
launcher() {
1212
[ "$use_external_menu" = "0" ] && [ -z "$1" ] && set -- "+m" "$2"
1313
[ "$use_external_menu" = "0" ] && fzf "$1" --reverse --cycle --prompt "$2"
14-
[ "$use_external_menu" = "1" ] && external_menu "$1" "$2"
14+
[ "$use_external_menu" = "1" ] && external_menu "$1" "$2" "$external_menu_args"
1515
}
1616

1717
nth() {
@@ -365,6 +365,7 @@ esac
365365
no_detach="${ANI_CLI_NO_DETACH:-0}"
366366
exit_after_play="${ANI_CLI_EXIT_AFTER_PLAY:-0}"
367367
use_external_menu="${ANI_CLI_EXTERNAL_MENU:-0}"
368+
external_menu_normal_window="${ANI_CLI_EXTERNAL_MENU_NORMAL_WINDOW:-0}"
368369
skip_intro="${ANI_CLI_SKIP_INTRO:-0}"
369370
# shellcheck disable=SC2154
370371
skip_title="$ANI_CLI_SKIP_TITLE"
@@ -445,6 +446,7 @@ while [ $# -gt 0 ]; do
445446
done
446447
[ "$use_external_menu" = "0" ] && multi_selection_flag="${ANI_CLI_MULTI_SELECTION:-"-m"}"
447448
[ "$use_external_menu" = "1" ] && multi_selection_flag="${ANI_CLI_MULTI_SELECTION:-"-multi-select"}"
449+
[ "$external_menu_normal_window" = "1" ] && external_menu_args="-normal-window"
448450
printf "\33[2K\r\033[1;34mChecking dependencies...\033[0m\n"
449451
dep_ch "curl" "sed" "grep" || true
450452
[ "$skip_intro" = 1 ] && (dep_ch "ani-skip" || true)
@@ -479,7 +481,7 @@ case "$search" in
479481
printf "\33[2K\r\033[1;36mSearch anime: \033[0m" && read -r query
480482
done
481483
else
482-
[ -z "$query" ] && query=$(printf "" | external_menu "" "Search anime: ")
484+
[ -z "$query" ] && query=$(printf "" | external_menu "" "Search anime: " "$external_menu_args")
483485
[ -z "$query" ] && exit 1
484486
fi
485487
# for checking new releases by specifying anime name

ani-cli.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ Sets the player ani-cli uses. Can be debug (print links), download (equivalent t
8989
\fBANI_CLI_EXTERNAL_MENU\fR
9090
Controls the frontend of ani-cli. Can be 0 (uses fzf) or 1 (uses rofi dmenu). Default is 0.
9191
.TP
92+
\fBANI_CLI_EXTERNAL_MENU_NORMAL_WINDOW\fR
93+
Controls the way rofi displays the window. Can be 0 (no additional arguments passed to rofi) or 1 (the menu is displayed as a normal window, -normal-window argument is passed to rofi). Default is 0.
94+
.TP
9295
\fBANI_CLI_LOG_EPISODE\fR
9396
Controls the logging feature for playback. Can be 1(logs) or 0(doesn't log). Default is 1.
9497
.TP

0 commit comments

Comments
 (0)