feat(preset):add preset for quick installlation

check var exist before ask

remove var

add preset file

add a question to check should use preset

patch custom question

fix blacklist nouveau name not clear

fix input group var not clear

fix pokemon var not clear

add comment for preset var

use preset env var before excute script

add preset to script

print preset info
This commit is contained in:
PostCyberPunk
2024-01-04 20:28:31 +08:00
parent 9c80e88985
commit 33f538966f
8 changed files with 116 additions and 25 deletions

View File

@@ -2,6 +2,9 @@
# 💫 https://github.com/JaKooLit 💫 #
# Adding users into input group #
if [[ $USE_PRESET = [Yy] ]]; then
source ./preset.sh
fi
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
# Determine the directory where the script is located
@@ -20,9 +23,11 @@ while true; do
echo "${WARN} This script will add or remove your user from the 'input' group."
echo "${NOTE} Please note that adding yourself to the 'input' group might be necessary for waybar keyboard-state functionality."
read -p "${YELLOW}Do you want to proceed? (y/n): ${RESET}" choice
if [[ -z $input_group_choid ]]; then
read -p "${YELLOW}Do you want to proceed? (y/n): ${RESET}" input_group_choid
fi
if [[ $choice == "y" || $choice == "Y" ]]; then
if [[ $input_group_choid == "y" || $input_group_choid == "Y" ]]; then
# Check if the 'input' group exists
if grep -q '^input:' /etc/group; then
echo "${OK} 'input' group exists."
@@ -41,7 +46,7 @@ while true; do
# Log the addition of the user to the 'input' group
echo "User added to 'input' group" >> "$LOG"
break # Break out of the loop if 'yes' is chosen
elif [[ $choice == "n" || $choice == "N" ]]; then
elif [[ $input_group_choid == "n" || $input_group_choid == "N" ]]; then
echo "${NOTE} No changes made. Exiting the script."
break # Break out of the loop if 'no' is chosen
else
@@ -49,4 +54,4 @@ while true; do
fi
done
clear
clear

View File

@@ -1,6 +1,9 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# Hyprland-Dots to download from Releases #
if [[ $USE_PRESET = [Yy] ]]; then
source ./preset.sh
fi
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
@@ -28,7 +31,9 @@ if [ -f Hyprland-Dots.tar.gz ]; then
exit 0
else
echo -e "${WARN} Hyprland-Dots.tar.gz is outdated (Existing version: $existing_version, Latest version: $latest_version)."
read -p "Do you want to upgrade to the latest version? (y/n): " upgrade_choice
if [[ -z $upgrade_choice ]]; then
read -p "Do you want to upgrade to the latest version? (y/n): " upgrade_choice
fi
if [ "$upgrade_choice" = "y" ]; then
echo -e "${NOTE} Proceeding to download the latest release." 2>&1 | tee -a "../Install-Logs/install-$(date +'%d-%H%M%S')_dotfiles.log"

View File

@@ -1,6 +1,9 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# Nvidia Stuffs #
if [[ $USE_PRESET = [Yy] ]]; then
source ./preset.sh
fi
nvidia_pkg=(
nvidia-dkms
@@ -93,9 +96,11 @@ else
fi
# Blacklist nouveau
read -n1 -rep "${CAT} Would you like to blacklist nouveau? (y/n)" response
if [[ -z $blacklist_nouveau ]]; then
read -n1 -rep "${CAT} Would you like to blacklist nouveau? (y/n)" blacklist_nouveau
fi
echo
if [[ $response =~ ^[Yy]$ ]]; then
if [[ $blacklist_nouveau =~ ^[Yy]$ ]]; then
NOUVEAU="/etc/modprobe.d/nouveau.conf"
if [ -f "$NOUVEAU" ]; then
printf "${OK} Seems like nouveau is already blacklisted..moving on.\n"

View File

@@ -1,6 +1,9 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# SDDM Log-in Manager #
if [[ $USE_PRESET = [Yy] ]]; then
source ./preset.sh
fi
sddm=(
qt5-graphicaleffects
@@ -28,7 +31,9 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_sddm.log"
# 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
if [[ -z $manual_install_sddm ]]; then
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
fi
echo
if [[ $manual_install_sddm =~ ^[Yy]$ ]]; then
$ISAUR -S sddm-git 2>&1 | tee -a "$LOG"
@@ -65,7 +70,9 @@ sudo cp assets/hyprland.desktop "$wayland_sessions_dir/" 2>&1 | tee -a "$LOG"
# SDDM-themes
valid_input=false
while [ "$valid_input" != true ]; do
read -n 1 -r -p "${CAT} OPTIONAL - Would you like to install SDDM themes? (y/n)" install_sddm_theme
if [[ -z $install_sddm_theme ]]; then
read -n 1 -r -p "${CAT} OPTIONAL - Would you like to install SDDM themes? (y/n)" install_sddm_theme
fi
if [[ $install_sddm_theme =~ ^[Yy]$ ]]; then
printf "\n%s - Installing Simple SDDM Theme\n" "${NOTE}"

View File

@@ -1,6 +1,9 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# XDG-Desktop-Portals #
if [[ $USE_PRESET = [Yy] ]]; then
source ./preset.sh
fi
xdg=(
xdg-desktop-portal-hyprland
@@ -37,7 +40,9 @@ sleep 1
printf "\n"
printf "${NOTE} XDG-desktop-portal-KDE & GNOME (if installed) should be manually disabled or removed! I can't remove it... sorry...\n"
while true; do
read -rp "${CAT} Would you like to try to remove other XDG-Desktop-Portal-Implementations? (y/n) " XDPH1
if [[ -z $XDPH1 ]]; then
read -rp "${CAT} Would you like to try to remove other XDG-Desktop-Portal-Implementations? (y/n) " XDPH1
fi
echo
sleep 1

View File

@@ -1,6 +1,9 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# zsh and oh my zsh including pokemon-color-scripts#
if [[ $USE_PRESET = [Yy] ]]; then
source ./preset.sh
fi
zsh=(
zsh
@@ -23,8 +26,10 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_zsh.log"
## Optional Pokemon color scripts
while true; do
read -p "${CAT} OPTIONAL - Do you want to add Pokemon color scripts? (y/n): " choice
case "$choice" in
if [[ -z $pokemon_choice ]]; then
read -p "${CAT} OPTIONAL - Do you want to add Pokemon color scripts? (y/n): " pokemon_choice
fi
case "$pokemon_choice" in
[Yy]*)
zsh+=('pokemon-colorscripts-git')
sed -i '/#pokemon-colorscripts --no-title -s -r/s/^#//' assets/.zshrc