#!/usr/bin/env bash

#-----------------------------------
# Name:     dwmblocks
# Version:  1.0.0
# Author:   Solomon Laing
# Description:
# Installs my customisation of dwmblocks
#-----------------------------------

clear

if command -v dwmblocks &>/dev/null; then
    echo "dwmblocks is already installed on the system."
    exit 0
fi

echo "This script is going to install my fork of dmenu with my custom styling. As such it will ask for root privilages."

git clone https://gitlab.inkletblot.com/inkletblot/dwmblocks-inkletblot "$HOME/repos/gitlab.inkletblot.com/inkletblot/dwmblocks-inkletblot"
cd "$HOME/repos/gitlab.inkletblot.com/inkletblot/dwmblocks-inkletblot" || exit 1
sudo -S make clean install

if ! command -v dwmblocks &>/dev/null; then
    echo "dwmblocks failed to install."
    exit 1
fi

exit 0
