add MYsan icon and create icons dir in setup

This commit is contained in:
ksyasuda 2021-12-30 20:00:49 -08:00
parent 072680d637
commit a1486457da
3 changed files with 21 additions and 19 deletions

BIN
.assets/icons/MYsan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

View File

@ -11,7 +11,8 @@ VERBOSE=0
BASE_URL=$(curl -s -L -o /dev/null -w "%{url_effective}\n" https://gogoanime.cm) BASE_URL=$(curl -s -L -o /dev/null -w "%{url_effective}\n" https://gogoanime.cm)
CFG_DIR="$XDG_CONFIG_HOME/aniwrapper" CFG_DIR="$XDG_CONFIG_HOME/aniwrapper"
ROFI_CFG="meh.rasi" ROFI_CFG="meh.rasi"
ANIWRAPPER_ICON_PATH="$CFG_DIR/aniwrapper.png" ANIWRAPPER_ICON_PATH="$CFG_DIR/icons/icon-64.png"
MAISAN_ICON_PATH="$CFG_DIR/icons/MYsan.png"
HISTORY_DB="$XDG_CONFIG_HOME/aniwrapper/history.sqlite3" HISTORY_DB="$XDG_CONFIG_HOME/aniwrapper/history.sqlite3"
@ -494,7 +495,7 @@ open_episode() {
# ffmpeg -i "$play_link" -c copy "${anime_id}-${episode}.mkv" >/dev/null 2>&1 && # ffmpeg -i "$play_link" -c copy "${anime_id}-${episode}.mkv" >/dev/null 2>&1 &&
ffmpeg -i "$play_link" -c copy "${episode}.mkv" >/dev/null 2>&1 && ffmpeg -i "$play_link" -c copy "${episode}.mkv" >/dev/null 2>&1 &&
notify-send -i "$ANIWRAPPER_ICON_PATH" "Download complete for ${anime_id//-/ } - Episode: $episode" || notify-send -i "$ANIWRAPPER_ICON_PATH" "Download complete for ${anime_id//-/ } - Episode: $episode" ||
notify-send -i "$ANIWRAPPER_ICON_PATH" "Download failed for ${anime_id//-/ } - Episode: $episode. Please retry or check your internet connection" notify-send -i "$MAISAN_ICON_PATH" "Download failed for ${anime_id//-/ } - Episode: $episode. Please retry or check your internet connection"
# printf "${c_green}Downloaded episode: %s${c_reset}\n" "$episode" || # printf "${c_green}Downloaded episode: %s${c_reset}\n" "$episode" ||
# printf "${c_red}Download failed episode: %s , please retry or check your internet connection${c_reset}\n" "$episode" # printf "${c_red}Download failed episode: %s , please retry or check your internet connection${c_reset}\n" "$episode"
} }

View File

@ -46,14 +46,15 @@ run_setup() {
log "History database created..." log "History database created..."
fi fi
if [[ ! -f "$DIR/meh.rasi" ]]; then
# Move theme files and skip-intro script to correct locations # Move theme files and skip-intro script to correct locations
log "Moving theme files..." log "Moving theme files..."
cp themes/* "$DIR"/ cp themes/* "$DIR"/
log "Theme files moved..." log "Theme files moved..."
fi
log "Creating mpv/scripts/ directory if it doesn't exist..." log "Creating mpv/scripts/ directory if it doesn't exist..."
mkdir -p "$MPV_DIR/scripts/" mkdir -p "$MPV_DIR/scripts/"
log "Created mpv scripts directory..."
if [[ ! -f "$MPV_DIR/scripts/skip-intro.lua" ]]; then if [[ ! -f "$MPV_DIR/scripts/skip-intro.lua" ]]; then
log "Moving skip-intro.lua into mpv scripts directory..." log "Moving skip-intro.lua into mpv scripts directory..."
cp lua/skip-intro.lua "$MPV_DIR/scripts/" cp lua/skip-intro.lua "$MPV_DIR/scripts/"
@ -62,19 +63,19 @@ run_setup() {
log "skip-intro.lua already exists in $XDG_CONFIG_HOME/mpv/scripts/" log "skip-intro.lua already exists in $XDG_CONFIG_HOME/mpv/scripts/"
fi fi
# install aniwrapper icon if [[ ! -d "$DIR/icons" ]]; then
log "Creating icons directory"
mkdir -p "$DIR/icons"
fi
# install aniwrapper icons
cp .assets/icons/* "$DIR/icons/"
log "Installed icons in config directory..."
# xdg-icon-resource install --size 64 ./assets/icons/icon-64.png aniwrapper --novendor # xdg-icon-resource install --size 64 ./assets/icons/icon-64.png aniwrapper --novendor
cp .assets/icons/icon-64.png "$XDG_CONFIG_HOME/aniwrapper/icon-64.png"
} }
if [[ ! -d "$DIR" ]]; then
if run_setup; then if run_setup; then
log "Setup Complete...." log "Setup Complete...."
else else
printf "%s\n" "There was an error during setup" printf "%s\n" "There was an error during setup"
exit 1 exit 1
fi fi
else
log "Directory exists... skipping setup"
exit 0
fi