#!/usr/bin/env bash # Setup script to move the rofi theme files to the correct location # As well as set up the history database # DO NOT RUN AS ROOT log() { printf "%s\n" "$1" } # DIR="$HOME/.ani-cli/" DB="history.sqlite3" 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" # log "Deleting old directory..." # rm -rf "$DIR" # log "Directory deleted..." if [[ ! -d "$DIR" ]]; then log "Creating directory $DIR" mkdir -p "$DIR" log "Directory created" fi if [[ ! -f "$DIR"/"$DB" ]]; then # Create the DB if not exists log "Creating history database..." sqlite3 "$DIR"/"$DB"