Compare commits

..

10 Commits

Author SHA1 Message Date
3dc64233d5 i shouldve created a branch 2022-09-29 10:45:48 +02:00
f2c024cd51 test ohmyzsh 2022-09-27 15:37:58 +02:00
074a67e7eb test ohmyzsh 2022-09-27 15:24:20 +02:00
209f1a3cac removed python 2022-09-27 13:20:11 +02:00
a40948c75e added typescript 2022-09-27 13:17:56 +02:00
fea0297084 added typescript 2022-09-27 13:17:26 +02:00
258e3d47dc readme update 2022-09-27 13:14:31 +02:00
d7c5624bd6 loadbar update 2022-09-27 13:07:48 +02:00
59c99ff53e added must install files (files that get prioritised) 2022-09-27 13:07:33 +02:00
fb948873c6 changed readme 2022-09-27 13:06:45 +02:00
16 changed files with 126 additions and 41 deletions

View File

@@ -1,28 +1,33 @@
# Installify # Installify
Installify is a Bash shell script to download new software and applications. Installify is a Bash shell script to download new software and applications.
## Applications & Software ## Important installs
* Android Studio (TO-DO) Important installs are installs that might be needed to install other software. These installs will have a prioritisation over the rest of the files.
* Bootstrap Studio
* Chrome
* Chromium
* Defold (TO-DO)
* Discord (TO-DO)
* Docker
* Firefox
* Gcc * Gcc
* Git * Git
* Golang * Golang
* Node/NVM * Node/NVM
* NordVPN
* OBS
* Open-jdk * Open-jdk
* PHP * PHP
## Applications & Software
* ADB
* Bootstrap Studio
* Chrome
* Chromium
* Defold
* Discord (TO-DO)
* Docker
* Firefox
* Ionic
* NordVPN
* OBS
* Postman * Postman
* Python (TO-DO)
* Slack * Slack
* Spotify * Spotify
* Teams * Teams
* TypeScript
* Visual Studio Code * Visual Studio Code
* Yarn * Yarn
* Xampp (TO-DO) * Xampp (TO-DO)

View File

@@ -40,23 +40,36 @@ zsh_prompt() {
fi fi
# run option # run option
if [[ ${zshOption,,} = "n" ]]; then if [[ ${zshOption,,} = "y" ]]; then
return # Create temporary zsh file
elif [[ ${zshOption,,} = "y" ]]; then touch $homedir/.tempzshrc
sh ../applications/Oh-MY-ZSH.sh
# set up the basics of zsh
sh src/services/zsh/zsh.sh
fi fi
} }
get_files() { get_files() {
# Create temp place where files will be stored # Create temp place where files will be stored
cd src/applications cd src/importantinstalls
> ../temp/importantinstalls.txt
> ../temp/installations.txt > ../temp/installations.txt
# File info # File info
applications="" applications=""
counter=0 counter=0
for file in *; do
# Every .sh file in application folder will be noted in installations.txt
if [[ $file == *.sh ]]; then
echo "${file%.*}" >> ../temp/importantinstalls.txt
fi
done
cd ../applications
# Write every file name into installations # Write every file name into installations
for file in *; do for file in *; do
# Every .sh file in application folder will be noted in installations.txt # Every .sh file in application folder will be noted in installations.txt
@@ -80,6 +93,9 @@ select_files() {
printf %s "$YELLOW" printf %s "$YELLOW"
# Show all the options # Show all the options
echo "The following items will be installed." echo "The following items will be installed."
echo "-------------Must install-------------"
cat importantinstalls.txt
echo "--------------------------------------"
cat installations.txt cat installations.txt
printf %s "$RESET" printf %s "$RESET"
@@ -117,6 +133,9 @@ select_files() {
printf %s "$YELLOW" printf %s "$YELLOW"
echo "The following items will be installed." echo "The following items will be installed."
echo "-------------Must install-------------"
cat importantinstalls.txt
echo "--------------------------------------"
cat installations.txt cat installations.txt
echo echo
printf %s "$RESET" printf %s "$RESET"
@@ -132,6 +151,20 @@ select_files() {
install_files() { install_files() {
# Check if debug is activated # Check if debug is activated
if $debug; then if $debug; then
# Download important files
while read line; do
#Reading each line and execute file
if ! [ -x "$(command -v $line)" ]; then
sh ../importantinstalls/$line.sh
else
echo "$line is already installed"
fi
done < "importantinstalls.txt"
# Download the selected applications
while read line; do while read line; do
#Reading each line and execute file #Reading each line and execute file
@@ -148,6 +181,7 @@ install_files() {
start=1 start=1
end=100 end=100
amount="$(wc -l < installations.txt)" amount="$(wc -l < installations.txt)"
amount=$(($amount + "$(wc -l < importantinstalls.txt)"))
amount=$(($end / $amount)) amount=$(($end / $amount))
# set design # set design
@@ -155,10 +189,33 @@ install_files() {
printf %s "$YELLOW" printf %s "$YELLOW"
echo "The following items are going to be installed:" echo "The following items are going to be installed:"
cat importantinstalls.txt
cat installations.txt cat installations.txt
echo "" echo ""
printf %s "$RESET" printf %s "$RESET"
# download important files
while read line; do
printf %s "$YELLOW"
ProgressBar ${start} ${end} ${line}
#Reading each line and execute file
if ! [ -x "$(command -v $line)" ]; then
sh ../importantinstalls/$line.sh >> /dev/null 2>&1
fi
# update progressbar
reach=$(( $start + $amount ))
for number in $(seq ${start} ${reach}); do
ProgressBar ${number} ${end} ${line}
sleep 0.02
done
printf %s "$RESET"
start=$reach
done < "importantinstalls.txt"
# download selected applications
while read line; do while read line; do
printf %s "$YELLOW" printf %s "$YELLOW"
@@ -182,7 +239,9 @@ install_files() {
# Completing # Completing
if [[ $start != 100 ]]; then if [[ $start != 100 ]]; then
for number in $(seq ${start} 100); do for number in $(seq ${start} 100); do
printf %s "$YELLOW"
ProgressBar ${number} ${end} "..." ProgressBar ${number} ${end} "..."
printf %s "$RESET"
sleep 0.02 sleep 0.02
done done
fi fi
@@ -231,6 +290,14 @@ check_sudo_arguments() {
main main
} }
install_oh_my_zsh() {
# run option
if [[ ${zshOption,,} = "y" ]]; then
# Run Ohmyzsh (ends script)
sh services/zsh/Oh-My-ZSH.sh
fi
}
main() { main() {
# check if the computer has a stable connections # check if the computer has a stable connections
source ./src/services/connection.sh source ./src/services/connection.sh
@@ -264,6 +331,8 @@ main() {
cd $dir cd $dir
cd src cd src
rm temp/* rm temp/*
install_oh_my_zsh
} }
# PROGRAM BODY # PROGRAM BODY
@@ -292,6 +361,8 @@ homedir="$(getent passwd $SUDO_USER | cut -d: -f6)"
debug=false debug=false
downloadall=false downloadall=false
usezsh="" usezsh=""
echo $homedir
sleep 10
# run the program # run the program
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then

View File

@@ -1,9 +0,0 @@
# install ZSH
sudo apt install zsh -y
# Get oh my zsh and switch to zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
# recompile zsh
source ~/.zshrc

View File

@@ -0,0 +1,4 @@
# remove older versions if needed
npm uninstall -g ionic
# install ionic
npm install -g @ionic/cli

View File

@@ -6,15 +6,16 @@ sudo tar -xvf linux64 -C /usr/bin
# export postman to env table # export postman to env table
if [[ $(which zsh) == "/usr/bin/zsh" ]]; then if [[ $(which zsh) == "/usr/bin/zsh" ]]; then
echo '# Postman path' >> ~/.zshrc echo '# Postman path' >> ~/.tempzshrc
echo 'export PATH="$PATH:/usr/bin/Postman"' >> ~/.zshrc echo 'export PATH="$PATH:/usr/bin/Postman"' >> ~/.tempzshrc
source ~/.zshrc source ~/.tempzshrc
else
echo '# Postman path' >> ~/.bashrc
echo 'export PATH="$PATH:/usr/bin/Postman"' >> ~/.bashrc
source ~/.bashrc
fi fi
# always put in bashrc aswell, so that the user can always rely on the standard shell
echo '# Postman path' >> ~/.bashrc
echo 'export PATH="$PATH:/usr/bin/Postman"' >> ~/.bashrc
source ~/.bashrc
# Create file and set info # Create file and set info
touch Postman.desktop touch Postman.desktop
{ {

View File

@@ -0,0 +1 @@
npm install typescript -g

View File

@@ -3,14 +3,16 @@ wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# export nvm to env table # export nvm to env table
if [[ $(which zsh) == "/usr/bin/zsh" ]]; then if [[ $(which zsh) == "/usr/bin/zsh" ]]; then
echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"' >> ~/.zshrc echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"' >> ~/.tempzshrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.zshrc echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.tempzshrc
source ~/.zshrc source ~/.tempzshrc
else
echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"' >> ~/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc
source ~/.bashrc
fi fi
# always put in bashrc aswell, so that the user can always rely on the standard shell
echo 'export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"' >> ~/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc
source ~/.bashrc
# install latest version of node # install latest version of node
nvm install node nvm install node

View File

@@ -0,0 +1,2 @@
# Get oh my zsh, after this command the install stios, since we switched shells
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" -y

8
src/services/zsh/zsh.sh Normal file
View File

@@ -0,0 +1,8 @@
# install ZSH
sudo apt-get update
sudo apt-get install zsh -y
# Set ZSH as standard interface
chsh -s $(which zsh)
source ~/.zshrc