mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
change location of config files to .config/ani-cli
fix small bugs
This commit is contained in:
parent
9e4722da4e
commit
4250ab4fd3
21
ani-cli
21
ani-cli
@ -6,10 +6,15 @@ player_fn="mpv"
|
||||
|
||||
prog="ani-cli"
|
||||
logfile="${XDG_CACHE_HOME:-$HOME/.cache}/ani-hsts"
|
||||
history_db="${XDG_CONFIG_HOME:-$HOME/.ani-cli}/history.sqlite3"
|
||||
|
||||
[ -z "$XDG_CONFIG_HOME" ] && config_dir="$HOME/.ani-cli/" ||
|
||||
config_dir="$XDG_CONFIG_HOME"
|
||||
# Set config directory
|
||||
if [[ -z "$XDG_CONFIG_HOME" ]]; then
|
||||
config_dir="$HOME/.config/ani-cli"
|
||||
else
|
||||
config_dir="$XDG_CONFIG_HOME/ani-cli"
|
||||
fi
|
||||
|
||||
history_db="$XDG_CONFIG_HOME/ani-cli/history.sqlite3"
|
||||
|
||||
# sql=$(sqlite3 -noheader "$history_db")
|
||||
|
||||
@ -102,9 +107,10 @@ dep_ch() {
|
||||
}
|
||||
|
||||
check_anime_name() {
|
||||
# Maybe change to query the db for a similar name
|
||||
# Check to make sure passed in name is not empty
|
||||
printf "%s\n" "VAR: $1"
|
||||
if [[ "$1" == "" ]]; then
|
||||
if [[ "$1" == "" ]] || [[ "$1" == " " ]] || [[ "$1" == "\n" ]]; then
|
||||
printf "%s\n" "Passed in name is null"
|
||||
return 1
|
||||
fi
|
||||
@ -147,10 +153,9 @@ update_date() {
|
||||
|
||||
insert_history() {
|
||||
# inserts into search/watch history db
|
||||
|
||||
# check the anime_name/id
|
||||
if [[ $(check_anime_name "$1") -ne 0 ]]; then
|
||||
printf "%s\n" "ERROR: Anime name is none"
|
||||
if [[ ! $(check_anime_name "$1") ]]; then
|
||||
printf "%s\n" "ERROR: Anime name is none... exiting"
|
||||
return 1
|
||||
fi
|
||||
curdate=$(date +'%Y-%m-%d')
|
||||
@ -256,7 +261,7 @@ anime_selection() {
|
||||
rofi -dmenu -config "$config_dir"/meh.rasi \
|
||||
-a "$searched" \
|
||||
-l 12 -i -p "Enter number:")
|
||||
|
||||
[ "$?" -ne 0 ] && return 1
|
||||
choice=$(printf '%s\n' "$user_input" | awk '{print $1}')
|
||||
name=$(printf '%s\n' "$user_input" | awk '{print $NF}')
|
||||
if [[ "$VERBOSE" -eq 1 ]]; then
|
||||
|
@ -1,13 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CMD=/usr/bin/ani-cli
|
||||
DEFAULT="$HOME/Videos/sauce/"
|
||||
CFG_DIR="$XDG_CONFIG_HOME/ani-cli"
|
||||
|
||||
# not a wrapper around the ani-cli-rofi
|
||||
|
||||
options="1. Stream|2. Download|3. Continue|4. Quit"
|
||||
|
||||
choice=$(echo "${options[@]}" | rofi -dmenu -sep '|' \
|
||||
-config ~/.ani-cli/meh.rasi -l 4 -i -p "Enter choice:")
|
||||
-config "$CFG_DIR/meh.rasi" -l 4 -i -p "Enter choice:")
|
||||
|
||||
[ "$choice" == "4. Quit" ] && (
|
||||
echo 'Quitting...'
|
||||
@ -20,10 +22,10 @@ if [[ "$selection" == "1." ]]; then
|
||||
echo "STREAMING..."
|
||||
$CMD
|
||||
elif [[ "$selection" == "2." ]]; then
|
||||
dl_dir=$(rofi -dmenu -config ~/.ani-cli/meh.rasi \
|
||||
dl_dir=$(rofi -dmenu -config "$CFG_DIR/meh.rasi" \
|
||||
-l 1 -p "Enter downlaod dir:")
|
||||
# if dl_dir is none set to current directory
|
||||
[ "$dl_dir" == "" ] && dl_dir="$HOME/Videos/sauce/"
|
||||
[ "$dl_dir" == "" ] && dl_dir="$DEFAULT"
|
||||
$CMD -d "$dl_dir"
|
||||
elif [[ "$selection" == "3." ]]; then
|
||||
$CMD -H
|
||||
|
2
db.sh
2
db.sh
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR=$HOME/.ani-cli
|
||||
DIR="$XDG_CONFIG_HOME/ani-cli"
|
||||
DB='history.sqlite3'
|
||||
|
||||
log() {
|
||||
|
14
setup.sh
14
setup.sh
@ -10,16 +10,20 @@ log() {
|
||||
|
||||
# DIR="$HOME/.ani-cli/"
|
||||
DB="history.sqlite3"
|
||||
DIR="$XDG_CONFIG_HOME/ani-cli/"
|
||||
MPV_DIR="$XDG_CONFIG_HOME/mpv/"
|
||||
|
||||
[[ -z "$XDG_CONFIG_HOME" ]] && DIR="$HOME/.ani-cli"
|
||||
[[ -z "$XDG_CONFIG_HOME" ]] && MPV_DIR="$HOME/.config/.ani-cli"
|
||||
if [[ -z "$XDG_CONFIG_HOME" ]]; then
|
||||
DIR="$HOME/.config/ani-cli"
|
||||
MPV_DIR="$HOME/.config/mpv"
|
||||
else
|
||||
DIR="$XDG_CONFIG_HOME/ani-cli"
|
||||
MPV_DIR="$XDG_CONFIG_HOME/mpv"
|
||||
fi
|
||||
|
||||
printf "%s\n" "INSTALL DIR: $DIR"
|
||||
|
||||
if [[ "$DIR" == "$HOME/.config" ]]; then
|
||||
printf "%s\n" "Maybe don't wanna delete that directory"
|
||||
# change so it prompts before deleting
|
||||
printf "%s\n" "Maybe don't wanna delete that directory: $DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -11,7 +11,7 @@ configuration {
|
||||
sidebar-mode: true;
|
||||
}
|
||||
|
||||
@import "~/.ani-cli/arc_dark_transparent_colors.rasi"
|
||||
@import "~/.config/ani-cli/arc_dark_transparent_colors.rasi"
|
||||
|
||||
window {
|
||||
background-color: @background;
|
||||
|
Loading…
Reference in New Issue
Block a user