#!/bin/bash
#This script installs the liveSHOW software

#---- Declare path settings ----

SOURCE_APPFOLDER="SPIT_MIDIClient"
SOURCE_APPPATH=`dirname "$0"`

DEST_APPNAME="liveSHOW_Midi"
DEST_APPFOLDER="$SOURCE_APPFOLDER"
DEST_APPSPATH="$HOME/.local/share/liveSHOWApps"

#Path to applications menu
DEST_MENUPATH="$HOME/.local/share/applications"
#Path to Desktop
desktopVar=$(cat $HOME/.config/user-dirs.dirs | grep "XDG_DESKTOP_DIR")
DEST_DESKTOPPATH="${desktopVar[@]/XDG_DESKTOP_DIR='"$HOME'/$HOME}"
DEST_DESKTOPPATH="${DEST_DESKTOPPATH[@]/'"'/''}"
#Path to autostart
DEST_AUTOSTARTPATH="$HOME/.config/autostart"

DESKTOP_FILE="$DEST_APPSPATH/$DEST_APPFOLDER/$DEST_APPNAME.desktop"

mkdir "$DEST_AUTOSTARTPATH"

#---- Copy desktop file to autostart ----

cp "$DESKTOP_FILE" "$DEST_AUTOSTARTPATH"

echo "$DEST_APPNAME autostart enabled"
