#!/bin/bash
#set -e
##################################################################################################################
# Author 	: Erik Dubois
# Website   : https://www.erikdubois.be
# Website   : https://www.alci.online
# Website	: https://www.arcolinux.info
# Website	: https://www.arcolinux.com
# Website	: https://www.arcolinuxd.com
# Website	: https://www.arcolinuxb.com
# Website	: https://www.arcolinuxiso.com
# Website	: https://www.arcolinuxforum.com
##################################################################################################################
#
#   DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
##################################################################################################################
#tput setaf 0 = black 
#tput setaf 1 = red 
#tput setaf 2 = green
#tput setaf 3 = yellow 
#tput setaf 4 = dark blue 
#tput setaf 5 = purple
#tput setaf 6 = cyan 
#tput setaf 7 = gray 
#tput setaf 8 = light blue
##################################################################################################################

# Check if any package starting with 'v4l-utils' is installed
if pacman -Q | grep -E '^v4l-utils-git' &> /dev/null; then
	echo '...'
else
	#sudo pacman -Rdd --noconfirm v4l-utils
    sudo pacman -S --noconfirm v4l-utils-git --ask 4
fi

# Check if hw-probe is installed
if ! pacman -Qi hw-probe &> /dev/null; then
    echo "hw-probe is not installed. Installing it..."
    sudo pacman -S --noconfirm --needed hw-probe
else
    echo '...'
fi

sudo -E /usr/bin/hw-probe -all -upload

echo "###############################################################################"
echo "###                DONE - YOU CAN CLOSE THIS WINDOW                        ####"
echo "###############################################################################"