#YOUR_UBUNTU_VERSION_HERE=bionic    #18.04  buster    10
#YOUR_UBUNTU_VERSION_HERE=focal     #20.04  bullseye  11
YOUR_UBUNTU_VERSION_HERE=groovy    #20.10  bullseye  11
#YOUR_UBUNTU_VERSION_HERE=hirsuite  #21.04  bullseye  11
#YOUR_UBUNTU_VERSION_HERE=impish    #21.10  bullseye  11

VERSION=${1:-stable}

if [[ $1 == nightly ]]; then
	VERSION=nightlies;
elif [[ $1 == stable ]]; then
	VERSION=mixxx;
else
	echo "Pass stable or nighty (default: stable)";
fi

cat > /etc/apt/sources.list-available/mixxx_${1}.list <EOF
deb http://ppa.launchpad.net/mixxx/${VERSION}/ubuntu $YOUR_UBUNTU_VERSION_HERE main 
deb-src http://ppa.launchpad.net/mixxx/${VERSION}/ubuntu $YOUR_UBUNTU_VERSION_HERE main 
EOF

ln -sf /etc/apt/sources.list-available/mixxx_${1}.list /etc/apt/sources.list.d/mixxx_${1}.list		
apt update
apt install -y mixxx
