mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-11-22 03:19:53 -08:00
Compare commits
No commits in common. "9f80566b6eddc3cddf57da0963bef23088615b4b" and "260d212e22db6af6c2f017e7332b025d207b2809" have entirely different histories.
9f80566b6e
...
260d212e22
29
ani-cli
29
ani-cli
@ -4,7 +4,7 @@ CFG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/aniwrapper"
|
||||
HISTORY_DB="$CFG_DIR/history.sqlite3"
|
||||
ROFI_CFG="$CFG_DIR/themes/aniwrapper.rasi"
|
||||
ROFI_THEME="aniwrapper.rasi"
|
||||
THEMES="aniwrapper (default)|dracula|doomone|fancy|material|nord|nord2|onedark"
|
||||
THEMES="aniwrapper (default)|dracula|doomone|fancy|flamingo|material|nord|onedark"
|
||||
ANIWRAPPER_ICON_PATH="$CFG_DIR/icons/icon-64.png"
|
||||
MAISAN_ICON_PATH="$CFG_DIR/icons/MYsan.png"
|
||||
DPI=96
|
||||
@ -738,15 +738,15 @@ parse_args() {
|
||||
fancy)
|
||||
ROFI_THEME=aniwrapper-fancy.rasi
|
||||
;;
|
||||
flamingo)
|
||||
ROFI_THEME=aniwrapper-flamingo.rasi
|
||||
;;
|
||||
material)
|
||||
ROFI_THEME=aniwrapper-material.rasi
|
||||
;;
|
||||
nord)
|
||||
ROFI_THEME=aniwrapper-nord.rasi
|
||||
;;
|
||||
nord2)
|
||||
ROFI_THEME=aniwrapper-nord2.rasi
|
||||
;;
|
||||
onedark)
|
||||
ROFI_THEME=aniwrapper-onedark.rasi
|
||||
;;
|
||||
@ -805,11 +805,11 @@ main() {
|
||||
;;
|
||||
history)
|
||||
BASE_URL="$(curl -s -L -o /dev/null -w "%{url_effective}\n" https://gogoanime.cm)"
|
||||
stmt="SELECT DISTINCT anime_name FROM search_history ORDER BY search_date DESC"
|
||||
search_results="$(run_stmt "$stmt")"
|
||||
stmt="SELECT DISTINCT anime_name FROM watch_history ORDER BY watch_date DESC"
|
||||
search_results="$(printf "%s\n" "$stmt" | sqlite3 -noheader "$HISTORY_DB")"
|
||||
[ -z "$search_results" ] && die "History is empty"
|
||||
if ! anime_selection "${search_results[@]}"; then
|
||||
die "No anime selected"
|
||||
die "No anime selection found"
|
||||
fi
|
||||
lg "SELECTION: $selection_id"
|
||||
|
||||
@ -917,7 +917,6 @@ main() {
|
||||
;;
|
||||
Q)
|
||||
if ((IS_ROFI == 1)); then
|
||||
qualities="1. best|2. 1080p|3. 720p|4. 480p|5. 360p|6. worst"
|
||||
case "$quality" in
|
||||
best)
|
||||
cur_quality=0
|
||||
@ -928,20 +927,20 @@ main() {
|
||||
720p)
|
||||
cur_quality=2
|
||||
;;
|
||||
480p)
|
||||
360p)
|
||||
cur_quality=3
|
||||
;;
|
||||
360p)
|
||||
worst)
|
||||
cur_quality=4
|
||||
;;
|
||||
worst)
|
||||
cur_quality=5
|
||||
*)
|
||||
cur_quality=0
|
||||
;;
|
||||
esac
|
||||
choice=$(rofi -dmenu -dpi "$DPI" -config "$ROFI_CFG" \
|
||||
-theme-str 'listview {columns: 1;} window {width: 25%;}' \
|
||||
-i -l 6 -only-match -sep '|' -a "$cur_quality" -mesg "$(generate_span "Current quality: $quality")" \
|
||||
-p "Choose quality:" <<< "$qualities")
|
||||
-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")
|
||||
else
|
||||
qualities="best|1080p|720p|480p|360p|worst"
|
||||
|
53
aniwrapper
53
aniwrapper
@ -10,8 +10,8 @@ CFG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/aniwrapper"
|
||||
CFG_FILE="$CFG_DIR/themes/aniwrapper.rasi"
|
||||
DEFAULT_DOWNLOAD="$HOME/Videos/sauce"
|
||||
ROFI_THEME="aniwrapper.rasi"
|
||||
THEMES="aniwrapper|dracula|doomone|fancy|material|nord|nord2|onedark"
|
||||
QUALITIES="1. best|2. 1080p|3. 720p|4. 480p|5. 360p|6. worst"
|
||||
THEMES="aniwrapper (default)|dracula|doomone|fancy|flamingo|material|nord|onedark"
|
||||
QUALITIES="1. best|2. 1080p|3. 720p|4. 360p|5. worst"
|
||||
SUPPORTED_PLAYERS="mpv|mplayer|vlc"
|
||||
QUALITY=best
|
||||
PLAYER_FN=mpv
|
||||
@ -54,7 +54,7 @@ Options:
|
||||
-Q <query> query the history database
|
||||
-v verbose output
|
||||
-S silent mode (suppress output to stdout) [cannot be used with -v]
|
||||
-t <aniwrapper (default)|dracula|doomone|fancy|material|nord|nord2|onedark> change rofi theme
|
||||
-t <aniwrapper (default)|dracula|doomone|fancy|flamingo|material|onedark> change rofi theme
|
||||
-T <config_path> specify custom rofi theme
|
||||
"
|
||||
}
|
||||
@ -113,8 +113,8 @@ run() {
|
||||
get_quality() {
|
||||
if ((IS_ROFI == 1)); then
|
||||
selection=$(rofi -dpi "$DPI" -dmenu -config "$CFG_FILE" \
|
||||
-l 6 -selected-row 0 -a 0 \
|
||||
-theme-str 'listview {columns: 1;} window {width: 25%;}' \
|
||||
-l 5 -selected-row 0 -a 0 \
|
||||
-theme-str 'listview {columns: 1;} window {width: 20%;}' \
|
||||
-p "Choose video quality:" \
|
||||
-sep '|' -only-match <<< "$QUALITIES")
|
||||
QUALITY=$(awk '{print $2}' <<< "$selection")
|
||||
@ -131,40 +131,6 @@ get_quality() {
|
||||
lg "selected quality: $QUALITY"
|
||||
}
|
||||
|
||||
# return the index in $THEMES of $ROFI_THEME
|
||||
get_theme_idx() {
|
||||
case "$ROFI_THEME" in
|
||||
aniwrapper.rasi)
|
||||
theme_idx=0
|
||||
;;
|
||||
aniwrapper-dracula.rasi)
|
||||
theme_idx=1
|
||||
;;
|
||||
aniwrapper-doomone.rasi)
|
||||
theme_idx=2
|
||||
;;
|
||||
aniwrapper-fancy.rasi)
|
||||
theme_idx=3
|
||||
;;
|
||||
aniwrapper-material.rasi)
|
||||
theme_idx=4
|
||||
;;
|
||||
aniwrapper-nord.rasi)
|
||||
theme_idx=5
|
||||
;;
|
||||
aniwrapper-nord2.rasi)
|
||||
theme_idx=6
|
||||
;;
|
||||
aniwrapper-onedark.rasi)
|
||||
theme_idx=7
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
printf "%s" "$theme_idx"
|
||||
}
|
||||
|
||||
# generates a span mesg for rofi given
|
||||
# input: message: str
|
||||
generate_span() {
|
||||
@ -188,15 +154,15 @@ set_theme() {
|
||||
fancy)
|
||||
ROFI_THEME=aniwrapper-fancy.rasi
|
||||
;;
|
||||
flamingo)
|
||||
ROFI_THEME=aniwrapper-flamingo.rasi
|
||||
;;
|
||||
material)
|
||||
ROFI_THEME=aniwrapper-material.rasi
|
||||
;;
|
||||
nord)
|
||||
ROFI_THEME=aniwrapper-nord.rasi
|
||||
;;
|
||||
nord2)
|
||||
ROFI_THEME=aniwrapper-nord2.rasi
|
||||
;;
|
||||
onedark)
|
||||
ROFI_THEME=aniwrapper-onedark.rasi
|
||||
;;
|
||||
@ -429,8 +395,7 @@ main() {
|
||||
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; }' \
|
||||
-a "$(get_theme_idx)" <<< "$THEMES")
|
||||
-theme-str 'listview { columns: 2; }' <<< "$THEMES")
|
||||
theme=$(awk '{ print $1 }' <<< "$choice")
|
||||
set_theme "$theme"
|
||||
main
|
||||
|
141
themes/aniwrapper-flamingo.rasi
Normal file
141
themes/aniwrapper-flamingo.rasi
Normal file
@ -0,0 +1,141 @@
|
||||
/**
|
||||
* User: keystroke3
|
||||
* Copyright: keystroke3
|
||||
*
|
||||
*/
|
||||
|
||||
configuration {
|
||||
sidebar-mode: false;
|
||||
font: "Open Sans 12";
|
||||
}
|
||||
|
||||
* {
|
||||
text-color: @foreground;
|
||||
active-background: rgb(170, 70, 104);
|
||||
active-foreground: @foreground;
|
||||
normal-background: @background;
|
||||
normal-foreground: @foreground;
|
||||
urgent-background: #9E2A5E;
|
||||
urgent-foreground: @foreground;
|
||||
alternate-active-background: @background;
|
||||
alternate-active-foreground: @foreground;
|
||||
alternate-normal-background: @background;
|
||||
alternate-normal-foreground: @foreground;
|
||||
alternate-urgent-background: @background;
|
||||
alternate-urgent-foreground: @foreground;
|
||||
selected-active-background: #9E2A5E;
|
||||
selected-active-foreground: @foreground;
|
||||
selected-normal-background: rgb(170, 70, 104);
|
||||
selected-normal-foreground: #0c0816;
|
||||
selected-urgent-background: #9D596B;
|
||||
selected-urgent-foreground: @foreground;
|
||||
background-color: #0c0816;
|
||||
background: #D03C6E30;
|
||||
foreground: #8fc5c6;
|
||||
spacing: 0;
|
||||
}
|
||||
|
||||
window {
|
||||
location: west;
|
||||
anchor: west;
|
||||
height: 70%;
|
||||
width: 45%;
|
||||
orientation: vertical;
|
||||
children: [mainbox];
|
||||
border: 2px 2px 2px 0px;
|
||||
border-color: @active-background;
|
||||
hide-scrollbar: true;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
spacing: 0.2em;
|
||||
children: [inputbar, listview];
|
||||
}
|
||||
|
||||
|
||||
|
||||
listview {
|
||||
spacing: 0.6em;
|
||||
dynamic: false;
|
||||
cycle: true;
|
||||
padding: 0px 5px 0px 5px;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
border-radius: 50%;
|
||||
padding: 5px;
|
||||
border-spacing: 5px 0 0 0;
|
||||
border: 1px;
|
||||
spacing: 10px;
|
||||
margin: 5px 0 10px;
|
||||
border-color: @foreground;
|
||||
|
||||
}
|
||||
|
||||
entry{
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
|
||||
prompt{
|
||||
padding: 5px;
|
||||
background-color: @foreground;
|
||||
text-color: @background-color;
|
||||
border: 1px;
|
||||
border-radius: 50%;
|
||||
|
||||
}
|
||||
|
||||
|
||||
element {
|
||||
padding: 10px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
element normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
element normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
|
||||
element normal.active {
|
||||
background-color: #0390fc;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
|
||||
element selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
border-color: @active-background;
|
||||
}
|
||||
|
||||
element selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
|
||||
element selected.active {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: #0390fc;
|
||||
/* text-color: @selected-active-foreground; */
|
||||
}
|
||||
|
||||
element alternate.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
|
||||
element alternate.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
|
||||
element alternate.active {
|
||||
/* background-color: @active-background; */
|
||||
background-color: #0390fc;
|
||||
text-color: @active-foreground;
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* ROUNDED THEME FOR ROFI
|
||||
* User : LR-Tech
|
||||
* Theme Repo : https://github.com/lr-tech/rofi-themes-collection
|
||||
*******************************************************************************/
|
||||
|
||||
* {
|
||||
font: "Roboto 12";
|
||||
|
||||
background-color: transparent;
|
||||
text-color: @fg0;
|
||||
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
spacing: 0px;
|
||||
bg0: #2E3440F2;
|
||||
bg1: #3B4252;
|
||||
bg2: #4C566A80;
|
||||
bg3: #88C0D0F2;
|
||||
fg0: #D8DEE9;
|
||||
fg1: #ECEFF4;
|
||||
fg2: #D8DEE9;
|
||||
fg3: #4C566A;
|
||||
}
|
||||
|
||||
window {
|
||||
location: center;
|
||||
width: 80%;
|
||||
border-radius: 24px;
|
||||
background-color: @bg0;
|
||||
anchor: center;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
background-color: @bg1;
|
||||
border-color: @bg3;
|
||||
|
||||
border: 2px;
|
||||
border-radius: 16px;
|
||||
|
||||
padding: 8px 16px;
|
||||
spacing: 8px;
|
||||
children: [ prompt, entry, case-indicator ];
|
||||
}
|
||||
|
||||
prompt {
|
||||
text-color: @fg2;
|
||||
}
|
||||
|
||||
entry {
|
||||
placeholder: "Search";
|
||||
placeholder-color: @fg3;
|
||||
text-color: @fg0;
|
||||
}
|
||||
|
||||
case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @bg3;
|
||||
}
|
||||
|
||||
message {
|
||||
margin: 12px 0 0;
|
||||
border-radius: 16px;
|
||||
border-color: @bg2;
|
||||
background-color: @bg2;
|
||||
}
|
||||
|
||||
textbox {
|
||||
padding: 8px 24px;
|
||||
}
|
||||
|
||||
listview {
|
||||
background-color: transparent;
|
||||
|
||||
margin: 12px 0 0;
|
||||
lines: 12;
|
||||
columns: 2;
|
||||
|
||||
fixed-height: false;
|
||||
scrollbar: false;
|
||||
}
|
||||
|
||||
element {
|
||||
padding: 8px 16px;
|
||||
spacing: 8px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
|
||||
element normal active, element alternate active {
|
||||
background-color: @bg3;
|
||||
}
|
||||
|
||||
element selected normal, element selected active {
|
||||
background-color: @bg3;
|
||||
text-color: @bg1;
|
||||
}
|
||||
|
||||
element-icon {
|
||||
size: 1em;
|
||||
vertical-align: 0.5;
|
||||
}
|
||||
|
||||
element-text {
|
||||
text-color: inherit;
|
||||
}
|
||||
element selected {
|
||||
text-color: @bg1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user