#!/bin/bash

DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"

function error {
  echo -e "\\e[91m$1\\e[39m"
  exit 1
}

"${DIRECTORY}/pkg-install" "gir1.2-appindicator3-0.1 python3-distutils-extra python3-levenshtein python3-websocket" "$(dirname "$0")" || exit 1

wget 'https://github.com/Ulauncher/Ulauncher/releases/download/5.9.0/ulauncher_5.9.0_all.deb' -O ~/ulauncher.deb || error 'Failed to download ulauncher.deb!'

sudo apt install -y --fix-missing ~/ulauncher.deb || error "APT failed to install ulauncher.deb!"

rm -f ~/ulauncher.deb
exit 0
