commit
This commit is contained in:
parent
0b5907ee4f
commit
488f5714a1
|
@ -1,3 +1,5 @@
|
|||
# zsh-deploy
|
||||
|
||||
Bash script for deploying my zsh configs and zsh to a new machine
|
||||
|
||||
`curl -sL https://archuser.org/zsh.sh | bash`
|
|
@ -0,0 +1,120 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script is to install fastfetch since it isn't in many repos by default
|
||||
|
||||
# In the rare case someone decides to curl this and pipe it to bash, this script has been wrapped in a main function and executes it at the bottom
|
||||
# This is done to prevent code running before it is meant to or in an incomplete manner
|
||||
# It doesn't even work right when curled to bash anyway
|
||||
|
||||
main() {
|
||||
# Detecting the distribution
|
||||
if [ -f /etc/os-release ]; then
|
||||
source /etc/os-release
|
||||
case $ID in
|
||||
ubuntu)
|
||||
choice=1
|
||||
;;
|
||||
debian)
|
||||
if [ "$(uname -m)" == "aarch64" ]; then
|
||||
choice=3
|
||||
else
|
||||
choice=2
|
||||
fi
|
||||
;;
|
||||
archarm)
|
||||
choice=4
|
||||
;;
|
||||
arch)
|
||||
choice=4
|
||||
;;
|
||||
fedora|rhel)
|
||||
choice=5
|
||||
;;
|
||||
gentoo)
|
||||
choice=6
|
||||
;;
|
||||
alpine)
|
||||
choice=7
|
||||
;;
|
||||
nixos)
|
||||
choice=8
|
||||
;;
|
||||
opensuse*)
|
||||
choice=9
|
||||
;;
|
||||
alt)
|
||||
choice=10
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported distribution. Exiting..."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "OS release file (/etc/os-release) not found. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Use a case statement to handle the results
|
||||
case $choice in
|
||||
1)
|
||||
echo "Installing for Ubuntu"
|
||||
sudo add-apt-repository ppa:zhangsongcui3371/fastfetch
|
||||
sudo apt update
|
||||
sudo apt install -y fastfetch
|
||||
;;
|
||||
2)
|
||||
echo "Installing for Debian x86-64"
|
||||
curl -sLo ~/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-amd64.deb
|
||||
sudo dpkg -i ~/fastfetch.deb
|
||||
rm ~/fastfetch.deb
|
||||
;;
|
||||
3)
|
||||
echo "Installing for Debian ARM64"
|
||||
curl -sLo ~/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/latest/download/fastfetch-linux-aarch64.deb
|
||||
sudo dpkg -i ~/fastfetch.deb
|
||||
rm ~/fastfetch.deb
|
||||
;;
|
||||
4)
|
||||
echo "Installing for Arch"
|
||||
sudo pacman -S fastfetch
|
||||
;;
|
||||
5)
|
||||
echo "Installing for Fedora/RHEL"
|
||||
sudo dnf install fastfetch
|
||||
;;
|
||||
6)
|
||||
echo "Installing for Gentoo"
|
||||
sudo emerge --ask app-misc/fastfetch
|
||||
;;
|
||||
7)
|
||||
echo "Installing for Alpine"
|
||||
apk add --upgrade fastfetch
|
||||
;;
|
||||
8)
|
||||
echo "Installing for NixOS"
|
||||
nix-shell -p fastfetch
|
||||
;;
|
||||
9)
|
||||
echo "Installing for OpenSUSE"
|
||||
sudo zypper install fastfetch
|
||||
;;
|
||||
10)
|
||||
echo "Installing for ALT Linux"
|
||||
sudo apt-get install fastfetch
|
||||
;;
|
||||
e|E)
|
||||
echo "Exiting..."
|
||||
cd ~
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid selection. Please choose a number from 1 to 10, or 'e' to exit."
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
# Execute the main function
|
||||
main
|
19
zsh-down.sh
19
zsh-down.sh
|
@ -1,4 +1,15 @@
|
|||
curl -s -o /tmp/zsh.sh -L https://codeberg.org/firebadnofire/zsh-deploy/raw/branch/main/zsh.sh
|
||||
clear
|
||||
chmod +x /tmp/zsh.sh
|
||||
echo "run /tmp/zsh.sh"
|
||||
#!/bin/bash
|
||||
|
||||
# This script is actually meant to be fetched by curl and piped to bash therefore, this script has been wrapped in a main function and executes it at the bottom
|
||||
# This is done to prevent code running before it is meant to or in an incomplete manner
|
||||
|
||||
main() {
|
||||
curl -s -o /tmp/zsh.sh -L https://codeberg.org/firebadnofire/zsh-deploy/raw/branch/main/zsh.sh
|
||||
curl -s -o /tmp/zsh.sh -L https://codeberg.org/firebadnofire/zsh-deploy/raw/branch/main/fastfetch.sh
|
||||
clear
|
||||
chmod +x /tmp/zsh.sh
|
||||
echo "run /tmp/zsh.sh"
|
||||
}
|
||||
|
||||
# Execute the main function
|
||||
main
|
||||
|
|
180
zsh.sh
180
zsh.sh
|
@ -1,89 +1,101 @@
|
|||
#!/bin/bash
|
||||
|
||||
MAINPKGS="aria2 zip curl zsh git unzip neofetch sudo"
|
||||
MAINPKGSF="$MAINPKGS fzy"
|
||||
while true; do
|
||||
# Display the menu
|
||||
echo "Menu:"
|
||||
echo "1. Debian"
|
||||
echo "2. Arch"
|
||||
echo "3. RHEL"
|
||||
echo "4. Raspberry Pi"
|
||||
echo "5. Install Rust"
|
||||
echo "6. Install Zshrc"
|
||||
echo "e. Exit"
|
||||
# In the rare case someone decides to curl this and pipe it to bash, this script has been wrapped in a main function and executes it at the bottom
|
||||
# This is done to prevent code running before it is meant to or in an incomplete manner
|
||||
# It doesn't even work right when curled to bash anyway
|
||||
|
||||
# Prompt the user for input
|
||||
read -p "Please enter your selection: " choice
|
||||
main() {
|
||||
MAINPKGSD="aria2 zip curl zsh git unzip sudo lsb_release"
|
||||
MAINPKGSF="aria2 zip curl zsh git unzip sudo fzy lsb-release"
|
||||
while true; do
|
||||
# Display the menu
|
||||
echo "Menu:"
|
||||
echo "1. Debian"
|
||||
echo "2. Arch"
|
||||
echo "3. RHEL"
|
||||
echo "4. Raspberry Pi"
|
||||
echo "5. Install Rust"
|
||||
echo "6. Install Zshrc"
|
||||
echo "7. Install fastfetch"
|
||||
echo "e. Exit"
|
||||
|
||||
# Use a case statement to handle the user's selection
|
||||
case $choice in
|
||||
1)
|
||||
echo "You chose Debian"
|
||||
echo "installing packages"
|
||||
sudo apt install -y "$MAINPKGSF"
|
||||
echo "installing apt-fast"
|
||||
bash -c "$(curl -sL https://git.io/vokNn)"
|
||||
sudo curl -o /etc/apt-fast.conf https://archuser.org/aptf
|
||||
;;
|
||||
2)
|
||||
echo "You chose Arch"
|
||||
echo "installing packages"
|
||||
sudo pacman --noconfirm -S "$MAINPKGSF"
|
||||
echo "installing yay and pamac"
|
||||
cd /opt
|
||||
sudo git clone https://aur.archlinux.org/yay-git.git
|
||||
sudo chown -R $USER:$USER ./yay-git
|
||||
cd yay-git
|
||||
makepkg -si --noconfirm
|
||||
yay --noconfirm -s "pamac-aur"
|
||||
;;
|
||||
3)
|
||||
echo "You chose RHEL"
|
||||
echo "installing packages"
|
||||
sudo dnf install -y "$MAINPACKS https://ftp.lysator.liu.se/pub/opensuse/distribution/leap/15.5/repo/oss/x86_64/fzy-0.9-bp155.2.10.x86_64.rpm epel-release"
|
||||
;;
|
||||
4)
|
||||
echo "You chose Raspberry Pi"
|
||||
echo "installing argon-one case script"
|
||||
curl https://download.argon40.com/argon1.sh | bash
|
||||
echo "Run distro configs"
|
||||
;;
|
||||
5)
|
||||
echo "Executing rust installer:"
|
||||
curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs | sh
|
||||
;;
|
||||
6)
|
||||
echo "You chose Install Zshrc"
|
||||
echo "installing Oh-My-Zsh"
|
||||
sh -c "$(curl -L -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
echo "installing zshrc and zshrc_bpk"
|
||||
rm ~/.zshrc
|
||||
curl -L -o ~/.zshrc https://archuser.org/zshrc_remote
|
||||
curl -L -o ~/.zshrc_bpk https://live.archuser.org/zshrc
|
||||
curl -L -o ~/.cow https://archuser.org/cow
|
||||
echo "deploing keys:"
|
||||
curl -L -o ~/ssh.zip https://archuser.org/ssh.zip
|
||||
cd ~
|
||||
read -p "Enter password: " passwd
|
||||
unzip -P "$passwd" ssh.zip
|
||||
mv ssh .ssh
|
||||
sudo chmod -R 700 ~/.ssh
|
||||
mv ~/.ssh/ssh/* ~/.ssh
|
||||
rm -d ~/.ssh/ssh
|
||||
rm ssh.zip
|
||||
echo "deploying plugins"
|
||||
cd ~/.oh-my-zsh/custom/plugins
|
||||
git clone https://github.com/tom-auger/cmdtime
|
||||
;;
|
||||
# Prompt the user for input
|
||||
read -p "Please enter your selection: " choice
|
||||
|
||||
e|E)
|
||||
echo "Exiting..."
|
||||
cd ~
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid selection. Please choose a number from 1 to 6, or 'e' to exit."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# Use a case statement to handle the user's selection
|
||||
case $choice in
|
||||
1)
|
||||
echo "You chose Debian"
|
||||
echo "installing packages"
|
||||
sudo apt install -y "$MAINPKGSF"
|
||||
echo "installing apt-fast"
|
||||
bash -c "$(curl -sL https://git.io/vokNn)"
|
||||
sudo curl -o /etc/apt-fast.conf https://archuser.org/aptf
|
||||
;;
|
||||
2)
|
||||
echo "You chose Arch"
|
||||
echo "installing packages"
|
||||
sudo pacman --noconfirm -S "$MAINPKGSF"
|
||||
echo "installing yay and pamac"
|
||||
cd /opt
|
||||
sudo git clone https://aur.archlinux.org/yay-git.git
|
||||
sudo chown -R $USER:$USER ./yay-git
|
||||
cd yay-git
|
||||
makepkg -si --noconfirm
|
||||
yay --noconfirm -s "pamac-aur"
|
||||
;;
|
||||
3)
|
||||
echo "You chose RHEL"
|
||||
echo "installing packages"
|
||||
sudo dnf install -y "$MAINPKGSD https://ftp.lysator.liu.se/pub/opensuse/distribution/leap/15.5/repo/oss/x86_64/fzy-0.9-bp155.2.10.x86_64.rpm epel-release"
|
||||
;;
|
||||
4)
|
||||
echo "You chose Raspberry Pi"
|
||||
echo "installing argon-one case script"
|
||||
curl https://download.argon40.com/argon1.sh | bash
|
||||
echo "Run distro configs"
|
||||
;;
|
||||
5)
|
||||
echo "Executing rust installer:"
|
||||
curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs | sh
|
||||
;;
|
||||
6)
|
||||
echo "You chose Install Zshrc"
|
||||
echo "installing Oh-My-Zsh"
|
||||
sh -c "$(curl -L -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
echo "installing zshrc and zshrc_bpk"
|
||||
rm ~/.zshrc
|
||||
curl -L -o ~/.zshrc https://archuser.org/zshrc_remote
|
||||
curl -L -o ~/.zshrc_bpk https://live.archuser.org/zshrc
|
||||
curl -L -o ~/.cow https://archuser.org/cow
|
||||
echo "deploing keys:"
|
||||
curl -L -o ~/ssh.zip https://archuser.org/ssh.zip
|
||||
cd ~
|
||||
read -p "Enter password: " passwd
|
||||
unzip -P "$passwd" ssh.zip
|
||||
mv ssh .ssh
|
||||
sudo chmod -R 700 ~/.ssh
|
||||
mv ~/.ssh/ssh/* ~/.ssh
|
||||
rm -d ~/.ssh/ssh
|
||||
rm ssh.zip
|
||||
echo "deploying plugins"
|
||||
cd ~/.oh-my-zsh/custom/plugins
|
||||
git clone https://github.com/tom-auger/cmdtime
|
||||
;;
|
||||
7)
|
||||
/tmp/fastfetch.sh
|
||||
;;
|
||||
e|E)
|
||||
echo "Exiting..."
|
||||
cd ~
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid selection. Please choose a number from 1 to 6, or 'e' to exit."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Execute the main function
|
||||
main
|
||||
|
|
Loading…
Reference in New Issue