New is goign good nmow addin scripts

master
Kerem Yollu 2 years ago
parent f667fb2f63
commit a35313c760

@ -0,0 +1,47 @@
#!/bin/bash
COLORS_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
black='30'
red='31'
green='32'
brown='33'
blue='34'
purple='35'
cyan='36'
lightGray='37'
yellow='1;33'
lightGreen='1;32'
fontNormal='0'
fontBold='1'
fontUnderline='4'
fontBlink='5'
fontVideo='7'
colorDelimiterBegin='\e['
colorDelimiterEnd='m'
colorStop='\e[0m'
themeGreetings="$blue"
themeFocus="$fontBold"
themeInput="$cyan"
themeUserInput="$cyan"
themeSelect="$fontUnderline"
themeSuccess="$green"
themeError="$red"
themeIndication="$purple"
themeInstall="$yellow"
themeSkip="$lightGreen"
color_start()
{
local -n ref1=$1
printf $colorDelimiterBegin$ref1$colorDelimiterEnd
}
color_stop()
{
printf $colorDelimiterBegin$fontNormal$colorDelimiterEnd
printf $colorStop
}

@ -1,6 +1,7 @@
#!/bin/bash
CONFIG_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
MAIN_DIR=$PWD
os_list=(debian arch raspberry)
@ -13,17 +14,14 @@ mc \
wget \
sudo \
unzip \
dmenu \
cmake \
make \
gcc \
python3 \
pulseaudio \
pulseaudio-alsa \
alsa \
alsa-utils \
exa)
default_installs_debian=(qutebrowser)
default_installs_arch=(qutebrowser)
default_installs_raspberry=(chromium)
os_list_count=${#os_list[@]}
main_dir=$PWD
common_programs=$( IFS=$'\n'; echo "${common_programs_list[*]}" )

@ -3,55 +3,80 @@
INSTALL_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $INSTALL_SCRIPT_DIR/config.sh
source /home/key/git/linux/linuxSetup/new/programs/common.sh
echo "Script Location is : $INSTALL_SCRIPT_DIR"
source $INSTALL_SCRIPT_DIR/colors.sh
source $INSTALL_SCRIPT_DIR/programs/os_install.sh
exit_abord()
{
color_start "themeError"
echo "#############################################"
echo "# Linux instalation Script Has been aborded #"
echo "#############################################"
color_stop
}
exit_sucsess()
{
color_start "themeSuccess"
echo "###################################################"
echo "# Linux instalation Script Has ended with Sucsess #"
echo "###################################################"
color_stop
}
color_start "themeGreetings"
echo "###########################################"
echo "# Wellcome to my Linux instalation Script #"
echo "###########################################"
color_stop
echo ""
color_start "themeIndication"
echo "-------------------------------------------"
echo "The Following programms will be installed :"
echo "-------------------------------------------"
echo "$common_programs"
color_stop
color_start "themeFocus"
for i in "${!common_programs_list[@]}";
do
printf "${common_programs_list[$i]} | "
done
color_stop
echo ""
echo ""
color_start "themeInput"
echo "---------------------"
echo "Please Select your OS"
echo "---------------------"
color_stop
color_start "themeSelect"
for i in "${!os_list[@]}";
do
echo "[$(($i + 1))] ${os_list[$i]}"
done
color_stop
color_start "themeInput"
echo "---------------------"
color_stop
echo ""
color_start "themeUserInput"
read -p "Select your os or ( q to quit ) : " answer
color_stop
echo ""
if [[ "$answer" == "q" ]]; then
exit_abord
else
if [ $answer -lt $(($os_list_count + 1)) ]; then
answer=$(( $answer - 1 ))
echo "You have selected ${os_list[$answer]}"
OS=${os_list[$answer]}
common_install_"$OS"
install_"$OS"
else
echo " the given nurber was not correct >>ABORDING<<"
exit_abord

@ -1,40 +0,0 @@
#!/bin/bash
COMMON_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
common_install()
{
for i in "${!common_programs_list[@]}";
do
if ! command -v ${common_programs_list[$i]} &> /dev/null
then
echo "${common_programs_list[$i]} Will Be Installed"
echo "$1 ${common_programs_list[$i]}"
else
echo "${common_programs_list[$i]} Was found and will not be installed"
echo "$1 ${common_programs_list[$i]}"
fi
done
}
common_install_debian()
{
package_manager="sudo apt install -y "
echo "Commons are goint to be installed for $OS"
common_install "$package_manager"
}
common_install_arch()
{
package_manager="yes | sudo packman -S "
echo "Commons are goint to be installed for $OS"
common_install "$package_manager"
}
common_install_raspberry()
{
package_manager="sudo apt install -y "
echo "Commons are goint to be installed for $OS"
common_install "$package_manager"
}

@ -0,0 +1,99 @@
#!/bin/bash
COMMON_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $COMMON_SCRIPT_DIR/../colors.sh
source $COMMON_SCRIPT_DIR/../config.sh
common_install()
{
color_start "themeIndication"
echo "-----------------------------------------------------------"
echo "Common installations these programs are OS independent from"
echo "-----------------------------------------------------------"
color_stop
sleep 1
for i in "${!common_programs_list[@]}";
do
if ! command -v ${common_programs_list[$i]} &> /dev/null
then
color_start "themeInstall"
echo "--> ${common_programs_list[$i]}"
echo " |--> Will Be Installed"
echo ""
color_stop
$1 ${common_programs_list[$i]}
else
color_start "themeSkip"
echo "--> ${common_programs_list[$i]}"
echo " |--> Was found and will not be installed"
echo ""
color_stop
fi
done
}
default_install()
{
color_start "themeIndication"
echo "--------------------------------"
echo "Deffault installations for $OS"
echo "--------------------------------"
color_stop
sleep 1
table_in=default_install_$OS
for i in "${!table_in[@]}";
do
if ! command -v ${table_in[$i]} &> /dev/null
then
color_start "themeInstall"
echo "--> ${table_in[$i]}"
echo " |--> Will Be Installed"
echo ""
color_stop
$1 ${table_in[$i]}
else
color_start "themeSkip"
echo "--> ${table_in[$i]}"
echo " |--> Was found and will not be installed"
echo ""
color_stop
fi
done
}
install_debian()
{
package_manager="sudo apt install -y "
color_start "themeIndication"
echo "---------------------------------"
echo "Istallation will begin for $OS"
echo "---------------------------------"
color_stop
#common_install "$package_manager"
default_install "$package_manager"
}
install_arch()
{
package_manager="yes | sudo packman -S "
color_start "themeIndication"
echo "---------------------------------"
echo "Istallation will begin for $OS"
echo "---------------------------------"
color_stop
common_install "$package_manager"
default_install_$OS "$package_manager"
}
install_raspberry()
{
package_manager="sudo apt install -y "
color_start "themeIndication"
echo "---------------------------------"
echo "Istallation will begin for $OS"
echo "---------------------------------"
color_stop
common_install "$package_manager"
default_install_$OS "$package_manager"
}

@ -0,0 +1,12 @@
#!/bin/bash
check_installed()
{
if ! command -v $1 &> /dev/null
then
echo "$1: Is not installed"
else
echo "$1: Is installed"
fi
}
Loading…
Cancel
Save