diff --git a/KonsaveTMPLT.knsv b/KonsaveTMPLT.knsv new file mode 100644 index 0000000..418f69b Binary files /dev/null and b/KonsaveTMPLT.knsv differ diff --git a/Linux-Setup-Script.sh b/Linux_Toolbox.sh similarity index 53% rename from Linux-Setup-Script.sh rename to Linux_Toolbox.sh index f6096da..1665883 100644 --- a/Linux-Setup-Script.sh +++ b/Linux_Toolbox.sh @@ -2,10 +2,27 @@ # paru -S plasma-wayland-session --noconfirm +Argument=$1 + +if [[ $Argument == *"update"* ]]; then + paru -Sy archlinux-keyring chaotic-keyring endeavouros-keyring --noconfirm --needed; paru -Syu --noconfirm; echo clearing out $(sudo ls /var/cache/pacman/pkg/ | wc -l) packages in cache; ( echo "y"; echo "y" ) | paru -Scc; echo "Update Complete!" + +# https://stackoverflow.com/questions/226703/how-do-i-prompt-for-yes-no-cancel-input-in-a-linux-shell-script +read -p "Do you wish to restart now? Y/N" yn + case $yn in + [Yy]* ) sudo reboot ;; + [Nn]* ) exit;; + esac +exit + +fi + + + yadResults=$(yad \ - --title="Linux Setup Script" \ - --form --columns=2 \ + --title="Linux Toolbox" \ + --form --columns=3 \ --field Installations:LBL \ --field Debloat:chk \ --field paru:chk \ @@ -15,25 +32,41 @@ yadResults=$(yad \ --field brave-bin:chk \ --field pacseek-bin:chk \ --field docker:chk \ + --field docker-compose:chk \ --field 'Install pkgs from List':chk \ --field 'Export pkgs to List':chk \ --field Configuration:LBL \ + --field "sudo Timeout:chk" \ --field "Grub Timeout:chk" \ --field Konsave:chk \ --field Flexo:chk \ + --field "Check for Flexo:chk" \ + --field "Updater to Desktop:chk" \ --field "Enable SSH:chk" \ - --field ' ':LBL \ - --field ' ':LBL \ - --field ' ':LBL \ - --field ' ':LBL \ - --field ' ':LBL ) + --field "Reboot:chk" \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL \ + --field '-':LBL ) #DRIVEPART="`echo $PARTS | cut -d "|" -f 2`" -echo $yadResults +# Print values of ALL of the above fields statuses +# echo $yadResults @@ -53,12 +86,14 @@ read -ra SECTIONS <<< "$yadResults" # str is read into an array as tokens sepa index=0 for i in "${SECTIONS[@]}"; do # access each element of array - #echo "$index" - #echo "$i" + + # print the loop index and the value of the yad field + # echo "$index" + # echo "$i" -if [[ $index -eq 0 ]] +if [[ $index -eq 1 ]] then # DEBLOAT if [[ $i == *"TRUE"* ]]; then echo "Uninstalling EOS Extras: firewalld eos-update-notifier welcome eos-quickstart" @@ -67,7 +102,7 @@ then # DEBLOAT fi -if [[ $index -eq 1 ]] +if [[ $index -eq 2 ]] then if [[ $i == *"TRUE"* ]]; then echo "Installing paru" @@ -75,7 +110,7 @@ then fi fi -if [[ $index -eq 2 ]] +if [[ $index -eq 3 ]] then if [[ $i == *"TRUE"* ]]; then echo "Installing htop" @@ -83,7 +118,7 @@ then fi fi -if [[ $index -eq 3 ]] +if [[ $index -eq 4 ]] then if [[ $i == *"TRUE"* ]]; then echo "Installing NoMachine" @@ -91,7 +126,7 @@ then fi fi -if [[ $index -eq 4 ]] +if [[ $index -eq 5 ]] then if [[ $i == *"TRUE"* ]]; then echo "Installing LibreWolf" @@ -99,7 +134,15 @@ then fi fi -if [[ $index -eq 5 ]] +if [[ $index -eq 6 ]] +then + if [[ $i == *"TRUE"* ]]; then + echo "installing brave" + paru -S brave-bin --noconfirm + fi +fi + +if [[ $index -eq 7 ]] then if [[ $i == *"TRUE"* ]]; then echo "installing pacseek" @@ -108,7 +151,7 @@ then fi -if [[ $index -eq 6 ]] +if [[ $index -eq 8 ]] then if [[ $i == *"TRUE"* ]]; then echo "Installing and enabling Docker" @@ -116,8 +159,29 @@ then fi fi +if [[ $index -eq 9 ]] +then + if [[ $i == *"TRUE"* ]]; then + echo "Installing and enabling docker-compose" + paru -S docker-compose --noconfirm + fi +fi -if [[ $index -eq 11 ]] + +if [[ $index -eq 13 ]] +then + if [[ $i == *"TRUE"* ]]; then + echo "Changing sudo timeout" + echo "Paste the following into the editor:" + echo "Defaults env_reset,timestamp_timeout=30" + sudo visudo + + fi +fi + + + +if [[ $index -eq 14 ]] then if [[ $i == *"TRUE"* ]]; then echo "Changing GRUB timeout" @@ -127,22 +191,25 @@ then fi -if [[ $index -eq 12 ]] +if [[ $index -eq 15 ]] then if [[ $i == *"TRUE"* ]]; then - echo "Installing Konsave and Importing Profile" + echo "Installing Konsave and Importing Profile to terminal user" paru -S konsave --noconfirm - cd /home/terminal/Downloads/ - smbget smb://smb/Toolbox/Installs/Linux/KonsaveTMPLT.knsv -a + cd ~/Downloads/ ; wget -q -O KonsaveTMPLT.knsv http://git.wmpco.biz/yuriy/Linux-Toolbox/raw/branch/main/KonsaveTMPLT.knsv + # smbget smb://smb/Toolbox/Installs/Linux/KonsaveTMPLT.knsv -a #konsave -i $PWD/KonsaveTMPLT.knsv -f - konsave -i /home/terminal/Downloads/KonsaveTMPLT.knsv -f - konsave -a KonsaveTMPLT + konsave -i ~/Downloads/KonsaveTMPLT.knsv -f # import template + konsave -a KonsaveTMPLT # activate template + + paru -R konsave --noconfirm # uninstall konsave # reboot fi fi -if [[ $index -eq 13 ]] + +if [[ $index -eq 16 ]] then if [[ $i == *"TRUE"* ]]; then echo "Adding Flexo to mirrorlist" @@ -150,8 +217,33 @@ then fi fi +if [[ $index -eq 17 ]] +then + if [[ $i == *"TRUE"* ]]; then -if [[ $index -eq 14 ]] + file="/etc/pacman.d/mirrorlist" + string="http://10.0.0.101:7878" + + if grep -q "$string" "$file"; then + echo "Flexo is in the mirrorlist. :)" + else + echo "FLEXO IP $string is not found in the mirrorlist file. Please consider adding it for faster updates." + fi + fi +fi + +if [[ $index -eq 18 ]] +then + if [[ $i == *"TRUE"* ]]; then + + echo "Adding Update Arch shortcut to desktop" + cd ~/Desktop/ ; wget -q -O Update_Arch.sh http://git.wmpco.biz/yuriy/Linux-Toolbox/raw/branch/main/Update_Arch_Linux.sh ; chmod +x Update_Arch.sh + + fi +fi + + +if [[ $index -eq 19 ]] then if [[ $i == *"TRUE"* ]]; then echo "Enabling SSH Access" @@ -160,7 +252,15 @@ then fi -if [[ $index -eq 15 ]] +if [[ $index -eq 20 ]] +then + if [[ $i == *"TRUE"* ]]; then + echo "Rebooting System" + reboot + fi +fi + +if [[ $index -eq 21 ]] then if [[ $i == *"TRUE"* ]]; then echo "TEMPLATE" @@ -171,7 +271,6 @@ fi - ((index++)) # Add 1 to count done diff --git a/Linux_Toolbox_v1.sh b/Linux_Toolbox_v1.sh deleted file mode 100644 index 962e2f6..0000000 --- a/Linux_Toolbox_v1.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/bash - -# paru -S plasma-wayland-session --noconfirm - - -#status = $yad --form --field check1:chk --field check2:chk --field check3:chk --field check4:chk --field ph:chk - -yadResults=$(yad --form --columns=3 --field Debloat:chk --field paru:chk --field htop:chk --field nomachine:chk --field librewolf-bin:chk --field pacseek-bin:chk --field docker:chk --field ph:chk --field ph:chk --field ph:chk --column=2 --field Config:LBL --field Grub-Timeout:chk --field Konsave:chk --field Flexo:chk --field Enable-SSH:chk --field ph:chk --field ph:chk --field ph:chk --field ph:chk --field ph:chk --field nop:chk --field:H --field:H --field:H --field:H --field:H --field:H --field:H --field nop:chk) -#DRIVEPART="`echo $PARTS | cut -d "|" -f 2`" -echo $yadResults - - - -IFS='|' # space is set as delimiter -read -ra SECTIONS <<< "$yadResults" # str is read into an array as tokens separated by IFS - - - - - -# echo "first section" -# echo "${SECTIONS[0]}" -# echo "second:" -# echo "${SECTIONS[1]}" -# echo "loop" - - -index=0 -for i in "${SECTIONS[@]}"; do # access each element of array - #echo "$index" - #echo "$i" - - - -if [[ $index -eq 0 ]] -then # DEBLOAT - if [[ $i == *"TRUE"* ]]; then - echo "Uninstalling EOS Extras" - sudo pacman -R firewalld eos-update-notifier welcome eos-quickstart --noconfirm - fi -fi - - -if [[ $index -eq 1 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Installing paru" - sudo pacman -S paru --noconfirm - fi -fi - -if [[ $index -eq 2 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Installing htop" - paru -S htop --noconfirm - fi -fi - -if [[ $index -eq 3 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Installing NoMachine" - paru -S nomachine --noconfirm - fi -fi - -if [[ $index -eq 4 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Installing LibreWolf" - paru -S librewolf-bin --noconfirm - fi -fi - -if [[ $index -eq 5 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "installing pacseek" - paru -S pacseek-bin --noconfirm - fi -fi - - -if [[ $index -eq 6 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Installing and enabling Docker" - paru -S docker --noconfirm && sudo systemctl enable docker.service && sudo systemctl enable containerd.service - fi -fi - - -if [[ $index -eq 11 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Changing GRUB timeout" - sudo nano /etc/default/grub - sudo grub-mkconfig -o /boot/grub/grub.cfg - fi -fi - - -if [[ $index -eq 12 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Installing Konsave and Importing Profile" - paru -S konsave --noconfirm - cd /home/terminal/Downloads/ - smbget smb://smb/Toolbox/Installs/Linux/KonsaveTMPLT.knsv -a - - #konsave -i $PWD/KonsaveTMPLT.knsv -f - - konsave -i /home/terminal/Downloads/KonsaveTMPLT.knsv -f - konsave -a KonsaveTMPLT - # reboot - fi -fi -if [[ $index -eq 13 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Adding Flexo to mirrorlist" - echo 'Server = http://206.210.43.222:7878/$repo/os/$arch' | sudo tee -a /etc/pacman.d/mirrorlist - fi -fi - - -if [[ $index -eq 14 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "Enabling SSH Access" - sudo systemctl enable sshd.service && sudo systemctl start sshd.service - fi -fi - - -if [[ $index -eq 15 ]] -then - if [[ $i == *"TRUE"* ]]; then - echo "TEMPLATE" - fi -fi - - - - - - - ((index++)) # Add 1 to count -done - - - -#items=`yad --list --separator='' --height=600 --multiple --column="Items" item1 item2 item3` - - -#echo $items - -# for item in $SECTIONS; do -# echo "$item" -# done - - - -#yad --title="Desktop entry editor" --text="Simple desktop entry editor" \ -#--form --field="Type:CB" --field="Name" --field="Generic name" \ -#--field="Comment" --field="Command:FL" --field="Icon" \ -#--field="In termianl:CHK" --field="Startup notify:CHK" \ -#"Application!URI" "Name" "Generic name" "This is the comment" \ -#"/usr/bin/yad" "yad" FALSE TRUE - - diff --git a/Update_Arch_Linux.sh b/Update_Arch_Linux.sh new file mode 100644 index 0000000..a7957a9 --- /dev/null +++ b/Update_Arch_Linux.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# konsole --hold -e sudo pacman -Sy archlinux-keyring chaotic-keyring endeavouros-keyring --noconfirm;paru -Syu --noconfirm;sudo pacman -Scc --noconfirm; echo "done!" + + +konsole --hold -e bash "/home/$USER/Downloads/Linux_Toolbox.sh" "update"