mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
Compare commits
6 Commits
0d97d3857a
...
cf7cf4b591
Author | SHA1 | Date | |
---|---|---|---|
|
cf7cf4b591 | ||
|
1fddd452fe | ||
|
5aad3a7263 | ||
|
a6e80c1ad0 | ||
|
c5bf198466 | ||
|
1a54bf3b44 |
2
ani-cli
2
ani-cli
@ -569,6 +569,7 @@ episode_selection() {
|
||||
choice=$(
|
||||
seq 1 "$last_ep_number" |
|
||||
rofi -dpi "$DPI" -dmenu -l 12 \
|
||||
-theme-str 'window {width: 45%;}' \
|
||||
-a "$watch_history" \
|
||||
-p "Select Episode [1, $last_ep_number]:" \
|
||||
-mesg "$msg" \
|
||||
@ -948,6 +949,7 @@ main() {
|
||||
;;
|
||||
esac
|
||||
choice=$(rofi -dmenu -dpi "$DPI" -config "$ROFI_CFG" \
|
||||
-theme-str 'listview {columns: 1;} window {width: 20%;}' \
|
||||
-i -l 5 -only-match -sep '|' -a "$cur_quality" -mesg "$(generate_span "Current quality: $quality")" \
|
||||
-p "Choose quality:" <<< "1. best|2. 1080p|3. 720p|4. 360p|5. worst")
|
||||
quality=$(awk '{ print $2 }' <<< "$choice")
|
||||
|
19
aniwrapper
19
aniwrapper
@ -19,6 +19,7 @@ IS_CUSTOM_THEME=0
|
||||
IS_DOWNLOAD=0
|
||||
IS_PLAY_FROM_FILE=0
|
||||
IS_ROFI=1
|
||||
IS_SYNC=0
|
||||
VERBOSE=0
|
||||
SILENT=0
|
||||
|
||||
@ -70,7 +71,7 @@ quit() {
|
||||
}
|
||||
|
||||
run() {
|
||||
if ((IS_PLAY_FROM_FILE == 0 && GET_QUALITY == 1)); then
|
||||
if ((IS_PLAY_FROM_FILE == 0 && IS_SYNC == 0 && GET_QUALITY == 1)); then
|
||||
get_quality
|
||||
fi
|
||||
if ((SILENT == 1)); then
|
||||
@ -98,7 +99,8 @@ get_quality() {
|
||||
if ((IS_ROFI == 1)); then
|
||||
selection=$(rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \
|
||||
-l 5 -selected-row 0 -a 0 \
|
||||
-theme-str 'listview {columns: 1;}' -p "Choose video quality:" \
|
||||
-theme-str 'listview {columns: 1;} window {width: 20%;}' \
|
||||
-p "Choose video quality:" \
|
||||
-sep '|' -only-match <<< "$QUALITIES")
|
||||
QUALITY=$(awk '{print $2}' <<< "$selection")
|
||||
else
|
||||
@ -248,6 +250,7 @@ check_flags() {
|
||||
get_dl_dir() {
|
||||
dl_dir=$(
|
||||
rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \
|
||||
-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/")" \
|
||||
-l 1 -p "Enter download dir:"
|
||||
)
|
||||
@ -262,6 +265,7 @@ main() {
|
||||
((SILENT != 1)) && lg "CONFIG DIR: $CFG_DIR"
|
||||
((SILENT != 1)) && lg "ROFI CFG: $CFG_FILE"
|
||||
choice=$(echo "${options[@]}" | rofi -dpi "$DPI" -dmenu -only-match -sep '|' \
|
||||
-theme-str 'listview {columns: 1;} window {width: 45%;}' \
|
||||
-config "$CFG_FILE" -l 7 -i -p "Aniwrapper")
|
||||
|
||||
[ "$choice" == "$quit" ] && quit
|
||||
@ -299,6 +303,7 @@ main() {
|
||||
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")")
|
||||
play_dir=$(rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \
|
||||
-theme-str 'listview {columns: 1;} window {width: 45%;}' \
|
||||
-l 1 -mesg "$span" -p "Enter path to starting directory:")
|
||||
if [ -z "$play_dir" ]; then
|
||||
mkdir -p "$DEFAULT_DOWNLOAD" || seppuku "error creating default download directory"
|
||||
@ -310,14 +315,15 @@ main() {
|
||||
;;
|
||||
5.)
|
||||
lg "Sync history database"
|
||||
IS_SYNC=1
|
||||
roficmd="rofi -dpi $DPI -dmenu -config $CFG_FILE -l 0 -p"
|
||||
username=$($roficmd "Enter the username of the remote user:")
|
||||
username=$($roficmd "Enter the username of the remote user:" -theme-str 'window {width: 45%;}')
|
||||
[ -z "$username" ] && seppuku "No username provided... exiting"
|
||||
host=$($roficmd "Enter the host for the remote machine (eg 192.168.1.99):")
|
||||
host=$($roficmd "Enter the host for the remote machine (eg 192.168.1.99):" -theme-str 'window {width: 45%;}')
|
||||
[ -z "$host" ] && seppuku "No host provided... exiting"
|
||||
port=$($roficmd "Enter in the ssh port for remote machine or leave blank for default [22]:")
|
||||
port=$($roficmd "Enter in the ssh port for remote machine or leave blank for default [22]:" -theme-str 'window {width: 45%;}')
|
||||
[ -z "$port" ] && port=22
|
||||
keypath=$($roficmd "Enter path to private key (leave blank if not needed or if unsure):")
|
||||
keypath=$($roficmd "Enter path to private key (leave blank if not needed or if unsure):" -theme-str 'window {width: 45%;}')
|
||||
if ! printf "%s\n%s\n%d\n%s\n" "$username" "$host" "$port" "$keypath" | run -s; then
|
||||
lg "Aniwrapper was unable to sync the databases..."
|
||||
exit 1
|
||||
@ -332,6 +338,7 @@ main() {
|
||||
# -----------------------------------------------------------------
|
||||
[ -z "$THEMES" ] && seppuku "No themes provided... exiting"
|
||||
choice=$(rofi -dmenu -config "$CFG_FILE" -dpi "$DPI" \
|
||||
-theme-str 'listview {columns: 1;} window {width: 45%;}' \
|
||||
-only-match -l 4 -i -p "Choose theme: " -sep '|' \
|
||||
-theme-str 'listview { columns: 2; }' <<< "$THEMES")
|
||||
theme=$(awk '{ print $1 }' <<< "$choice")
|
||||
|
@ -39,7 +39,7 @@ window {
|
||||
location: west;
|
||||
anchor: west;
|
||||
height: 70%;
|
||||
width: 25%;
|
||||
width: 45%;
|
||||
orientation: vertical;
|
||||
children: [mainbox];
|
||||
border: 2px 2px 2px 0px;
|
||||
|
@ -86,16 +86,17 @@ listview {
|
||||
margin: 0px 0px 1px 0px;
|
||||
}
|
||||
element {
|
||||
border: 2px;
|
||||
border: 3px;
|
||||
border-color: #d19a66;
|
||||
padding: 2px 15px;
|
||||
padding: 3px 15px;
|
||||
margin: 1px;
|
||||
}
|
||||
element-text {
|
||||
background-color: inherit;
|
||||
text-color: inherit;
|
||||
}
|
||||
element.normal.normal {
|
||||
background-color: @normal-background;
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
element.normal.urgent {
|
||||
@ -103,7 +104,7 @@ element.normal.urgent {
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
element.normal.active {
|
||||
background-color: @active-background;
|
||||
background-color: @alternate-normal-background;
|
||||
border-color: @blue;
|
||||
text-color: @blue;
|
||||
}
|
||||
@ -184,7 +185,7 @@ prompt {
|
||||
|
||||
inputbar {
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
padding: 15px 0px;
|
||||
padding: 1px 0px;
|
||||
}
|
||||
|
||||
textbox-prompt-colon {
|
||||
|
Loading…
Reference in New Issue
Block a user