Add files via upload
This commit is contained in:
122
install-scripts/00-hypr-pkgs.sh
Normal file
122
install-scripts/00-hypr-pkgs.sh
Normal file
@@ -0,0 +1,122 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://github.com/JaKooLit
|
||||
|
||||
# edit your packages desired here.
|
||||
# WARNING! If you remove packages here, dotfiles may not work properly.
|
||||
# and also, ensure that packages are present in AUR and official Arch Repo
|
||||
|
||||
# add packages wanted here
|
||||
Extra=(
|
||||
|
||||
)
|
||||
|
||||
hypr_package=(
|
||||
cliphist
|
||||
dunst
|
||||
foot
|
||||
grim
|
||||
gvfs
|
||||
gvfs-mtp
|
||||
jq
|
||||
network-manager-applet
|
||||
pamixer
|
||||
pavucontrol
|
||||
pipewire-alsa
|
||||
playerctl
|
||||
polkit-kde-agent
|
||||
python-requests
|
||||
qt5ct
|
||||
slurp
|
||||
swappy
|
||||
swayidle
|
||||
swaylock-effects
|
||||
swww
|
||||
waybar
|
||||
wget
|
||||
wl-clipboard
|
||||
wofi
|
||||
xdg-user-dirs
|
||||
)
|
||||
|
||||
# the following packages can be deleted. however, dotfiles may not work properly
|
||||
hypr_package_2=(
|
||||
brightnessctl
|
||||
btop
|
||||
cava
|
||||
ffmpegthumbs
|
||||
gnome-system-monitor
|
||||
mousepad
|
||||
mpv
|
||||
nvtop
|
||||
nwg-look-bin
|
||||
swaybg
|
||||
viewnior
|
||||
vim
|
||||
wlsunset
|
||||
)
|
||||
|
||||
fonts=(
|
||||
adobe-source-code-pro-fonts
|
||||
noto-fonts-emoji
|
||||
otf-font-awesome
|
||||
otf-font-awesome-4
|
||||
ttf-droid
|
||||
ttf-fira-code
|
||||
ttf-jetbrains-mono
|
||||
ttf-jetbrains-mono-nerd
|
||||
)
|
||||
|
||||
|
||||
############## WARNING DO NOT EDIT BEYOND THIS LINE if you dont know what you are doing! ######################################
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_hypr-pkgs.log"
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Installation of main components
|
||||
printf "\n%s - Installing hyprland packages.... \n" "${NOTE}"
|
||||
|
||||
for PKG1 in "${hypr_package[@]}" "${hypr_package_2[@]}" "${fonts[@]}" "${Extra[@]}"; do
|
||||
install_package "$PKG1" 2>&1 | tee -a "$LOG"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\e[1A\e[K${ERROR} - $PKG1 install had failed, please check the install.log"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
clear
|
||||
58
install-scripts/bluetooth.sh
Normal file
58
install-scripts/bluetooth.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
blue=(
|
||||
bluez
|
||||
bluez-utils
|
||||
blueman
|
||||
)
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_bluetooth.log"
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Bluetooth
|
||||
|
||||
printf "${NOTE} Installing Bluetooth Packages...\n"
|
||||
for BLUE in "${blue[@]}"; do
|
||||
install_package "$BLUE" 2>&1 | tee -a "$LOG"
|
||||
[ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $BLUE install had failed, please check the install.log"; exit 1; }
|
||||
done
|
||||
|
||||
printf " Activating Bluetooth Services...\n"
|
||||
sudo systemctl enable --now bluetooth.service 2>&1 | tee -a "$LOG"
|
||||
|
||||
clear
|
||||
25
install-scripts/dotfiles.sh
Normal file
25
install-scripts/dotfiles.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +'%d-%H%M%S')_dots.log"
|
||||
|
||||
printf "${NOTE} Downloading Hyprland dots...\n"
|
||||
|
||||
if git clone https://github.com/JaKooLit/Hyprland-Dots.git; then
|
||||
cd Hyprland-Dots || exit 1
|
||||
chmod +x copy.sh
|
||||
./copy.sh 2>&1 | tee -a "$LOG"
|
||||
else
|
||||
echo -e "${ERROR} Cant download Hyprland-Dots" 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
|
||||
106
install-scripts/gtk_themes.sh
Normal file
106
install-scripts/gtk_themes.sh
Normal file
@@ -0,0 +1,106 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Determine the directory where the script is located
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Change the working directory to the parent directory of the script
|
||||
PARENT_DIR="$SCRIPT_DIR/.."
|
||||
cd "$PARENT_DIR" || exit 1
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_themes.log"
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_themes.log"
|
||||
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Themes and cursors
|
||||
printf "\n${NOTE} INSTALLING GTK THEMES \n"
|
||||
while true; do
|
||||
read -rp "${CAT} Which GTK Theme and Cursors to install? Catppuccin or Tokyo Theme? Enter 'c' or 't': " choice
|
||||
case "$choice" in
|
||||
c|C)
|
||||
printf "${NOTE} Installing Catpuccin Theme packages...\n"
|
||||
for THEME1 in catppuccin-gtk-theme-mocha catppuccin-gtk-theme-latte catppuccin-cursors-mocha; do
|
||||
install_package "$THEME1" 2>&1 | tee -a "$LOG"
|
||||
[ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $THEME1 install had failed, please check the install.log"; exit 1; }
|
||||
done
|
||||
# Shiny-Dark-Icons-themes
|
||||
mkdir -p ~/.icons
|
||||
cd assets
|
||||
tar -xf Shiny-Dark-Icons.tar.gz -C ~/.icons
|
||||
tar -xf Shiny-Light-Icons.tar.gz -C ~/.icons
|
||||
cd ..
|
||||
sed -i '9,12s/#//' config/hypr/scripts/DarkLight.sh
|
||||
sed -i '9,12s/#//' config/hypr/scripts/DarkLight-swaybg.sh
|
||||
sed -i '31s/#//' config/hypr/configs/Settings.conf
|
||||
cp -f 'config/hypr/waybar/style/dark-styles/style-dark-cat.css' 'config/hypr/waybar/style/style-dark.css'
|
||||
break
|
||||
;;
|
||||
t|T)
|
||||
printf "${NOTE} Installing Tokyo Theme packages...\n"
|
||||
wget https://github.com/ljmill/tokyo-night-icons/releases/download/v0.2.0/TokyoNight-SE.tar.bz2
|
||||
mkdir -p ~/.icons
|
||||
tar -xvjf TokyoNight-SE.tar.bz2 -C ~/.icons
|
||||
mkdir -p ~/.themes
|
||||
cp -r -f assets/tokyo-themes/* ~/.themes/
|
||||
sed -i '15,18s/#//' config/hypr/scripts/DarkLight.sh
|
||||
sed -i '15,18s/#//' config/hypr/scripts/DarkLight-swaybg.sh
|
||||
sed -i '32s/#//' config/hypr/configs/Settings.conf
|
||||
cp -f 'config/hypr/waybar/style/dark-styles/style-dark-tokyo.css' 'config/hypr/waybar/style/style-dark.css'
|
||||
break
|
||||
;;
|
||||
*)
|
||||
printf "%s - Invalid choice. Please enter 'c' or 't'\n" "${ERROR}"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
clear
|
||||
53
install-scripts/hyprland.sh
Normal file
53
install-scripts/hyprland.sh
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
hypr=(
|
||||
hyprland
|
||||
)
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_hyprland.log"
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Hyprland
|
||||
|
||||
printf "${NOTE} Installing Hyprland Packages...\n"
|
||||
for HYPR in "${hypr[@]}"; do
|
||||
install_package "$HYPR" 2>&1 | tee -a "$LOG"
|
||||
[ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $HYPR install had failed, please check the install.log"; exit 1; }
|
||||
done
|
||||
|
||||
clear
|
||||
141
install-scripts/nvidia.sh
Normal file
141
install-scripts/nvidia.sh
Normal file
@@ -0,0 +1,141 @@
|
||||
#!/bin/bash
|
||||
|
||||
nvidia_pkg=(
|
||||
nvidia-dkms
|
||||
nvidia-settings
|
||||
nvidia-utils
|
||||
libva
|
||||
libva-nvidia-driver-git
|
||||
)
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_nvidia.log"
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry, I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# nvidia stuff
|
||||
printf "${YELLOW}Installing Nvidia Hyprland...${RESET}\n"
|
||||
if pacman -Qs hyprland > /dev/null; then
|
||||
read -n1 -rp "${CAT} Hyprland detected. Would you like to remove and install hyprland-nvidia instead? (y/n) " nvidia_hypr
|
||||
echo
|
||||
if [[ $nvidia_hypr =~ ^[Yy]$ ]]; then
|
||||
for hyprnvi in hyprland hyprland-nvidia hyprland-nvidia-hidpi-git; do
|
||||
sudo pacman -R --noconfirm "$hyprnvi" 2>/dev/null | tee -a "$LOG" || true
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# install hyprland-nvidia-git
|
||||
install_package "hyprland-nvidia-git" 2>&1 | tee -a "$LOG"
|
||||
|
||||
# Install additional Nvidia packages
|
||||
printf "${YELLOW} Installing Nvidia packages...\n"
|
||||
for krnl in $(cat /usr/lib/modules/*/pkgbase); do
|
||||
for NVIDIA in "${krnl}-headers" "${nvidia_pkg[@]}"; do
|
||||
install_package "$NVIDIA" 2>&1 | tee -a "$LOG"
|
||||
done
|
||||
done
|
||||
|
||||
# Check if the Nvidia modules are already added in mkinitcpio.conf and add if not
|
||||
if grep -qE '^MODULES=.*nvidia. *nvidia_modeset.*nvidia_uvm.*nvidia_drm' /etc/mkinitcpio.conf; then
|
||||
echo "Nvidia modules already included in /etc/mkinitcpio.conf" 2>&1 | tee -a "$LOG"
|
||||
else
|
||||
sudo sed -Ei 's/^(MODULES=\([^\)]*)\)/\1 nvidia nvidia_modeset nvidia_uvm nvidia_drm)/' /etc/mkinitcpio.conf 2>&1 | tee -a "$LOG"
|
||||
echo "Nvidia modules added in /etc/mkinitcpio.conf"
|
||||
fi
|
||||
|
||||
sudo mkinitcpio -P 2>&1 | tee -a "$LOG"
|
||||
printf "\n"
|
||||
printf "\n"
|
||||
printf "\n"
|
||||
|
||||
# Preparing exec.conf to enable env = WLR_NO_HARDWARE_CURSORS,1 so it will be ready once config files copied
|
||||
sed -i '21s/#//' config/hypr/configs/ENVariables.conf
|
||||
|
||||
# Additional Nvidia steps
|
||||
NVEA="/etc/modprobe.d/nvidia.conf"
|
||||
if [ -f "$NVEA" ]; then
|
||||
printf "${OK} Seems like nvidia-drm modeset=1 is already added in your system..moving on.\n"
|
||||
printf "\n"
|
||||
else
|
||||
printf "\n"
|
||||
printf "${YELLOW} Adding options to $NVEA..."
|
||||
sudo echo -e "options nvidia-drm modeset=1" | sudo tee -a /etc/modprobe.d/nvidia.conf 2>&1 | tee -a "$LOG"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
# additional for GRUB users
|
||||
# Check if /etc/default/grub exists
|
||||
if [ -f /etc/default/grub ]; then
|
||||
# Check if nvidia_drm.modeset=1 is already present
|
||||
if ! sudo grep -q "nvidia-drm.modeset=1" /etc/default/grub; then
|
||||
# Add nvidia_drm.modeset=1 to GRUB_CMDLINE_LINUX_DEFAULT
|
||||
sudo sed -i 's/\(GRUB_CMDLINE_LINUX_DEFAULT=".*\)"/\1 nvidia-drm.modeset=1"/' /etc/default/grub
|
||||
# Regenerate GRUB configuration
|
||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||
echo "nvidia-drm.modeset=1 added to /etc/default/grub"
|
||||
else
|
||||
echo "nvidia-drm.modeset=1 is already present in /etc/default/grub"
|
||||
fi
|
||||
else
|
||||
echo "/etc/default/grub does not exist"
|
||||
fi
|
||||
|
||||
# Blacklist nouveau
|
||||
read -n1 -rep "${CAT} Would you like to blacklist nouveau? (y/n)" response
|
||||
echo
|
||||
if [[ $response =~ ^[Yy]$ ]]; then
|
||||
NOUVEAU="/etc/modprobe.d/nouveau.conf"
|
||||
if [ -f "$NOUVEAU" ]; then
|
||||
printf "${OK} Seems like nouveau is already blacklisted..moving on.\n"
|
||||
else
|
||||
printf "\n"
|
||||
echo "blacklist nouveau" | sudo tee -a "$NOUVEAU" 2>&1 | tee -a "$LOG"
|
||||
printf "${NOTE} has been added to $NOUVEAU.\n"
|
||||
printf "\n"
|
||||
|
||||
# To completely blacklist nouveau (See wiki.archlinux.org/title/Kernel_module#Blacklisting 6.1)
|
||||
if [ -f "/etc/modprobe.d/blacklist.conf" ]; then
|
||||
echo "install nouveau /bin/true" | sudo tee -a "/etc/modprobe.d/blacklist.conf" 2>&1 | tee -a "$LOG"
|
||||
else
|
||||
echo "install nouveau /bin/true" | sudo tee "/etc/modprobe.d/blacklist.conf" 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
printf "${NOTE} Skipping nouveau blacklisting.\n"
|
||||
fi
|
||||
|
||||
clear
|
||||
35
install-scripts/paru.sh
Normal file
35
install-scripts/paru.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_paru.log"
|
||||
|
||||
# Check for AUR helper and install if not found
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
if [ -n "$ISAUR" ]; then
|
||||
printf "\n%s - AUR helper was located, moving on.\n" "${OK}"
|
||||
else
|
||||
printf "\n%s - AUR helper was NOT located\n" "$WARN"
|
||||
printf "\n%s - Installing paru from AUR\n" "${NOTE}"
|
||||
git clone https://aur.archlinux.org/paru-bin.git || { printf "%s - Failed to clone paru from AUR\n" "${ERROR}"; exit 1; }
|
||||
cd paru-bin || { printf "%s - Failed to enter paru-bin directory\n" "${ERROR}"; exit 1; }
|
||||
makepkg -si --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to install paru from AUR\n" "${ERROR}"; exit 1; }
|
||||
fi
|
||||
|
||||
# Update system before proceeding
|
||||
printf "\n%s - Performing a full system update to avoid issues.... \n" "${NOTE}"
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
$ISAUR -Syu --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to update system\n" "${ERROR}"; exit 1; }
|
||||
|
||||
clear
|
||||
62
install-scripts/rog.sh
Normal file
62
install-scripts/rog.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Determine the directory where the script is located
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Change the working directory to the parent directory of the script
|
||||
PARENT_DIR="$SCRIPT_DIR/.."
|
||||
cd "$PARENT_DIR" || exit 1
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_rog.log"
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
### Install software for Asus ROG laptops ###
|
||||
|
||||
printf " Installing ASUS ROG packages...\n"
|
||||
for ASUS in asusctl supergfxctl rog-control-center; do
|
||||
install_package "$ASUS" 2>&1 | tee -a "$LOG"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\e[1A\e[K${ERROR} - $ASUS install had failed, please check the install.log"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
printf " Activating ROG services...\n"
|
||||
sudo systemctl enable --now supergfxd 2>&1 | tee -a "$LOG"
|
||||
sed -i '20s/#//' config/hypr/configs/Execs.conf
|
||||
|
||||
clear
|
||||
119
install-scripts/sddm.sh
Normal file
119
install-scripts/sddm.sh
Normal file
@@ -0,0 +1,119 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Determine the directory where the script is located
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Change the working directory to the parent directory of the script
|
||||
PARENT_DIR="$SCRIPT_DIR/.."
|
||||
cd "$PARENT_DIR" || exit 1
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_sddm.log"
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# SDDM
|
||||
|
||||
# Check if SDDM is already installed
|
||||
if pacman -Qs sddm > /dev/null; then
|
||||
# Prompt user to manually install sddm-git to remove SDDM
|
||||
read -n1 -rep "SDDM is already installed. Would you like to manually install sddm-git to remove it? This requires manual intervention. (y/n)" manual_install_sddm
|
||||
echo
|
||||
if [[ $manual_install_sddm =~ ^[Yy]$ ]]; then
|
||||
$ISAUR -S sddm-git 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install SDDM and Catppuccin theme
|
||||
printf "${NOTE} Installing SDDM-git........\n"
|
||||
for package in sddm-git; do
|
||||
install_package "$package" 2>&1 | tee -a "$LOG"
|
||||
[ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $package install has failed, please check the install.log"; exit 1; }
|
||||
done
|
||||
|
||||
# Check if other login managers installed and disabling its service before enabling sddm
|
||||
for login_manager in lightdm gdm lxdm lxdm-gtk3; do
|
||||
if pacman -Qs "$login_manager" > /dev/null; then
|
||||
echo "disabling $login_manager..."
|
||||
sudo systemctl disable "$login_manager.service" 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
done
|
||||
|
||||
printf " Activating sddm service........\n"
|
||||
sudo systemctl enable sddm
|
||||
|
||||
# Set up SDDM
|
||||
echo -e "${NOTE} Setting up the login screen."
|
||||
sddm_conf_dir=/etc/sddm.conf.d
|
||||
[ ! -d "$sddm_conf_dir" ] && { printf "$CAT - $sddm_conf_dir not found, creating...\n"; sudo mkdir "$sddm_conf_dir" 2>&1 | tee -a "$LOG"; }
|
||||
|
||||
wayland_sessions_dir=/usr/share/wayland-sessions
|
||||
[ ! -d "$wayland_sessions_dir" ] && { printf "$CAT - $wayland_sessions_dir not found, creating...\n"; sudo mkdir "$wayland_sessions_dir" 2>&1 | tee -a "$LOG"; }
|
||||
sudo cp assets/hyprland.desktop "$wayland_sessions_dir/" 2>&1 | tee -a "$LOG"
|
||||
|
||||
# SDDM-themes
|
||||
read -n1 -rep "${CAT} OPTIONAL - Would you like to install SDDM themes? (y/n)" install_sddm_theme
|
||||
if [[ $install_sddm_theme =~ ^[Yy]$ ]]; then
|
||||
while true; do
|
||||
read -rp "${CAT} Which SDDM Theme you want to install? Catpuccin or Tokyo Night 'c' or 't': " choice
|
||||
case "$choice" in
|
||||
c|C)
|
||||
printf "\n%s - Installing Catpuccin SDDM Theme\n" "${NOTE}"
|
||||
for sddm_theme in sddm-catppuccin-git; do
|
||||
install_package "$sddm_theme" 2>&1 | tee -a "$LOG"
|
||||
[ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $sddm_theme install has failed, please check the install.log"; }
|
||||
done
|
||||
echo -e "[Theme]\nCurrent=catppuccin" | sudo tee -a "$sddm_conf_dir/10-theme.conf" 2>&1 | tee -a "$LOG"
|
||||
break
|
||||
;;
|
||||
t|T)
|
||||
printf "\n%s - Installing Tokyo SDDM Theme\n" "${NOTE}"
|
||||
for sddm_theme in sddm-theme-tokyo-night; do
|
||||
install_package "$sddm_theme" 2>&1 | tee -a "$LOG"
|
||||
[ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $sddm_theme install has failed, please check the install.log"; }
|
||||
done
|
||||
echo -e "[Theme]\nCurrent=tokyo-night-sddm" | sudo tee -a "$sddm_conf_dir/10-theme.conf" 2>&1 | tee -a "$LOG"
|
||||
break
|
||||
;;
|
||||
*)
|
||||
printf "%s - Invalid choice. Please enter 'c' or 't'\n" "${ERROR}"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
clear
|
||||
77
install-scripts/thunar.sh
Normal file
77
install-scripts/thunar.sh
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
thunar=(
|
||||
thunar
|
||||
thunar-volman
|
||||
tumbler
|
||||
thunar-archive-plugin
|
||||
)
|
||||
|
||||
|
||||
# Determine the directory where the script is located
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Change the working directory to the parent directory of the script
|
||||
PARENT_DIR="$SCRIPT_DIR/.."
|
||||
cd "$PARENT_DIR" || exit 1
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_thunar.log"
|
||||
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Bluetooth
|
||||
|
||||
printf "${NOTE} Installing Thunar Packages...\n"
|
||||
for THUNAR in "${thunar[@]}"; do
|
||||
install_package "$THUNAR" 2>&1 | tee -a "$LOG"
|
||||
[ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $THUNAR install had failed, please check the install.log"; exit 1; }
|
||||
done
|
||||
|
||||
# Check for existing config folders and backup
|
||||
for DIR1 in Thunar xfce4; do
|
||||
DIRPATH=~/.config/$DIR1
|
||||
if [ -d "$DIRPATH" ]; then
|
||||
echo -e "${NOTE} Config for $DIR1 found, backing up."
|
||||
mv $DIRPATH $DIRPATH-back-up 2>&1 | tee -a "$LOG"
|
||||
echo -e "${NOTE} Backed up $DIR1 to $DIRPATH-back-up."
|
||||
fi
|
||||
done
|
||||
cp -r config/xfce4 ~/.config/ && { echo "Copy xfce4 completed!"; } || { echo "Error: Failed to copy xfce4 config files."; exit 1; } 2>&1 | tee -a "$LOG"
|
||||
cp -r config/Thunar ~/.config/ && { echo "Copy Thunar completed!"; } || { echo "Error: Failed to copy Thunar config files."; exit 1; } 2>&1 | tee -a "$LOG"
|
||||
|
||||
clear
|
||||
79
install-scripts/xdph.sh
Normal file
79
install-scripts/xdph.sh
Normal file
@@ -0,0 +1,79 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_xdph.log"
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# XDG-DESKTOP-PORTAL-HYPRLAND
|
||||
|
||||
for xdph in xdg-desktop-portal-hyprland; do
|
||||
install_package "$xdph" 2>&1 | tee -a "$LOG"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\e[1A\e[K${ERROR} - $xdph install had failed, please check the install.log"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
printf "${NOTE} Checking for other XDG-Desktop-Portal-Implementations....\n"
|
||||
sleep 1
|
||||
printf "\n"
|
||||
printf "${NOTE} XDG-desktop-portal-KDE (if installed) should be manually disabled or removed! I can't remove it... sorry...\n"
|
||||
read -n1 -rep "${CAT} Would you like me to try to remove other XDG-Desktop-Portal-Implementations? (y/n)" XDPH1
|
||||
sleep 1
|
||||
if [[ $XDPH1 =~ ^[Yy]$ ]]; then
|
||||
# Clean out other portals
|
||||
printf "${NOTE} Clearing any other xdg-desktop-portal implementations...\n"
|
||||
# Check if packages are installed and uninstall if present
|
||||
if pacman -Qs xdg-desktop-portal-gnome > /dev/null ; then
|
||||
echo "Removing xdg-desktop-portal-gnome..."
|
||||
sudo pacman -R --noconfirm xdg-desktop-portal-gnome 2>&1 | tee -a $LOG
|
||||
fi
|
||||
if pacman -Qs xdg-desktop-portal-gtk > /dev/null ; then
|
||||
echo "Removing xdg-desktop-portal-gtk..."
|
||||
sudo pacman -R --noconfirm xdg-desktop-portal-gtk 2>&1 | tee -a $LOG
|
||||
fi
|
||||
if pacman -Qs xdg-desktop-portal-wlr > /dev/null ; then
|
||||
echo "Removing xdg-desktop-portal-wlr..."
|
||||
sudo pacman -R --noconfirm xdg-desktop-portal-wlr 2>&1 | tee -a $LOG
|
||||
fi
|
||||
if pacman -Qs xdg-desktop-portal-lxqt > /dev/null ; then
|
||||
echo "Removing xdg-desktop-portal-lxqt..."
|
||||
sudo pacman -R --noconfirm xdg-desktop-portal-lxqt 2>&1 | tee -a $LOG
|
||||
fi
|
||||
fi
|
||||
|
||||
clear
|
||||
35
install-scripts/yay.sh
Normal file
35
install-scripts/yay.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_yay.log"
|
||||
|
||||
# Check for AUR helper and install if not found
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
if [ -n "$ISAUR" ]; then
|
||||
printf "\n%s - AUR helper yay was located, moving on.\n" "${OK}"
|
||||
else
|
||||
printf "\n%s - AUR helper was NOT located\n" "$WARN"
|
||||
printf "\n%s - Installing yay from AUR\n" "${NOTE}"
|
||||
git clone https://aur.archlinux.org/yay-bin.git || { printf "%s - Failed to clone yay from AUR\n" "${ERROR}"; exit 1; }
|
||||
cd yay-bin || { printf "%s - Failed to enter yay-bin directory\n" "${ERROR}"; exit 1; }
|
||||
makepkg -si --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to install yay from AUR\n" "${ERROR}"; exit 1; }
|
||||
fi
|
||||
|
||||
# Update system before proceeding
|
||||
printf "\n%s - Performing a full system update to avoid issues.... \n" "${NOTE}"
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
$ISAUR -Syu --noconfirm 2>&1 | tee -a "$LOG" || { printf "%s - Failed to update system\n" "${ERROR}"; exit 1; }
|
||||
|
||||
clear
|
||||
68
install-scripts/zsh.sh
Normal file
68
install-scripts/zsh.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set some colors for output messages
|
||||
OK="$(tput setaf 2)[OK]$(tput sgr0)"
|
||||
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
|
||||
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
|
||||
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
|
||||
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
|
||||
ORANGE=$(tput setaf 166)
|
||||
YELLOW=$(tput setaf 3)
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
LOG="install-$(date +%d-%H%M%S)_zsh.log"
|
||||
|
||||
ISAUR=$(command -v yay || command -v paru)
|
||||
|
||||
# Set the script to exit on error
|
||||
set -e
|
||||
|
||||
# Function for installing packages
|
||||
install_package() {
|
||||
# Checking if package is already installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "${OK} $1 is already installed. Skipping..."
|
||||
else
|
||||
# Package not installed
|
||||
echo -e "${NOTE} Installing $1 ..."
|
||||
$ISAUR -S --noconfirm "$1" 2>&1 | tee -a "$LOG"
|
||||
# Making sure package is installed
|
||||
if $ISAUR -Q "$1" &>> /dev/null ; then
|
||||
echo -e "\e[1A\e[K${OK} $1 was installed."
|
||||
else
|
||||
# Something is missing, exiting to review log
|
||||
echo -e "\e[1A\e[K${ERROR} $1 failed to install :( , please check the install.log. You may need to install manually! Sorry I have tried :("
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
# zsh and oh-my-zsh
|
||||
printf "${WARN} #### IF YOU HAVE ALREADY ZSH AND OH MY ZSH, YOU SHOULD CHOOSE NO HERE #########\n"
|
||||
printf "${WARN} ### --------------------------------------------------------------------########\n"
|
||||
printf "${NOTE} ## CHECK OUT README FOR ADDITIONAL STEPS REQUIRED ONCE ZSH AND OH-MY-ZSH INSTALLED ##\n"
|
||||
printf "\n"
|
||||
printf "\n"
|
||||
read -n1 -rep "${CAT} OPTIONAL - Would you like to install zsh and oh-my-zsh and use as default shell? (y/n)" zsh
|
||||
echo
|
||||
|
||||
if [[ $zsh =~ ^[Yy]$ ]]; then
|
||||
for ZSH in zsh zsh-completions; do
|
||||
install_package "$ZSH" 2>&1 | tee -a "$LOG"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\e[1A\e[K${ERROR} - $ZSH install had failed, please check the install.log"
|
||||
fi
|
||||
done
|
||||
|
||||
# Oh-my-zsh plus zsh-autosuggestions and zsh-syntax-highlighting
|
||||
printf "${NOTE} Installing oh-my-zsh and plugins.\n"
|
||||
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended && \
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \
|
||||
cp -r 'assets/.zshrc' ~/
|
||||
print_success "ZSH and oh-my-zsh installed."
|
||||
else
|
||||
printf "${NOTE} ZSH wont be installed.\n"
|
||||
fi
|
||||
|
||||
clear
|
||||
Reference in New Issue
Block a user