Draft commit of a large refactor of the code

This commit is contained in:
Da_Person 2025-07-08 16:01:59 -07:00
parent 8eab80503c
commit be1220362b
38 changed files with 1801 additions and 1328 deletions

4
.gitignore vendored
View File

@ -1,3 +1,5 @@
Install-Logs/* Install-Logs/*
!Install-Logs/.gitkeep !Install-Logs/.gitkeep
faux-install-dir

4
.shellcheckrc Normal file
View File

@ -0,0 +1,4 @@
# Notify shellcheck that we are sourcing external scripts
external-sources=true
extended-analysis=true

View File

@ -53,6 +53,7 @@ Thank you for your interest in contributing to KooL Hyprland Projects! We welcom
- Update the **documentation** if necessary. - Update the **documentation** if necessary.
- Add tests if applicable. - Add tests if applicable.
- Make sure all tests pass or fully tested before submitting your changes. - Make sure all tests pass or fully tested before submitting your changes.
- Use the `shellcheck` static analyzer or something similar for all scripts and minimize all warnings and eradicate errors. You cannot ignore warnings unless you have a good reason too.
- Keep your pull request focused and avoid including unrelated changes. - Keep your pull request focused and avoid including unrelated changes.
- Remember to follow the following files before submitting your changes. - Remember to follow the following files before submitting your changes.
- [bug.yml](https://github.com/JaKooLit/Debian-Hyprland/blob/main/.github/ISSUE_TEMPLATE/bug.yml) - Use this template to create a report to help us improve. - [bug.yml](https://github.com/JaKooLit/Debian-Hyprland/blob/main/.github/ISSUE_TEMPLATE/bug.yml) - Use this template to create a report to help us improve.

Binary file not shown.

BIN
assets/yad_7.2-1_amd64.deb Normal file

Binary file not shown.

View File

@ -2,20 +2,23 @@
# https://github.com/JaKooLit # https://github.com/JaKooLit
# Set some colors for output messages # Set some colors for output messages
OK="$(tput setaf 2)[OK]$(tput sgr0)" export MAGENTA="$(tput setaf 5)"
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" export YELLOW="$(tput setaf 226)"
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" export RED="$(tput setaf 1)"
INFO="$(tput setaf 4)[INFO]$(tput sgr0)" export ORANGE="$(tput setaf 3)"
WARN="$(tput setaf 1)[WARN]$(tput sgr0)" export GREEN="$(tput setaf 2)"
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" export BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)" export SKY_BLUE="$(tput setaf 12)"
ORANGE="$(tput setaf 214)" export GRAY="$(tput setaf 251)"
WARNING="$(tput setaf 1)" export GREY=$GRAY
YELLOW="$(tput setaf 3)" export WARNING=$ORANGE
GREEN="$(tput setaf 2)" export RESET="$(tput sgr0)"
BLUE="$(tput setaf 4)" export OK="${GREEN}[OK]${RESET}"
SKY_BLUE="$(tput setaf 6)" export ERROR="${RED}[ERROR]${RESET}"
RESET="$(tput sgr0)" export NOTE="${GRAY}[NOTE]${RESET}"
export INFO="${BLUE}[INFO]${RESET}"
export WARN="${WARNING}[WARN]${RESET}"
export CAT="${SKY_BLUE}[ACTION]${RESET}"
# Variables # Variables
Distro="Debian-Hyprland" Distro="Debian-Hyprland"
@ -24,10 +27,9 @@ Distro_DIR="$HOME/$Distro"
printf "\n%.0s" {1..1} printf "\n%.0s" {1..1}
if ! command -v git &> /dev/null if ! command -v git &>/dev/null; then
then
echo "${INFO} Git not found! ${SKY_BLUE}Installing Git...${RESET}" echo "${INFO} Git not found! ${SKY_BLUE}Installing Git...${RESET}"
if ! sudo apt install -y git; then if ! sudo apt install --assume-yes git; then
echo "${ERROR} Failed to install Git. Exiting." echo "${ERROR} Failed to install Git. Exiting."
exit 1 exit 1
fi fi
@ -47,4 +49,4 @@ else
cd "$Distro_DIR" || exit 1 cd "$Distro_DIR" || exit 1
chmod +x install.sh chmod +x install.sh
./install.sh ./install.sh
fi fi

View File

@ -3,7 +3,6 @@
# main dependencies # # main dependencies #
# 22 Aug 2024 - NOTE will trim this more down # 22 Aug 2024 - NOTE will trim this more down
# packages neeeded # packages neeeded
dependencies=( dependencies=(
build-essential build-essential
@ -68,36 +67,44 @@ hyprland_dep=(
) )
build_dep=( build_dep=(
wlroots wlroots
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -euo pipefail
IFS=$'\n\t'
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source $SCRIPT_DIR/Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_dependencies.log" LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_dependencies.log"
# Installation of main dependencies # Installation of main dependencies
printf "\n%s - Installing ${SKY_BLUE}main dependencies....${RESET} \n" "${NOTE}" echo -e "\n${NOTE} - Installing ${SKY_BLUE}main dependencies....${RESET}"
for PKG1 in "${dependencies[@]}" "${hyprland_dep[@]}"; do for PKG1 in "${dependencies[@]}" "${hyprland_dep[@]}"; do
install_package "$PKG1" "$LOG" install_package "$PKG1" "$LOG"
done done
printf "\n%.0s" {1..1} newlines 1
for PKG1 in "${build_dep[@]}"; do for PKG1 in "${build_dep[@]}"; do
build_dep "$PKG1" "$LOG" build_dep "$PKG1" "$LOG"
done done
printf "\n%.0s" {1..2} newlines 2

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# Hyprland-Dots Packages # # Hyprland-Dots Packages #
# edit your packages desired here. # edit your packages desired here.
# WARNING! If you remove packages here, dotfiles may not work properly. # WARNING! If you remove packages here, dotfiles may not work properly.
# and also, ensure that packages are present in Debian Official Repo # and also, ensure that packages are present in Debian Official Repo
@ -60,10 +60,10 @@ hypr_package_2=(
qalculate-gtk qalculate-gtk
) )
# packages to force reinstall # packages to force reinstall
force=( force=(
imagemagick imagemagick
wayland-protocols wayland-protocols
) )
# List of packages to uninstall as it conflicts with swaync or causing swaync to not function properly # List of packages to uninstall as it conflicts with swaync or causing swaync to not function properly
@ -88,69 +88,88 @@ uninstall=(
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
PARENT_DIR=$SCRIPT_DIR/..
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hypr-pkgs.log" LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_hypr-pkgs.log"
# conflicting packages removal # conflicting packages removal
overall_failed=0 overall_failed=0
printf "\n%s - ${SKY_BLUE}Removing some packages${RESET} as it conflicts with KooL's Hyprland Dots \n" "${NOTE}" printf "\n%s - ${SKY_BLUE}Removing some packages${RESET} as it conflicts with KooL's Hyprland Dots \n" "${NOTE}"
for PKG in "${uninstall[@]}"; do for PKG in "${uninstall[@]}"; do
uninstall_package "$PKG" 2>&1 | tee -a "$LOG" ! uninstall_package "$PKG" 2>&1 | tee -a "$LOG" && overall_failed=1
if [ $? -ne 0 ]; then
overall_failed=1
fi
done done
if [ $overall_failed -ne 0 ]; then if [ $overall_failed -ne 0 ]; then
echo -e "${ERROR} Some packages failed to uninstall. Please check the log." echo "${ERROR} Some packages failed to uninstall. Please check the log."
fi fi
printf "\n%.0s" {1..1} newlines 1
# Installation of main components # Installation of main components
printf "\n%s - Installing ${SKY_BLUE}KooL's hyprland necessary packages${RESET} .... \n" "${NOTE}" printf "\n%s - Installing ${SKY_BLUE}KooL's hyprland necessary packages${RESET} .... \n" "${NOTE}"
for PKG1 in "${hypr_package[@]}" "${hypr_package_2[@]}" "${Extra[@]}"; do for PKG1 in "${hypr_package[@]}" "${hypr_package_2[@]}" "${Extra[@]}"; do
install_package "$PKG1" "$LOG" install_package "$PKG1" "$LOG"
done done
printf "\n%.0s" {1..1} newlines 1
for PKG2 in "${force[@]}"; do for PKG2 in "${force[@]}"; do
re_install_package "$PKG2" "$LOG" re_install_package "$PKG2" "$LOG"
done done
printf "\n%.0s" {1..1} newlines 1
# install YAD from assets. NOTE This is downloaded from SID repo and sometimes # install YAD from assets. NOTE This is downloaded from EXPERIMENTAL repo and sometimes
# Trixie is removing YAD for some strange reasons # Trixie is removing YAD for some strange reasons
# Check if yad is installed # Check if yad is installed
if ! command -v yad &> /dev/null; then if ! command -v yad &>/dev/null; then
echo "${INFO} Installing ${YELLOW}YAD from assets${RESET} ..." echo "${INFO} Installing ${YELLOW}YAD from assets${RESET} ..."
sudo dpkg -i assets/yad_0.40.0-1+b2_amd64.deb if [[ $PEDANTIC_DRY -eq 1 ]]; then
sudo apt install -f -y echo "${NOTE} Not installing yad=7.2-1_amd64 from $PARENT_DIR/assets/yad_7.2-1_amd64.deb"
echo "${INFO} ${YELLOW}YAD from assets${RESET} succesfully installed ..." else
verbose_log "Installing $PARENT_DIR/assets/yad_.2-1_amd64.deb with dpkg -i"
sudo dpkg -i assets/yad_7.2-1_amd64.deb
verbose_log "Attempting to fix broken packages just in case."
sudo apt install --fix-broken --assume-yes
echo "${INFO} ${YELLOW}YAD from assets${RESET} succesfully installed ..."
fi
fi fi
printf "\n%.0s" {1..2} newlines 2
# Install up-to-date Rust if [[ $DRY -eq 1 ]]; then
echo "${INFO} Installing most ${YELLOW}up to date Rust compiler${RESET} ..." echo "${NOTE} I am not installing the Rust compiler."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 2>&1 | tee -a "$LOG" else
# Install up-to-date Rust
echo "${INFO} Installing most ${YELLOW}up to date Rust compiler${RESET} ..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 2>&1 | tee -a "$LOG"
fi
# shellcheck disable=SC1091
source "$HOME/.cargo/env" source "$HOME/.cargo/env"
## making brightnessctl work if [[ $PEDANTIC_DRY -eq 1 ]]; then
sudo chmod +s "$(which brightnessctl)" 2>&1 | tee -a "$LOG" || true echo "${NOTE} Not setting setuid bit of $(which brightnessctl) executable."
else
## making brightnessctl work
sudo chmod +s "$(which brightnessctl)" 2>&1 | tee -a "$LOG" || true
fi
printf "\n%.0s" {1..2} newlines 2

View File

@ -9,46 +9,66 @@ TARGET_DIR="/usr/local/bin"
# Define packages to manually remove (was manually installed previously) # Define packages to manually remove (was manually installed previously)
PACKAGES=( PACKAGES=(
hyprctl hyprctl
hyprpm hyprpm
hyprland hyprland
Hyprland Hyprland
cliphist hyprwayland-scanner
pypr hyprcursor-util
swappy hyprland-update-screen
waybar hyprland-dialog
magick hyprland-share-picker
hyprlock
hypridle
cliphist
pypr
swappy
waybar
magick
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -euo pipefail
IFS=$'\n\t'
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
PARENT_DIR="$SCRIPT_DIR/.."
source "$SCRIPT_DIR/colors.sh" || {
echo "Failed to source $SCRIPT_DIR/colors.sh"
exit 1
}
source "$SCRIPT_DIR/parse_args.sh" || {
echo "${ERROR} Failed to source $SCRIPT_DIR/parse_args.sh"
exit 1
}
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." cd "$PARENT_DIR" || {
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
# Source the global functions script }
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then
echo "Failed to source Global_functions.sh"
exit 1
fi
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_pre-clean-up.log" LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_pre-clean-up.log"
# Loop through the list of packages # Loop through the list of packages
for PKG_NAME in "${PACKAGES[@]}"; do for PKG_NAME in "${PACKAGES[@]}"; do
# Construct the full path to the file # Construct the full path to the file
FILE_PATH="$TARGET_DIR/$PKG_NAME" FILE_PATH="$TARGET_DIR/$PKG_NAME"
# Check if the file exists # Check if the file exists
if [[ -f "$FILE_PATH" ]]; then if [[ -f "$FILE_PATH" ]]; then
# Delete the file if [[ $DRY -eq 1 ]]; then
sudo rm "$FILE_PATH" echo "${NOTE} Not removing $FILE_PATH."
echo "Deleted: $FILE_PATH" 2>&1 | tee -a "$LOG" else
else # Delete the file
echo "File not found: $FILE_PATH" 2>&1 | tee -a "$LOG" sudo rm "$FILE_PATH"
fi echo "Deleted: $FILE_PATH" 2>&1 | tee -a "$LOG"
fi
else
echo "File not found: $FILE_PATH" 2>&1 | tee -a "$LOG"
fi
done done
clear

View File

@ -4,59 +4,57 @@
# NOTE: These package checks are only the essentials # NOTE: These package checks are only the essentials
packages=( packages=(
imagemagick imagemagick
sway-notification-center sway-notification-center
waybar waybar
wl-clipboard wl-clipboard
cliphist cliphist
wlogout wlogout
kitty kitty
hyprland
) )
# Local packages that should be in /usr/local/bin/ # Local packages that should be in /usr/local/bin/
local_pkgs_installed=( local_pkgs_installed=(
rofi rofi
hypridle hypridle
hyprlock hyprlock
wallust hyprland
wallust
) )
local_pkgs_installed_2=( local_pkgs_installed_2=(
swww swww
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
IFS=$'\n\t'
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/00_CHECK-$(date +%d-%H%M%S)_installed.log" LOG="$PARENT_DIR/Install-Logs/00_CHECK-$(date +%d-%H%M%S)_installed.log"
printf "\n%s - Final Check if Essential packages were installed \n" "${NOTE}" echo -e "\n${NOTE} - Final Check if Essential packages were installed"
# Initialize an empty array to hold missing packages # Initialize an empty array to hold missing packages
missing=() missing=()
local_missing=() local_missing=()
local_missing_2=() local_missing_2=()
# Function to check if a package is installed using dpkg
is_installed_dpkg() {
dpkg -l | grep -q "^ii $1 "
}
# Loop through each package # Loop through each package
for pkg in "${packages[@]}"; do for pkg in "${packages[@]}"; do
# Check if the package is installed via dpkg # Check if the package is installed via dpkg
if ! is_installed_dpkg "$pkg"; then if ! check_if_installed_with_apt "$pkg"; then
verbose_log "Missing package $pkg that should be installed with apt or apt-like tools"
missing+=("$pkg") missing+=("$pkg")
fi fi
done done
@ -64,6 +62,7 @@ done
# Check for local packages # Check for local packages
for pkg1 in "${local_pkgs_installed[@]}"; do for pkg1 in "${local_pkgs_installed[@]}"; do
if ! [ -f "/usr/local/bin/$pkg1" ]; then if ! [ -f "/usr/local/bin/$pkg1" ]; then
verbose_log "Missing local package $pkg1 in /usr/local/bin"
local_missing+=("$pkg1") local_missing+=("$pkg1")
fi fi
done done
@ -71,6 +70,7 @@ done
# Check for local packages in /usr/bin # Check for local packages in /usr/bin
for pkg2 in "${local_pkgs_installed_2[@]}"; do for pkg2 in "${local_pkgs_installed_2[@]}"; do
if ! [ -f "/usr/bin/$pkg2" ]; then if ! [ -f "/usr/bin/$pkg2" ]; then
verbose_log "Missing local package $pkg2 in /usr/bin"
local_missing_2+=("$pkg2") local_missing_2+=("$pkg2")
fi fi
done done
@ -83,7 +83,7 @@ else
echo "${WARN} The following packages are not installed and will be logged:" echo "${WARN} The following packages are not installed and will be logged:"
for pkg in "${missing[@]}"; do for pkg in "${missing[@]}"; do
echo "$pkg" echo "$pkg"
echo "$pkg" >> "$LOG" # Log the missing package to the file echo "$pkg" >>"$LOG" # Log the missing package to the file
done done
fi fi
@ -91,7 +91,7 @@ else
echo "${WARN} The following local packages are missing from /usr/local/bin/ and will be logged:" echo "${WARN} The following local packages are missing from /usr/local/bin/ and will be logged:"
for pkg1 in "${local_missing[@]}"; do for pkg1 in "${local_missing[@]}"; do
echo "$pkg1 is not installed. can't find it in /usr/local/bin/" echo "$pkg1 is not installed. can't find it in /usr/local/bin/"
echo "$pkg1" >> "$LOG" # Log the missing local package to the file echo "$pkg1" >>"$LOG" # Log the missing local package to the file
done done
fi fi
@ -99,10 +99,10 @@ else
echo "${WARN} The following local packages are missing from /usr/bin/ and will be logged:" echo "${WARN} The following local packages are missing from /usr/bin/ and will be logged:"
for pkg2 in "${local_missing_2[@]}"; do for pkg2 in "${local_missing_2[@]}"; do
echo "$pkg2 is not installed. can't find it in /usr/bin/" echo "$pkg2 is not installed. can't find it in /usr/bin/"
echo "$pkg2" >> "$LOG" # Log the missing local package to the file echo "$pkg2" >>"$LOG" # Log the missing local package to the file
done done
fi fi
# Add a timestamp when the missing packages were logged # Add a timestamp when the missing packages were logged
echo "${NOTE} Missing packages logged at $(date)" >> "$LOG" echo "${NOTE} Missing packages logged at $(date)" >>"$LOG"
fi fi

View File

@ -2,126 +2,442 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# Global Functions for Scripts # # Global Functions for Scripts #
set -e set -euo pipefail
IFS=$'\n\t'
# Set some colors for output messages # See first comment of answer in https://stackoverflow.com/a/53183593
OK="$(tput setaf 2)[OK]$(tput sgr0)" # Get directory of this script
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
INFO="$(tput setaf 4)[INFO]$(tput sgr0)" PARENT_DIR=$SCRIPT_DIR/..
WARN="$(tput setaf 1)[WARN]$(tput sgr0)"
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" source "$SCRIPT_DIR/colors.sh" || {
MAGENTA="$(tput setaf 5)" echo "Failed to source $SCRIPT_DIR/colors.sh"
ORANGE="$(tput setaf 214)" exit 1
WARNING="$(tput setaf 1)" }
YELLOW="$(tput setaf 3)"
GREEN="$(tput setaf 2)" source "$SCRIPT_DIR/parse_args.sh" || {
BLUE="$(tput setaf 4)" echo "${RED} Failed to source $SCRIPT_DIR/parse_args.sh"
SKY_BLUE="$(tput setaf 6)" exit 1
RESET="$(tput sgr0)" }
# Create Directory for Install Logs # Create Directory for Install Logs
if [ ! -d Install-Logs ]; then if [[ $DRY -eq 0 && ! -d "$PARENT_DIR"/Install-Logs ]]; then
mkdir Install-Logs mkdir "$PARENT_DIR"/Install-Logs
elif [[ $DRY -eq 1 ]]; then
echo "${NOTE} Not creating directory $PARENT_DIR/Install-Logs"
fi fi
# Print $1 amount of newlines
newlines() {
for ((i = 1; i <= "$1"; i++)); do
printf "\n"
done
}
# Verbose logging for when using the --verbose or -v option
verbose_log() {
if [[ "$VERBOSE" == 1 ]]; then
echo "${GRAY}[VERBOSE NOTE]${RESET} $1"
fi
}
# Function to check if the system is Ubuntu
is_ubuntu() {
# Check for 'Ubuntu' in /etc/os-release
if grep -q 'Ubuntu' /etc/os-release; then
return 0
fi
return 1
}
execute_script() {
local script="$1"
local script_path="$SCRIPT_DIR/$script"
if [ -f "$script_path" ]; then
verbose_log "Attempting to change permissions of file to be executable: $script_path"
if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${NOTE} I won't make $script_path executable."
else
chmod +x "$script_path"
fi
if [ -x "$script_path" ]; then
verbose_log "Executing file: $script_path"
env "$script_path"
else
echo "${WARN} Failed to make script '$script' executable.${RESET}" | tee -a "$LOG"
fi
else
echo "${WARN} Script '$script' not found in '$SCRIPT_DIR'.${RESET}" | tee -a "$LOG"
fi
}
# Function to load preset file
load_preset() {
echo "✅ Loading preset: $1"
# shellcheck source=../preset.sh
source "$1" || {
echo "${ERROR} Failed to execute $(realpath "$1")"
exit 1
}
}
# List of services to check for active login managers
services=("gdm.service" "gdm3.service" "lightdm.service" "lxdm.service")
# Function to check if any login services are active
check_services_running() {
active_services=() # Array to store active services
for svc in "${services[@]}"; do
if systemctl is-active --quiet "$svc"; then
verbose_log "Adding $svc as an active service that should be inactive"
active_services+=("$svc")
fi
done
verbose_log "Active services count: ${#active_services[@]}"
if [ ${#active_services[@]} -gt 0 ]; then
verbose_log "These interfering active services were found: $(printf "%s\n" "${active_services[@]}")"
return 1
else
verbose_log "No notorious active services were found."
return 0
fi
}
# Check if package is installed with apt and friends (returns 0 if so and 1 if not)
check_if_installed_with_apt() {
# Reliable way to check if package is installed, with Perl regex to support lookaheads
apt list "$1" --installed | grep -qP '^[^\/]*(?=.*\[installed)'
return $?
}
# Show progress function # Show progress function
show_progress() { show_progress() {
local pid=$1 local pid=$1
local package_name=$2 local package_name=$2
local spin_chars=("●○○○○○○○○○" "○●○○○○○○○○" "○○●○○○○○○○" "○○○●○○○○○○" "○○○○●○○○○" \ local spin_chars=("●○○○○○○○○○" "○●○○○○○○○○" "○○●○○○○○○○" "○○○●○○○○○○" "○○○○●○○○○" "○○○○○●○○○○" "○○○○○○●○○○" "○○○○○○○●○○" "○○○○○○○○●○" "○○○○○○○○○●")
"○○○○○●○○○○" "○○○○○○●○○○" "○○○○○○○●○○" "○○○○○○○○●○" "○○○○○○○○○●")
local i=0 local i=0
tput civis tput civis
printf "\r${INFO} Installing ${YELLOW}%s${RESET} ..." "$package_name" printf "\r${INFO} Installing ${YELLOW}%s${RESET} ..." "$package_name"
while ps -p "$pid" &> /dev/null; do while ps -p "$pid" &>/dev/null; do
printf "\r${INFO} Installing ${YELLOW}%s${RESET} %s" "$package_name" "${spin_chars[i]}" printf "\r${INFO} Installing ${YELLOW}%s${RESET} %s" "$package_name" "${spin_chars[i]}"
i=$(( (i + 1) % 10 )) i=$(((i + 1) % 10))
sleep 0.3 sleep 0.3
done done
printf "\r${INFO} Installing ${YELLOW}%s${RESET} ... Done!%-20s \n\n" "$package_name" "" printf "\r${INFO} Installing ${YELLOW}%s${RESET} ... Done!%-20s \n\n" "$package_name" ""
tput cnorm tput cnorm
} }
# Function for installing packages with a progress bar # Function for installing packages with a progress bar
install_package() { install_package() {
if dpkg -l | grep -q -w "$1" ; then if check_if_installed_with_apt "$1"; then
echo -e "${INFO} ${MAGENTA}$1${RESET} is already installed. Skipping..." echo "${INFO} ${MAGENTA}$1${RESET} is already installed. Skipping..."
else
(
stdbuf -oL sudo apt install -y "$1" 2>&1
) >> "$LOG" 2>&1 &
PID=$!
show_progress $PID "$1"
# Double check if the package successfully installed
if dpkg -l | grep -q -w "$1"; then
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully installed!"
else else
echo -e "\e[1A\e[K${ERROR} ${YELLOW}$1${RESET} failed to install. Please check the install.log. You may need to install it manually. Sorry, I have tried :(" if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${NOTE} I won't install $1 even though it is required."
else
# Install with apt but preserve apt markings. However, --mark-auto does not work, so this regexp workaround has to be used until the bug becomes fixed: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/2100937
local markauto=0
apt-mark showauto | grep -qP "^$1(:.+)?$" && {
verbose_log "Preserving apt marking for package $1"
markauto=1
}
verbose_log "Installing $1 with sudo apt install --assume-yes $1"
(
# Use stdbuf -oL for line buffering (append as lines go by instead of when it is all done) to the log file
stdbuf -oL sudo apt install --assume-yes "$1" 2>&1
) >>"$LOG" 2>&1 &
PID=$!
show_progress $PID "$1"
# Double check if the package successfully installed
if check_if_installed_with_apt "$1"; then
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully installed!"
else
echo -e "\e[1A\e[K${ERROR} ${YELLOW}$1${RESET} failed to install. Please check the install.log. You may need to install it manually. Sorry, I have tried :("
fi
[[ $markauto -eq 1 ]] && {
echo "${ACTION}Setting package $1 to auto to preserve its apt-mark status"
(
sudo apt-mark auto "$1" 2>&1
) >>"$LOG" 2>&1
}
fi
fi fi
fi verbose_log "Done with install_package $1"
} }
# Function for build depencies with a progress bar # Short synonym for install_package function
build_dep() { apt_install() {
echo -e "${INFO} building dependencies for ${MAGENTA}$1${RESET} " install_package "$@"
( }
stdbuf -oL sudo apt build-dep -y "$1" 2>&1
) >> "$LOG" 2>&1 & # apt install --no-recommends
PID=$! apt_install_no_recommends() {
show_progress $PID "$1" if check_if_installed_with_apt "$1"; then
echo "${INFO} ${MAGENTA}$1${RESET} is already installed. Skipping..."
else
if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${NOTE} I won't install $1 even though it is required."
else
# Install with apt but preserve apt markings. However, --mark-auto does not work, so this regexp workaround has to be used until the bug becomes fixed: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/2100937
local markauto=0
apt-mark showauto | grep -qP "^$1(:.+)?$" && {
verbose_log "Preserving apt marking for package $1"
markauto=1
}
verbose_log "Installing $1 with sudo apt install --no-install-recommends --assume-yes $1"
(
# Use stdbuf -oL for line buffering (append as lines go by instead of when it is all done) to the log file
stdbuf -oL sudo apt install --no-install-recommends --assume-yes "$1" 2>&1
) >>"$LOG" 2>&1 &
PID=$!
show_progress $PID "$1"
# Double check if the package successfully installed
if check_if_installed_with_apt "$1"; then
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully installed!"
else
echo -e "\e[1A\e[K${ERROR} ${YELLOW}$1${RESET} failed to install. Please check the install.log. You may need to install it manually. Sorry, I have tried :("
fi
[[ $markauto -eq 1 ]] && {
echo "${ACTION}Setting package $1 to auto to preserve its apt-mark status"
(
sudo apt-mark auto "$1" 2>&1
) >>"$LOG" 2>&1
}
fi
fi
}
# Function for build dependencies with a progress bar
build_dep() {
echo "${INFO} building dependencies for ${MAGENTA}$1${RESET} "
if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${NOTE} I won't install $1 even though it is required."
else
(
stdbuf -oL sudo apt build-dep --assume-yes "$1" 2>&1
) >>"$LOG" 2>&1 &
PID=$!
show_progress $PID "$1"
fi
} }
# Function for cargo install with a progress bar # Function for cargo install with a progress bar
cargo_install() { cargo_install() {
echo -e "${INFO} installing ${MAGENTA}$1${RESET} using cargo..." echo "${INFO} installing ${MAGENTA}$1${RESET} using cargo..."
( if [[ $PEDANTIC_DRY -eq 1 ]]; then
stdbuf -oL cargo install "$1" 2>&1 echo "${NOTE} I won't install $1 using cargo even though it is required."
) >> "$LOG" 2>&1 & else
PID=$! (
show_progress $PID "$1" stdbuf -oL cargo install "$1" 2>&1
) >>"$LOG" 2>&1 &
PID=$!
show_progress $PID "$1"
fi
} }
# Function for re-installing packages with a progress bar # Function for re-installing packages with a progress bar
re_install_package() { re_install_package() {
( if [[ $PEDANTIC_DRY -eq 1 ]]; then
stdbuf -oL sudo apt install --reinstall -y "$1" 2>&1 echo "${NOTE} I won't reinstall $1."
) >> "$LOG" 2>&1 &
PID=$!
show_progress $PID "$1"
if dpkg -l | grep -q -w "$1"; then
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully re-installed!"
else else
# Package not found, reinstallation failed (
echo -e "${ERROR} ${YELLOW}$1${RESET} failed to re-install. Please check the install.log. You may need to install it manually. Sorry, I have tried :(" stdbuf -oL sudo apt install --reinstall --assume-yes "$1" 2>&1
) >>"$LOG" 2>&1 &
PID=$!
show_progress $PID "$1"
if dpkg -l | grep -q -w "$1"; then
echo -e "\e[1A\e[K${OK} Package ${YELLOW}$1${RESET} has been successfully re-installed!"
else
# Package not found, reinstallation failed
echo "${ERROR} ${YELLOW}$1${RESET} failed to re-install. Please check the install.log. You may need to install it manually. Sorry, I have tried :("
fi
fi fi
} }
# Short synonym for re_install_package function
apt_reinstall() {
re_install_package "$@"
}
# Function for removing packages # Function for removing packages
uninstall_package() { uninstall_package() {
local pkg="$1" local pkg="$1"
# Checking if package is installed # Checking if package is installed
if sudo dpkg -l | grep -q -w "^ii $1" ; then if sudo dpkg -l | grep -q -w "^ii $1"; then
echo -e "${NOTE} removing $pkg ..." echo "${NOTE} removing $pkg ..."
# shellcheck disable=SC2024 if [[ $PURGE -eq 1 ]]; then
sudo apt autoremove -y "$1" >> "$LOG" 2>&1 | grep -v "error: target not found" if [[ $VERBOSE -eq 1 ]]; then
sudo apt autopurge --assume-yes "$1" | tee -a "$LOG" 2>&1
if ! dpkg -l | grep -q -w "^ii $1" ; then else
echo -e "\e[1A\e[K${OK} ${MAGENTA}$1${RESET} removed." sudo apt autopurge --assume-yes "$1" | tee -a "$LOG" 2>&1 | grep -v "error: target not found"
fi
else
if [[ $VERBOSE -eq 1 ]]; then
sudo apt autoremove --assume-yes "$1" | tee -a "$LOG" 2>&1
else
sudo apt autoremove --assume-yes "$1" | tee -a "$LOG" 2>&1 | grep -v "error: target not found"
fi
fi
if ! dpkg -l | grep -q -w "^ii $1"; then
echo -e "\e[1A\e[K${OK} ${MAGENTA}$1${RESET} removed."
else
echo -e "\e[1A\e[K${ERROR} $pkg Removal failed. No actions required."
return 1
fi
else else
echo -e "\e[1A\e[K${ERROR} $pkg Removal failed. No actions required." echo "${INFO} Package $pkg not installed, skipping."
return 1
fi fi
else return 0
echo -e "${INFO} Package $pkg not installed, skipping." }
fi
return 0 # Short synonym for uninstall_package function
} apt_remove() {
uninstall_package "$@"
}
remove_file() {
if [[ -f "$1" ]]; then
if [[ $DRY -eq 1 ]]; then
echo "${NOTE} I am not removing $1"
else
verbose_log "Removing file $1"
if [[ $# -gt 1 && -n $2 ]]; then
rm "$1" 2>&1 | tee -a "$2"
else
rm "$1" 2>&1
fi
fi
else
verbose_log "File $1 does not exist, so not removing it"
fi
}
remove_dir() {
# Sanity checker
case $(realpath "$1") in
/)
echo "${ERROR} Attempting to remove root directory $1. Must be a bug in the code. Exiting..."
exit 1
;;
/usr | /usr/bin | /usr/local | /usr/local/bin | /etc | /home | /usr/lib | /usr/local/lib)
echo "${ERROR} Attempting to remove system directory $1. Must be a bug in the code. Exiting..."
exit 1
;;
*)
verbose_log "Directory $1 is probably safe to remove."
;;
esac
if [[ -d "$1" ]]; then
if [[ $DRY -eq 1 ]]; then
echo "${NOTE} I am not removing the directory $1"
else
verbose_log "Forcibly and recursively removing the directory $1"
if [[ $# -gt 1 && -n $2 ]]; then
sudo rm -rf "$1" 2>&1 | tee -a "$2"
else
sudo rm -rf "$1" 2>&1
fi
fi
else
verbose_log "Directory $1 does not exist, so not removing it"
fi
}
# Essential function for automating building of repositories from hyprwm
# First arg: release version, second arg: name of repository, third arg: "cmake_build", "hyprland-qt-support", "hyprwayland-scanner", or "meson" build type, fourth arg: "cmake" or "meson" installation type, fifth arg: repository name (defaults to hyprwm)
build_from_git() {
local install_prefix="/usr/local"
# Change install_prefix to --dry-run-dir's value
[[ $DRY -eq 1 ]] && install_prefix=$PARENT_DIR/faux-install-dir
[[ $DRY_RUN_DIR_SET -eq 1 ]] && install_prefix=$DRY_RUN_DIR
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.."
#specific branch or release
release="$1"
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_$2.log"
MLOG="install-$(date +%d-%H%M%S)_$2.log"
# Check if directory exists and remove it
remove_dir "$2"
# Clone and build
echo "${INFO} Installing ${YELLOW}$2 $release${RESET} ..."
if [[ $NO_BUILD -eq 1 ]]; then
echo "${NOTE} I am not cloning $2 and building it."
else
local name="hyprwm"
[[ $# -gt 4 && -n $5 ]] && name=$5
if git clone --recursive -b "$release" "https://github.com/$name/$2.git"; then
cd "$2" || exit 1
case "$3" in
cmake_build)
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH="$install_prefix" -S . -B ./build
cmake --build ./build --config Release --target "$2" -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
;;
hyprland-qt-support)
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH="$install_prefix" -DINSTALL_QML_PREFIX=/lib/x86_64-linux-gnu/qt6/qml -S . -B ./build
cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
;;
hyprwayland-scanner)
cmake -DCMAKE_INSTALL_PREFIX="$install_prefix" -B build
cmake --build build -j "$(nproc)"
;;
meson)
meson setup --prefix="$install_prefix" build
;;
esac
case "$4" in
cmake)
sudo cmake --install ./build 2>&1 | tee -a "$MLOG"
;;
meson)
sudo meson install -C ./build 2>&1 | tee -a "$MLOG"
;;
esac
if $?; then
echo "${OK} ${MAGENTA}$2 $release${RESET} installed successfully." 2>&1 | tee -a "$MLOG"
else
echo "${ERROR} Installation failed for ${YELLOW}$2 $release${RESET}" 2>&1 | tee -a "$MLOG"
fi
if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${NOTE} Not moving $MLOG to $PARENT_DIR/Install-Logs/ with mv"
else
#moving the addional logs to Install-Logs directory
mv "$MLOG" "$PARENT_DIR"/Install-Logs/ || true
fi
cd ..
else
echo "${ERROR} Download failed for ${YELLOW}$2 $release${RESET}" 2>&1 | tee -a "$LOG"
fi
fi
newlines 2
}

View File

@ -3,17 +3,17 @@
# Adding users into input group # # Adding users into input group #
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_input.log" LOG="Install-Logs/install-$(date +%d-%H%M%S)_input.log"
@ -23,12 +23,20 @@ if grep -q '^input:' /etc/group; then
echo "${OK} ${MAGENTA}input${RESET} group exists." echo "${OK} ${MAGENTA}input${RESET} group exists."
else else
echo "${NOTE} ${MAGENTA}input${RESET} group doesn't exist. Creating ${MAGENTA}input${RESET} group..." echo "${NOTE} ${MAGENTA}input${RESET} group doesn't exist. Creating ${MAGENTA}input${RESET} group..."
sudo groupadd input if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${MAGENTA}input${RESET} group created" >> "$LOG" echo "${NOTE} Not adding the nonexistent group, input, with sudo groupadd"
else
sudo groupadd input
fi
echo "${MAGENTA}input${RESET} group created" >>"$LOG"
fi fi
# Add the user to the 'input' group if [[ $PEDANTIC_DRY -eq 1 ]]; then
sudo usermod -aG input "$(whoami)" echo "${NOTE}Not adding $(whoami) to the input group with sudo usermod -aG"
echo "${OK} ${YELLOW}user${RESET} added to the ${MAGENTA}input${RESET} group. Changes will take effect after you log out and log back in." >> "$LOG" else
# Add the user to the 'input' group
sudo usermod -aG input "$(whoami)"
echo "${OK} ${YELLOW}user${RESET} added to the ${MAGENTA}input${RESET} group. Changes will take effect after you log out and log back in." >>"$LOG"
fi
printf "\n%.0s" {1..2} newlines 2

View File

@ -3,16 +3,16 @@
# Aylur's GTK Shell # # Aylur's GTK Shell #
ags=( ags=(
node-typescript node-typescript
npm npm
meson meson
libgjs-dev libgjs-dev
gjs gjs
libgtk-layer-shell-dev libgtk-layer-shell-dev
libgtk-3-dev libgtk-3-dev
libpam0g-dev libpam0g-dev
libpulse-dev libpulse-dev
libdbusmenu-gtk3-dev libdbusmenu-gtk3-dev
libsoup-3.0-dev libsoup-3.0-dev
) )
@ -28,17 +28,24 @@ build_dep=(
ags_tag="v1.9.0" ags_tag="v1.9.0"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
PARENT_DIR=$SCRIPT_DIR/..
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_ags.log" LOG="Install-Logs/install-$(date +%d-%H%M%S)_ags.log"
@ -46,64 +53,76 @@ MLOG="install-$(date +%d-%H%M%S)_ags2.log"
# Check if AGS is installed # Check if AGS is installed
if command -v ags &>/dev/null; then if command -v ags &>/dev/null; then
AGS_VERSION=$(ags -v | awk '{print $NF}') AGS_VERSION=$(ags -v | awk '{print $NF}')
if [[ "$AGS_VERSION" == "1.9.0" ]]; then if [[ "$AGS_VERSION" == "1.9.0" ]]; then
printf "${INFO} ${MAGENTA}Aylur's GTK Shell v1.9.0${RESET} is already installed. Skipping installation." echo "${INFO} ${MAGENTA}Aylur's GTK Shell v1.9.0${RESET} is already installed. Skipping installation."
printf "\n%.0s" {1..2} newlines 1
exit 0 exit 0
fi fi
fi fi
# Installation of main components # Installation of main components
printf "\n%s - Installing ${SKY_BLUE}Aylur's GTK shell $ags_tag${RESET} Dependencies \n" "${INFO}" newlines 1
echo "${INFO} - Installing ${SKY_BLUE}Aylur's GTK shell $ags_tag${RESET} Dependencies"
# Installing ags Dependencies # Installing ags Dependencies
for PKG1 in "${ags[@]}"; do for PKG1 in "${ags[@]}"; do
install_package "$PKG1" "$LOG" install_package "$PKG1" "$LOG"
done done
for force_ags in "${f_ags[@]}"; do for force_ags in "${f_ags[@]}"; do
re_install_package "$force_ags" 2>&1 | tee -a "$LOG" re_install_package "$force_ags" 2>&1 | tee -a "$LOG"
done
printf "\n%.0s" {1..1}
for PKG1 in "${build_dep[@]}"; do
build_dep "$PKG1" "$LOG"
done done
#install typescript by npm newlines 1
sudo npm install --global typescript 2>&1 | tee -a "$LOG"
for PKG1 in "${build_dep[@]}"; do
build_dep "$PKG1" "$LOG"
done
if [[ $DRY -eq 1 ]]; then
echo "${NOTE} Not installing typescript with npm install --global" | tee -a "$LOG"
else
#install typescript by npm
sudo npm install --global typescript 2>&1 | tee -a "$LOG"
fi
# ags v1 # ags v1
printf "${NOTE} Install and Compiling ${SKY_BLUE}Aylur's GTK shell $ags_tag${RESET}..\n" echo "${NOTE} Install and Compiling ${SKY_BLUE}Aylur's GTK shell $ags_tag${RESET}.."
# Check if directory exists and remove it # Check if directory exists and remove it
if [ -d "ags" ]; then if [ -d "ags" ]; then
printf "${NOTE} Removing existing ags directory...\n" echo "${NOTE} Removing existing ags directory..."
rm -rf "ags" remove_dir "ags" "$LOG"
fi fi
printf "\n%.0s" {1..1} newlines 1
printf "${INFO} Kindly Standby...cloning and compiling ${SKY_BLUE}Aylur's GTK shell $ags_tag${RESET}...\n" echo "${INFO} Kindly Standby...cloning and compiling ${SKY_BLUE}Aylur's GTK shell $ags_tag${RESET}..."
printf "\n%.0s" {1..1} newlines 1
# Clone repository with the specified tag and capture git output into MLOG
if git clone --depth=1 https://github.com/JaKooLit/ags_v1.9.0.git; then if [[ $NO_BUILD -eq 1 ]]; then
cd ags_v1.9.0 || exit 1 echo "${NOTE} Not cloning or building ags"
npm install
meson setup build
if sudo meson install -C build 2>&1 | tee -a "$MLOG"; then
printf "\n${OK} ${YELLOW}Aylur's GTK shell $ags_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "\n${ERROR} ${YELLOW}Aylur's GTK shell $ags_tag${RESET} Installation failed\n " 2>&1 | tee -a "$MLOG"
fi
# Move logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else else
echo -e "\n${ERROR} Failed to download ${YELLOW}Aylur's GTK shell $ags_tag${RESET} Please check your connection\n" 2>&1 | tee -a "$LOG" # Clone repository with the specified tag and capture git output into MLOG
mv "$MLOG" ../Install-Logs/ || true if git clone --depth=1 https://github.com/JaKooLit/ags_v1.9.0.git; then
exit 1 cd "$PARENT_DIR"/ags_v1.9.0 || exit 1
npm install
meson setup build
if sudo meson install -C build 2>&1 | tee -a "$MLOG"; then
newlines 1
echo "${OK} ${YELLOW}Aylur's GTK shell $ags_tag${RESET} installed successfully." 2>&1 | tee -a "$MLOG"
else
newlines 1
echo "${ERROR} ${YELLOW}Aylur's GTK shell $ags_tag${RESET} Installation failed" 2>&1 | tee -a "$MLOG"
fi
# Move logs to Install-Logs directory
mv "$MLOG" "$PARENT_DIR"/Install-Logs/ || true
cd ..
else
echo -e "\n${ERROR} Failed to download ${YELLOW}Aylur's GTK shell $ags_tag${RESET} Please check your connection\n" 2>&1 | tee -a "$LOG"
mv "$MLOG" "$PARENT_DIR"/Install-Logs/ || true
exit 1
fi
fi fi
printf "\n%.0s" {1..2} newlines 2

View File

@ -2,51 +2,20 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# aquamarine # # aquamarine #
#specific branch or release #specific branch or release
lang_tag="v0.8.0" aquamarine_tag="v0.8.0"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time build_from_git $aquamarine_tag "aquamarine" "cmake_build" "cmake"
LOG="Install-Logs/install-$(date +%d-%H%M%S)_aquamarine.log"
MLOG="install-$(date +%d-%H%M%S)_aquamarine2.log"
# Installation of dependencies
printf "\n%s - Installing ${YELLOW}aquamarine dependencies${RESET} .... \n" "${INFO}"
# Check if aquamarine directory exists and remove it
if [ -d "aquamarine" ]; then
rm -rf "aquamarine"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}aquamarine $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/aquamarine.git; then
cd aquamarine || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target aquamarine -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}aquamarine $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}aquamarine $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}aquamarine $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
printf "\n%.0s" {1..2}

View File

@ -3,33 +3,44 @@
# Bluetooth # # Bluetooth #
blue=( blue=(
bluez bluez
blueman blueman
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
PARENT_DIR=$SCRIPT_DIR/..
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_bluetooth.log" LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_bluetooth.log"
# Bluetooth # Bluetooth
printf "${NOTE} Installing ${SKY_BLUE}Bluetooth${RESET} Packages...\n" echo "${NOTE} Installing ${SKY_BLUE}Bluetooth${RESET} Packages..."
for BLUE in "${blue[@]}"; do for BLUE in "${blue[@]}"; do
install_package "$BLUE" "$LOG" install_package "$BLUE" "$LOG"
done done
printf " Activating ${YELLOW}Bluetooth${RESET} Services...\n" echo " Activating ${YELLOW}Bluetooth${RESET} Services..."
sudo systemctl enable --now bluetooth.service 2>&1 | tee -a "$LOG" if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${NOTE} Not enabling service bluetooth.service with systemctl enable --now"
else
sudo systemctl enable --now bluetooth.service 2>&1 | tee -a "$LOG"
fi
printf "\n%.0s" {1..2} newlines 2

29
install-scripts/colors.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# shellcheck disable=SC2155
set -a
# Header guard because it is useless to execute the rest of this so many times
[[ -v SOURCED_COLORS ]] && return
SOURCED_COLORS=
# Set some colors for output messages
MAGENTA="$(tput setaf 5)"
YELLOW="$(tput setaf 226)"
RED="$(tput setaf 1)"
ORANGE="$(tput setaf 3)"
GREEN="$(tput setaf 2)"
BLUE="$(tput setaf 4)"
SKY_BLUE="$(tput setaf 12)"
GRAY="$(tput setaf 251)"
GREY=$GRAY
WARNING=$ORANGE
RESET="$(tput sgr0)"
OK="${GREEN}[OK]${RESET}"
ERROR="${RED}[ERROR]${RESET}"
NOTE="${GRAY}[NOTE]${RESET}"
INFO="${BLUE}[INFO]${RESET}"
WARN="${WARNING}[WARN]${RESET}"
CAT="${SKY_BLUE}[ACTION]${RESET}"
set +a

View File

@ -6,35 +6,48 @@
dots_tag="Deb-Untu-Dots" dots_tag="Deb-Untu-Dots"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source $SCRIPT_DIR/Global_functions.sh"
exit 1 exit 1
fi }
# Check if Hyprland-Dots exists # Check if Hyprland-Dots exists
printf "${NOTE} Cloning and Installing ${SKY_BLUE}KooL's Hyprland Dots for Debian${RESET}....\n" echo "${NOTE} Cloning and Installing ${SKY_BLUE}KooL's Hyprland Dots for Debian${RESET}...."
# Check if Hyprland-Dots exists # Check if Hyprland-Dots exists
if [ -d Hyprland-Dots-Debian ]; then if [ -d Hyprland-Dots-Debian ]; then
cd Hyprland-Dots-Debian || exit cd Hyprland-Dots-Debian || exit
git stash && git pull if [[ $PEDANTIC_DRY -eq 1 ]]; then
chmod +x copy.sh echo "${NOTE} I am not stashing and pulling the already existing $PARENT_DIR/Hyprland-Dots-Debian directory or copying KooL's Hyprland Dots."
./copy.sh else
git stash && git pull
chmod +x copy.sh
./copy.sh
fi
else else
if git clone --depth=1 -b $dots_tag https://github.com/JaKooLit/Hyprland-Dots Hyprland-Dots-Debian; then if [[ $PEDANTIC_DRY -eq 1 ]]; then
cd Hyprland-Dots-Debian || exit 1 echo "${NOTE} I am not fetching KooL's Hyprland-Dots-Debian repository or copying those files."
chmod +x copy.sh else
./copy.sh if git clone --depth=1 -b $dots_tag https://github.com/JaKooLit/Hyprland-Dots Hyprland-Dots-Debian; then
else cd Hyprland-Dots-Debian || exit 1
echo -e "$ERROR Can't download ${YELLOW}KooL's Hyprland-Dots-Debian${RESET}" chmod +x copy.sh
fi ./copy.sh
else
echo -e "$ERROR Can't download ${YELLOW}KooL's Hyprland-Dots-Debian${RESET}"
fi
fi
fi fi
printf "\n%.0s" {1..2} newlines 2

View File

@ -3,38 +3,45 @@
# Fonts Required # # Fonts Required #
fonts=( fonts=(
fonts-firacode fonts-firacode
fonts-font-awesome fonts-font-awesome
fonts-noto fonts-noto
fonts-noto-cjk fonts-noto-cjk
fonts-noto-color-emoji fonts-noto-color-emoji
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
PARENT_DIR=$SCRIPT_DIR/..
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_fonts.log" LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_fonts.log"
# Installation of main components # Installation of main components
printf "\n%s - Installing necessary ${SKY_BLUE}fonts${RESET}.... \n" "${NOTE}" newlines 1
echo "${NOTE} - Installing necessary ${SKY_BLUE}fonts${RESET}...."
for PKG1 in "${fonts[@]}"; do for PKG1 in "${fonts[@]}"; do
install_package "$PKG1" "$LOG" install_package "$PKG1" "$LOG"
done done
printf "\n%.0s" {1..2} newlines 2
# jetbrains nerd font. Necessary for waybar # jetbrains nerd font. Necessary for waybar
DOWNLOAD_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.tar.xz" DOWNLOAD_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.tar.xz"
@ -47,34 +54,46 @@ for ((ATTEMPT = 1; ATTEMPT <= MAX_ATTEMPTS; ATTEMPT++)); do
done done
# Check if the JetBrainsMono directory exists and delete it if it does # Check if the JetBrainsMono directory exists and delete it if it does
if [ -d ~/.local/share/fonts/JetBrainsMonoNerd ]; then remove_dir ~/.local/share/fonts/JetBrainsMonoNerd "$LOG"
rm -rf ~/.local/share/fonts/JetBrainsMonoNerd 2>&1 | tee -a "$LOG"
fi
mkdir -p ~/.local/share/fonts/JetBrainsMonoNerd 2>&1 | tee -a "$LOG" if [[ $PEDANTIC_DRY -eq 1 ]]; then
# Extract the new files into the JetBrainsMono directory and log the output echo "${NOTE}Not creating ~/.local/share/fonts/JetBrainsMonoNerd or extracting $PARENT_DIR/JetBrainsMonoNerd.tar.xz to that directory."
tar -xJkf JetBrainsMono.tar.xz -C ~/.local/share/fonts/JetBrainsMonoNerd 2>&1 | tee -a "$LOG"
# Fantasque Mono Nerd Font
if wget -q https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FantasqueSansMono.zip; then
mkdir -p "$HOME/.local/share/fonts/FantasqueSansMonoNerd" && unzip -o -q "FantasqueSansMono.zip" -d "$HOME/.local/share/fonts/FantasqueSansMono" && echo "FantasqueSansMono installed successfully" | tee -a "$LOG"
else else
echo -e "\n${ERROR} Failed to download ${YELLOW}Fantasque Sans Mono Nerd Font${RESET} Please check your connection\n" | tee -a "$LOG" mkdir -p ~/.local/share/fonts/JetBrainsMonoNerd 2>&1 | tee -a "$LOG"
# Extract the new files into the JetBrainsMono directory and log the output
tar -xJkf "$PARENT_DIR"/JetBrainsMono.tar.xz -C ~/.local/share/fonts/JetBrainsMonoNerd 2>&1 | tee -a "$LOG"
fi fi
# Victor Mono-Font if [[ $PEDANTIC_DRY -eq 1 ]]; then
if wget -q https://rubjo.github.io/victor-mono/VictorMonoAll.zip; then echo "${NOTE} Not installing Fantasque Mono Nerd Font."
mkdir -p "$HOME/.local/share/fonts/VictorMono" && unzip -o -q "VictorMonoAll.zip" -d "$HOME/.local/share/fonts/VictorMono" && echo "Victor Font installed successfully" | tee -a "$LOG"
else else
echo -e "\n${ERROR} Failed to download ${YELLOW}Victor Mono Font${RESET} Please check your connection\n" | tee -a "$LOG" # Fantasque Mono Nerd Font
if wget -q https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FantasqueSansMono.zip; then
mkdir -p "$HOME/.local/share/fonts/FantasqueSansMonoNerd" && unzip -o -q "FantasqueSansMono.zip" -d "$HOME/.local/share/fonts/FantasqueSansMono" && echo "FantasqueSansMono installed successfully" | tee -a "$LOG"
else
echo -e "\n${ERROR} Failed to download ${YELLOW}Fantasque Sans Mono Nerd Font${RESET} Please check your connection\n" | tee -a "$LOG"
fi
fi fi
# Update font cache and log the output if [[ $PEDANTIC_DRY -eq 1 ]]; then
fc-cache -v 2>&1 | tee -a "$LOG" echo "${NOTE} Not installing Victor Mono-Font"
else
# clean up # Victor Mono-Font
if [ -d "JetBrainsMono.tar.xz" ]; then if wget -q https://rubjo.github.io/victor-mono/VictorMonoAll.zip; then
rm -r JetBrainsMono.tar.xz 2>&1 | tee -a "$LOG" mkdir -p "$HOME/.local/share/fonts/VictorMono" && unzip -o -q "VictorMonoAll.zip" -d "$HOME/.local/share/fonts/VictorMono" && echo "Victor Font installed successfully" | tee -a "$LOG"
else
echo -e "\n${ERROR} Failed to download ${YELLOW}Victor Mono Font${RESET} Please check your connection\n" | tee -a "$LOG"
fi
fi fi
printf "\n%.0s" {1..2} if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${NOTE}Not updating the font cache with fc-cache"
else
# Update font cache and log the output
fc-cache -v 2>&1 | tee -a "$LOG"
fi
# clean up
remove_file "$PARENT_DIR"/JetBrainsMono.tar.xz "$LOG"
newlines 2

View File

@ -8,43 +8,56 @@ engine=(
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -euo pipefail
IFS=$'\n\t'
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_themes.log" LOG="Install-Logs/install-$(date +%d-%H%M%S)_themes.log"
# installing engine needed for gtk themes # installing engine needed for gtk themes
verbose_log "Installing dependencies for gtk themes"
for PKG1 in "${engine[@]}"; do for PKG1 in "${engine[@]}"; do
install_package "$PKG1" "$LOG" install_package "$PKG1" "$LOG"
done done
# Check if the directory exists and delete it if present # Check if the directory exists and delete it if present
if [ -d "GTK-themes-icons" ]; then remove_dir "GTK-themes-icons"
echo "$NOTE GTK themes and Icons directory exist..deleting..." 2>&1 | tee -a "$LOG"
rm -rf "GTK-themes-icons" 2>&1 | tee -a "$LOG"
fi
echo "$NOTE Cloning ${SKY_BLUE}GTK themes and Icons${RESET} repository..." 2>&1 | tee -a "$LOG" echo "$NOTE Cloning ${SKY_BLUE}GTK themes and Icons${RESET} repository..." 2>&1 | tee -a "$LOG"
if git clone --depth=1 https://github.com/JaKooLit/GTK-themes-icons.git ; then if [[ $NO_BUILD -eq 1 ]]; then
( echo "${NOTE} Not cloning or building https://github.com/JaKooLit/GTK-themes-icons.git"
cd GTK-themes-icons || exit 1
chmod +x auto-extract.sh
./auto-extract.sh
)
echo "$OK Extracted GTK Themes & Icons to ~/.icons & ~/.themes directories" 2>&1 | tee -a "$LOG"
else else
echo "$ERROR Download failed for GTK themes and Icons.." 2>&1 | tee -a "$LOG" if git clone --depth=1 https://github.com/JaKooLit/GTK-themes-icons.git; then
(
cd GTK-themes-icons || exit 1
if [[ $PEDANTIC_DRY -eq 1 ]]; then
echo "${NOTE} Not running auto-extract.sh or setting it to be executable as we do not want to modify files"
else
chmod +x auto-extract.sh
./auto-extract.sh
fi
)
echo "$OK Extracted GTK Themes & Icons to ~/.icons & ~/.themes directories" 2>&1 | tee -a "$LOG"
else
echo "$ERROR Download failed for GTK themes and Icons.." 2>&1 | tee -a "$LOG"
fi
fi fi
printf "\n%.0s" {1..2} newlines 2

View File

@ -2,51 +2,23 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprcursor # # hyprcursor #
#specific branch or release #specific branch or release
lang_tag="v0.1.12" hyprcursor_tag="v0.1.12"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time execute_script "hyprlang.sh" # Depends on hyprutils
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprcursor.log" sleep 1
MLOG="install-$(date +%d-%H%M%S)_hyprcursor2.log"
# Installation of dependencies build_from_git $hyprcursor_tag "hyprcursor" "cmake_build" "cmake"
printf "\n%s - Installing ${YELLOW}hyprcursor dependencies${RESET} .... \n" "${INFO}"
# Check if hyprcursor directory exists and remove it
if [ -d "hyprcursor" ]; then
rm -rf "hyprcursor"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprcursor $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprcursor.git; then
cd hyprcursor || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprcursor $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprcursor $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprcursor $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprcursor" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -2,51 +2,20 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprgraphics # # hyprgraphics #
#specific branch or release #specific branch or release
lang_tag="v0.1.3" hyprgraphics_tag="v0.1.3"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time build_from_git $hyprgraphics_tag "hyprgraphics" "cmake_build" "cmake"
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprgraphics.log"
MLOG="install-$(date +%d-%H%M%S)_hyprgraphics2.log"
# Installation of dependencies
printf "\n%s - Installing ${YELLOW}hyprgraphics dependencies${RESET} .... \n" "${INFO}"
# Check if hyprgraphics directory exists and remove it
if [ -d "hyprgraphics" ]; then
rm -rf "hyprgraphics"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprgraphics $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprgraphics.git; then
cd hyprgraphics || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target hyprgraphics -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprgraphics $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprgraphics $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprgraphics $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprgraphics" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -7,57 +7,33 @@ idle=(
) )
#specific branch or release #specific branch or release
idle_tag="v0.1.6" hypridle_tag="v0.1.6"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hypridle.log" LOG="Install-Logs/install-$(date +%d-%H%M%S)_hypridle_install_dependencies.log"
MLOG="install-$(date +%d-%H%M%S)_hypridle2.log"
# Installation of dependencies # Installation of dependencies
printf "\n%s - Installing ${YELLOW}hypridle dependencies${RESET} .... \n" "${INFO}" printf "\n%s - Installing ${YELLOW}hypridle dependencies${RESET} .... \n" "${INFO}"
for PKG1 in "${idle[@]}"; do for PKG1 in "${idle[@]}"; do
re_install_package "$PKG1" 2>&1 | tee -a "$LOG" re_install_package "$PKG1" 2>&1 | tee -a "$LOG"
if [ $? -ne 0 ]; then if ! re_install_package "$PKG1" 2>&1 | tee -a "$LOG"; then
echo -e "\e[1A\e[K${ERROR} - ${YELLOW}$PKG1${RESET} Package installation failed, Please check the installation logs" echo -e "\e[1A\e[K${ERROR} - ${YELLOW}$PKG1${RESET} Package installation failed, Please check the installation logs"
exit 1 exit 1
fi fi
done done
# Check if hypridle directory exists and remove it build_from_git $hypridle_tag "hypridle" "cmake_build" "cmake"
if [ -d "hypridle" ]; then
rm -rf "hypridle"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hypridle $idle_tag${RESET} ...\n"
if git clone --recursive -b $idle_tag https://github.com/hyprwm/hypridle.git; then
cd hypridle || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
cmake --build ./build --config Release --target hypridle -j"$(nproc 2>/dev/null || getconf NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hypridle $idle_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hypridle $idle_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hypridle $idle_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hypridle" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -2,50 +2,20 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprland-protocols # # hyprland-protocols #
#specific branch or release #specific branch or release
lang_tag="v0.6.4" hyprland_protocols_tag="v0.6.4"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time build_from_git $hyprland_protocols_tag "hyprland-protocols" "meson" "meson"
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprland-protocols.log"
MLOG="install-$(date +%d-%H%M%S)_hyprland-protocols2.log"
# Installation of dependencies
printf "\n%s - Installing ${YELLOW}hyprland-protocols dependencies${RESET} .... \n" "${INFO}"
# Check if hyprland-protocols directory exists and remove it
if [ -d "hyprland-protocols" ]; then
rm -rf "hyprland-protocols"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprland-protocols $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprland-protocols.git; then
cd hyprland-protocols || exit 1
meson setup build
if sudo meson install -C ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprland-protocols $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprland-protocols $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprland-protocols $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprland-protocols" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -2,51 +2,20 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprland-qt-support # # hyprland-qt-support #
#specific branch or release #specific branch or release
lang_tag="v0.1.0" hyprland_qt_support="v0.1.0"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time build_from_git $hyprland_qt_support "hyprland-qt-support" "hyprland-qt-support" "cmake"
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprland-qt-support.log"
MLOG="install-$(date +%d-%H%M%S)_hyprland-qt-support2.log"
# Installation of dependencies
printf "\n%s - Installing ${YELLOW}hyprland-qt-support dependencies${RESET} .... \n" "${INFO}"
# Check if hyprland-qt-support directory exists and remove it
if [ -d "hyprland-qt-support" ]; then
rm -rf "hyprland-qt-support"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprland-qt-support $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprland-qt-support.git; then
cd hyprland-qt-support || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINSTALL_QML_PREFIX=/usr/lib/x86_64-linux-gnu/qt6/qml -S . -B ./build
cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprland-qt-support $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprland-qt-support $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprland-qt-support $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprland-qt-support" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -2,51 +2,23 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprland-qtutils # # hyprland-qtutils #
#specific branch or release #specific branch or release
lang_tag="v0.1.4" hyprland_qtutils_tag="v0.1.4"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -euo pipefail
IFS=$'\n\t'
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time build_from_git $hyprland_qtutils_tag "hyprland-qtutils" "cmake_build" "cmake"
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprland-qtutils.log"
MLOG="install-$(date +%d-%H%M%S)_hyprland-qtutils2.log"
# Installation of dependencies
printf "\n%s - Installing ${YELLOW}hyprland-qtutils dependencies${RESET} .... \n" "${INFO}"
# Check if hyprland-qtutils directory exists and remove it
if [ -d "hyprland-qtutils" ]; then
rm -rf "hyprland-qtutils"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprland-qtutils $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprland-qtutils.git; then
cd hyprland-qtutils || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprland-qtutils $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprland-qtutils $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprland-qtutils $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprland-qtutils" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -2,51 +2,40 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprland # # hyprland #
#specific branch or release #specific branch or release
lang_tag="v0.49.0" hyprland_tag="v0.49.0"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time verbose_log "Need to build hyprland dependencies from source first."
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprland.log" # Dependencies
MLOG="install-$(date +%d-%H%M%S)_hyprland2.log" execute_script "hyprcursor.sh" # Depends on hyprlang
sleep 1
execute_script "hyprgraphics.sh"
sleep 1
execute_script "hyprland-qt-support.sh"
sleep 1
execute_script "hyprland-qtutils.sh"
sleep 1
execute_script "hyprwayland-scanner.sh"
sleep 1
execute_script "aquamarine.sh"
sleep 1
execute_script "hyprland-protocols.sh"
sleep 1
execute_script "hypridle.sh"
sleep 1
execute_script "hyprlock.sh"
# Installation of dependencies build_from_git $hyprland_tag "hyprland" "cmake_build" "cmake"
printf "\n%s - Installing ${YELLOW}hyprland dependencies${RESET} .... \n" "${INFO}"
# Check if hyprland directory exists and remove it
if [ -d "hyprland" ]; then
rm -rf "hyprland"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprland $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprland.git; then
cd hyprland || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprland $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprland $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprland $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprland" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -2,51 +2,23 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprlang # # hyprlang #
#specific branch or release #specific branch or release
lang_tag="v0.6.3" hyprlang_tag="v0.6.3"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time execute_script "hyprutils.sh" # Order is very specific for dependencies are scattered
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprlang.log" sleep 1
MLOG="install-$(date +%d-%H%M%S)_hyprlang2.log"
# Installation of dependencies build_from_git $hyprlang_tag "hyprlang" "cmake_build" "cmake"
printf "\n%s - Installing ${YELLOW}hyprlang dependencies${RESET} .... \n" "${INFO}"
# Check if hyprlang directory exists and remove it
if [ -d "hyprlang" ]; then
rm -rf "hyprlang"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprlang $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprlang.git; then
cd hyprlang || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target hyprlang -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprlang $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprlang $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprlang $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprlang" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -3,61 +3,45 @@
# hyprlock # # hyprlock #
lock=( lock=(
libpam0g-dev libpam0g-dev
libgbm-dev libgbm-dev
libdrm-dev libdrm-dev
libmagic-dev libmagic-dev
libsdbus-c++-dev libsdbus-c++-dev
) )
#specific branch or release #specific branch or release
lock_tag="v0.8.2" hyprlock_tag="v0.8.2"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -euo pipefail
IFS=$'\n\t'
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprlock.log" LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprlock_install_dependencies.log"
MLOG="install-$(date +%d-%H%M%S)_hyprlock2.log"
# Installation of dependencies # Installation of dependencies
printf "\n%s - Installing ${YELLOW}hyprlock dependencies${RESET} .... \n" "${INFO}" printf "\n%s - Installing ${YELLOW}hyprlock dependencies${RESET} .... \n" "${INFO}"
for PKG1 in "${lock[@]}"; do for PKG1 in "${lock[@]}"; do
re_install_package "$PKG1" "$LOG" re_install_package "$PKG1" "$LOG"
done done
# Check if hyprlock directory exists and remove it build_from_git $hyprlock_tag "hyprlock" "cmake_build" "cmake"
if [ -d "hyprlock" ]; then
rm -rf "hyprlock"
fi
# Clone and build hyprlock
printf "${INFO} Installing ${YELLOW}hyprlock $lock_tag${RESET} ...\n"
if git clone --recursive -b $lock_tag https://github.com/hyprwm/hyprlock.git; then
cd hyprlock || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
cmake --build ./build --config Release --target hyprlock -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${YELLOW}hyprlock $lock_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprlock $lock_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprlock $lock_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprlock" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -2,51 +2,20 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprutils # # hyprutils #
#specific branch or release #specific branch or release
lang_tag="v0.7.1" hyprutils_tag="v0.7.1"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time build_from_git $hyprutils_tag "hyprutils" "cmake_build" "cmake"
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprutils.log"
MLOG="install-$(date +%d-%H%M%S)_hyprutils2.log"
# Installation of dependencies
printf "\n%s - Installing ${YELLOW}hyprutils dependencies${RESET} .... \n" "${INFO}"
# Check if hyprutils directory exists and remove it
if [ -d "hyprutils" ]; then
rm -rf "hyprutils"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprutils $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprutils.git; then
cd hyprutils || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target hyprutils -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprutils $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprutils $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprutils $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprutils" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -2,51 +2,20 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# hyprwayland-scanner # # hyprwayland-scanner #
#specific branch or release #specific branch or release
lang_tag="v0.4.4" hyprwayland_scanner_tag="v0.4.4"
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time build_from_git $hyprwayland_scanner_tag "hyprwayland-scanner" "hyprwayland-scanner" "cmake"
LOG="Install-Logs/install-$(date +%d-%H%M%S)_hyprwayland-scanner.log"
MLOG="install-$(date +%d-%H%M%S)_hyprwayland-scanner2.log"
# Installation of dependencies
printf "\n%s - Installing ${YELLOW}hyprwayland-scanner dependencies${RESET} .... \n" "${INFO}"
# Check if hyprwayland-scanner directory exists and remove it
if [ -d "hyprwayland-scanner" ]; then
rm -rf "hyprwayland-scanner"
fi
# Clone and build
printf "${INFO} Installing ${YELLOW}hyprwayland-scanner $lang_tag${RESET} ...\n"
if git clone --recursive -b $lang_tag https://github.com/hyprwm/hyprwayland-scanner.git; then
cd hyprwayland-scanner || exit 1
cmake -DCMAKE_INSTALL_PREFIX=/usr -B build
cmake --build build -j "$(nproc)"
if sudo cmake --install ./build 2>&1 | tee -a "$MLOG" ; then
printf "${OK} ${MAGENTA}hyprwayland-scanner $lang_tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else
echo -e "${ERROR} Installation failed for ${YELLOW}hyprwayland-scanner $lang_tag${RESET}" 2>&1 | tee -a "$MLOG"
fi
#moving the addional logs to Install-Logs directory
mv "$MLOG" ../Install-Logs/ || true
cd ..
else
echo -e "${ERROR} Download failed for ${YELLOW}hyprwayland-scanner $lang_tag${RESET}" 2>&1 | tee -a "$LOG"
fi
rm -rf "hyprwayland-scanner" # Cleanup
printf "\n%.0s" {1..2}

View File

@ -4,53 +4,81 @@
# UBUNTU USERS, FOLLOW README! # UBUNTU USERS, FOLLOW README!
nvidia_pkg=( nvidia_pkg=(
nvidia-driver nvidia-driver
firmware-misc-nonfree firmware-misc-nonfree
nvidia-kernel-dkms nvidia-kernel-dkms
linux-headers-"$(uname -r)" linux-headers-"$(uname -r)"
libnvidia-egl-wayland1 libnvidia-egl-wayland1
libva-wayland2 libva-wayland2
libnvidia-egl-wayland1 libnvidia-egl-wayland1
nvidia-vaapi-driver nvidia-vaapi-driver
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -euo pipefail
IFS=$'\n\t'
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_nvidia.log" LOG="Install-Logs/install-$(date +%d-%H%M%S)_nvidia.log"
MLOG="install-$(date +%d-%H%M%S)_nvidia2.log" MLOG="install-$(date +%d-%H%M%S)_nvidia2.log"
## adding the deb source for nvidia driver if [[ $DRY -eq 1 ]]; then
# Create a backup of the sources.list file echo "Not creating /etc/apt/sources.list.d/sid.sources to fetch packages from Debian Sid (unstable)"
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup 2>&1 | tee -a "$LOG" else
## adding the deb source for nvidia driver
# Create a backup of the sources.list file
if [[ -f /etc/apt/sources.list.d/sid.sources ]]; then
verbose_log "Copying /etc/apt/sources.list.d/sid.sources to /etc/apt/sources.list.d/sid.sources.backup with sudo cp -a since /etc/apt/sources.list.d/sid.sources exists"
sudo cp -a /etc/apt/sources.list.d/sid.sources /etc/apt/sources.list.d/sid.sources.backup 2>&1 | tee -a "$LOG"
else
verbose_log "/etc/apt/sources.list.d/sid.sources nonexistent, so not backing up with cp"
fi
## UBUNTU - NVIDIA (comment this two by adding # you dont need this!) ## UBUNTU - NVIDIA (comment this nine by adding # you don't need this!)
# Add the comment and repository entry to sources.list # Add the comment and repository entry to sources.list
echo "## for nvidia" | sudo tee -a /etc/apt/sources.list 2>&1 | tee -a "$LOG" echo "## for nvidia" | sudo tee -a /etc/apt/sources.list.d/sid.sources 2>&1 | tee -a "$LOG"
echo "deb http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware" | sudo tee -a /etc/apt/sources.list 2>&1 | tee -a "$LOG" cat "/etc/apt/sources.list.d/sid.sources" <<EOF
Types: deb deb-src
URIs: https://deb.debian.org/debian/
Suites: unstable
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Architectures: amd64
EOF
# Update the package list # Update the package list
sudo apt update sudo apt update
fi
# Function to add a value to a configuration file if not present # Function to add a value to a configuration file if not present
add_to_file() { add_to_file() {
local config_file="$1" local config_file="$1"
local value="$2" local value="$2"
if ! sudo grep -q "$value" "$config_file"; then if ! sudo grep -q "$value" "$config_file"; then
echo "Adding $value to $config_file" echo "Adding $value to $config_file"
sudo sh -c "echo '$value' >> '$config_file'" if [[ $DRY -eq 1 ]]; then
echo "${NOTE} Not adding $value to $config_file"
else
sudo sh -c "echo '$value' >> '$config_file'"
fi
else else
echo "$value is already present in $config_file." echo "$value is already present in $config_file."
fi fi
@ -58,52 +86,68 @@ add_to_file() {
# Install additional Nvidia packages # Install additional Nvidia packages
printf "${YELLOW} Installing ${SKY_BLUE}Nvidia packages${RESET} ...\n" printf "${YELLOW} Installing ${SKY_BLUE}Nvidia packages${RESET} ...\n"
for NVIDIA in "${nvidia_pkg[@]}"; do for NVIDIA in "${nvidia_pkg[@]}"; do
install_package "$NVIDIA" "$LOG" install_package "$NVIDIA" "$LOG"
done done
# adding additional nvidia-stuff # adding additional nvidia-stuff
printf "${YELLOW} adding ${SKY_BLUE}nvidia-stuff${RESET} to /etc/default/grub..." printf "${YELLOW} adding ${SKY_BLUE}nvidia-stuff${RESET} to /etc/default/grub..."
# Additional options to add to GRUB_CMDLINE_LINUX # Additional options to add to GRUB_CMDLINE_LINUX
additional_options="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rcutree.rcu_idle_gp_delay=1" additional_options="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rcutree.rcu_idle_gp_delay=1"
# Check if additional options are already present in GRUB_CMDLINE_LINUX # Check if additional options are already present in GRUB_CMDLINE_LINUX
if grep -q "GRUB_CMDLINE_LINUX.*$additional_options" /etc/default/grub; then if grep -q "GRUB_CMDLINE_LINUX.*$additional_options" /etc/default/grub; then
echo "GRUB_CMDLINE_LINUX already contains the additional options" echo "GRUB_CMDLINE_LINUX already contains the additional options"
else else
# Append the additional options to GRUB_CMDLINE_LINUX if [[ $DRY -eq 1 ]]; then
sudo sed -i "s/GRUB_CMDLINE_LINUX=\"/GRUB_CMDLINE_LINUX=\"$additional_options /" /etc/default/grub echo "${NOTE} Not adding 'rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rcutree.rcu_idle_gp_delay=1' to GRUB_CMDLINE_LINUX in /etc/default/grub"
echo "Added the additional options to GRUB_CMDLINE_LINUX" else
fi # Append the additional options to GRUB_CMDLINE_LINUX
sudo sed -i "s/GRUB_CMDLINE_LINUX=\"/GRUB_CMDLINE_LINUX=\"$additional_options /" /etc/default/grub
echo "Added the additional options to GRUB_CMDLINE_LINUX"
fi
fi
# Update GRUB configuration if [[ $DRY -eq 1 ]]; then
sudo update-grub 2>&1 | tee -a "$LOG" echo "${NOTE} Not updating GRUB configuration with sudo update-grub"
else
# Define the configuration file and the line to add # Update GRUB configuration
config_file="/etc/modprobe.d/nvidia.conf" sudo update-grub 2>&1 | tee -a "$LOG"
line_to_add=""" fi
# Define the configuration file and the line to add
config_file="/etc/modprobe.d/nvidia.conf"
line_to_add="""
options nvidia-drm modeset=1 fbdev=1 options nvidia-drm modeset=1 fbdev=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1 options nvidia NVreg_PreserveVideoMemoryAllocations=1
""" """
# Check if the config file exists # Check if the config file exists
if [ ! -e "$config_file" ]; then if [ ! -e "$config_file" ]; then
echo "Creating $config_file" echo "Creating $config_file"
if [[ $DRY -eq 1 ]]; then
echo "${NOTE} Not creating $config_file with touch"
else
sudo touch "$config_file" 2>&1 | tee -a "$LOG" sudo touch "$config_file" 2>&1 | tee -a "$LOG"
fi fi
fi
add_to_file "$config_file" "$line_to_add" add_to_file "$config_file" "$line_to_add"
# Add NVIDIA modules to initramfs configuration # Add NVIDIA modules to initramfs configuration
modules_to_add="nvidia nvidia_modeset nvidia_uvm nvidia_drm" modules_to_add="nvidia nvidia_modeset nvidia_uvm nvidia_drm"
modules_file="/etc/initramfs-tools/modules" modules_file="/etc/initramfs-tools/modules"
if [ -e "$modules_file" ]; then if [ -e "$modules_file" ]; then
add_to_file "$modules_file" "$modules_to_add" 2>&1 | tee -a "$LOG" add_to_file "$modules_file" "$modules_to_add" 2>&1 | tee -a "$LOG"
sudo update-initramfs -u 2>&1 | tee -a "$LOG" if [[ $DRY -eq 1 ]]; then
else echo "${NOTE} Not updating initramfs with sudo update-initramfs -uk all"
else
sudo update-initramfs -uk all 2>&1 | tee -a "$LOG"
fi
else
echo "Modules file ($modules_file) not found." 2>&1 | tee -a "$LOG" echo "Modules file ($modules_file) not found." 2>&1 | tee -a "$LOG"
fi fi
printf "\n%.0s" {1..2} newlines 2

254
install-scripts/parse_args.sh Executable file
View File

@ -0,0 +1,254 @@
#!/bin/bash
# Helper file for parsing arguments, exposing only the parse_args function and important argument variables
# Argument parsing is for install.sh though
set -aeuo pipefail
IFS=$'\n\t'
# Header guard since this should be executed only once
[[ -v SOURCED_PARSE_ARGS ]] && return
SOURCED_PARSE_ARGS=
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
source "$SCRIPT_DIR/colors.sh" || {
echo "Failed to source colors.sh"
exit 1
}
# Define main argument variables
if [[ ! -v VERBOSE ]]; then
VERBOSE=0
DRY=0
DRY_RUN_DIR_SET=0
DRY_RUN_DIR=""
PEDANTIC_DRY=0
NO_BUILD=0
PRESET=""
PRESET_ENABLED=0
PURGE=0
fi
# Parse arguments by passing "$@" to this for ./install.sh
parse_args() {
# Are there no arguments? If so, this is a useless function
if [[ $# -eq 0 ]]; then return; fi
# Define argument parsing options
LONGOPTS=help,verbose,dry-run,dry-run-dir:,pedantic-dry-run,no-build,preset:
SHORTOPTS=hvd:p:
# Print help message
print_help() {
echo "Usage: $0 [-hv] [-d DRY_RUN_DIR] [-p PRESET] [--dry-run] [--dry-run-dir DRY_RUN_DIR] [--pedantic-dry-run] [--help] [--verbose]"
echo "[--preset PRESET]"
echo "Run the install script for KooL's automated install of Hyprland for Debian Trixie/Sid."
echo
echo "${WARNING}Please be sure to backup your system before running this script as it will"
echo "FORCIBLY INSTALL AND REMOVE packages WITHOUT user intervention.${RESET}"
echo "PLEASE NOTE: Run this script from the directory this script is in."
echo
echo " -h, --help display this help message and exit successfully"
echo " -v, --verbose be loud and verbose; output many debugging messages"
echo
echo "The following section is intended for developers:"
echo "Additionally, they are designed to try not to modify files outside this script's directory."
echo " --dry-run do a dry run by installing to a test dir, specified with"
echo "the --dry-run-dir option; aka don't possibly break your system. Do note, apt packages will be"
echo "installed for this script, but the Install-Logs directory will not be created if nonexistent."
echo " -d, --dry-run-dir=DRY_RUN_DIR specify directory to do the dry run installation into;"
echo "defaults to this script's directory's faux-install-dir directory, which will be"
echo "automatically created. Specify DRY_RUN_DIR to install there instead, but you have to create the"
echo "directory yourself. Can only be used when using the --dry-run option"
echo " --pedantic-dry-run absolutely do not install apt packages, so assuming you have"
echo "them all. Also do not synchronize package index files with sudo apt update. Attempts to not modify"
echo "any file except for building. Overrides --dry-run"
echo "option, and the same rules for --dry-run-dir or -d applies."
echo " --no-build don't build anything from source. Can only be used with either"
echo "the --dry-run/-d or --pedantic-dry-run options. This will probably cause the script to fail."
echo
echo
echo " -p, --preset=PRESET specify preset file, which can be, for example, preset.sh in"
echo "the Debian-Hyprland directory. See that preset.sh file for details."
echo " --purge When removing packages, purge (delete all configuration files)"
echo "them. Dangerous if you want to keep them. This also purges autoremoved packages."
echo
echo "Hint: You do not have to specify the whole argument name as getopt tries to fill the rest in, unless"
echo "what was entered is ambiguous. Example: --pedantic-dr is synonymous with --pedantic-dry-run."
echo
echo "View repository and complain about bugs to: <https://github.com/JaKooLit/Debian-Hyprland/>"
}
# Function to test if GNU's enhanced getopt works
parse_args_setup() {
ENHANCED_GETOPT=1
# Temporarily disable Bash from exiting if command has error
set +e
# Test if GNU's enhanced getopt exists
getopt --test 2>/dev/null
if [[ $? -ne 4 ]]; then
echo "${GRAY}I require GNU's enhanced getopt to parse arguments."
echo "You can continue without parsing arguments or install util-linux,"
echo "which should have been installed on Debian.${RESET}"
ENHANCED_GETOPT=0
fi
# Back to being strict
set -e
if [[ "$ENHANCED_GETOPT" == 0 ]]; then
read -rp "Would you like to continue without parsing arguments? [y/N]: " confirm
case "$confirm" in
[yY][eE][sS] | [yY])
echo "${OK} Ignoring arguments and continuing installation..."
;;
*)
echo "${NOTE} You chose not to continue. Exiting..."
exit 1
;;
esac
fi
}
# Specfically check for help and verbose argument first to allow verbosity for everything even if option is not in order
parse_first_args() {
if [[ "$ENHANCED_GETOPT" == 1 ]]; then
if ! PARSED=$(getopt --options "${SHORTOPTS}" --longoptions "${LONGOPTS}" --name "$0" -- "$@"); then
echo "${ERROR} Failed to use getopt to parse arguments! Exiting with atypical error code 2..."
exit 2
fi
eval set -- "${PARSED}"
while [[ $# -gt 0 ]]; do
case $1 in
-h | --help)
print_help
exit 0
;;
-v | --verbose)
VERBOSE=1
echo "${CAT} Enabled verbose mode."
;;
esac
shift
done
fi
}
# Check validity and saneness of arguments
check_sane_arguments() {
if [[ $DRY -eq 1 && $PEDANTIC_DRY -eq 1 ]]; then
echo "${INFO} --pedantic-dry-run overrides the --dry-run option, so also enabling dry run mode."
DRY=1
fi
# When dry and pedantic dry are both disabled
if [[ $DRY -eq 0 && $PEDANTIC_DRY -eq 0 ]]; then
if [[ $DRY_RUN_DIR_SET -eq 1 ]]; then
echo "${WARN} Ignoring --dry-run-dir option as the --dry-run or --pedantic-dry-run option is not enabled."
DRY_RUN_DIR_SET=0
elif [[ $NO_BUILD -eq 1 ]]; then
echo "${WARN} Ignoring --no-build option as the --dry-run or --pedantic-dry-run option is not enabled."
NO_BUILD=0
fi
fi
if [[ $DRY -eq 1 && $DRY_RUN_DIR_SET -eq 0 ]]; then
echo "${WARN} Using ${WORKING_DIR}/faux-install-dir since --dry-run-dir was not set."
DRY_RUN_DIR="$WORKING_DIR"/faux-install-dir
verbose_log "DRY_RUN_DIR is now ${DRY_RUN_DIR}"
fi
# If DRY_RUN_DIR_SET is 1, which means --dry-run-dir or -d was passed as an argument, and DRY_RUN_DIR is not a directory
if [[ $DRY_RUN_DIR_SET -eq 1 && (! -d "$DRY_RUN_DIR") ]]; then
echo "${ERROR} --dry-run-dir option set to $DRY_RUN_DIR is not a valid directory. Exiting..."
exit 1
fi
# If PRESET_ENABLED is 1, which means --preset or -p was passed as an argument, and PRESET is a file that does not exist
if [[ $PRESET_ENABLED -eq 1 ]]; then
if [[ ! -f "$PRESET" ]]; then
PRESET_ENABLED=0
echo "${WARN} ⚠️ Preset file not found or invalid: $PRESET. Using default values."
else
PRESET_ENABLED=1
verbose_log "PRESET_ENABLED set to 1 as PRESET, $PRESET, is a file that exists."
fi
else
verbose_log "Not using preset since --preset was not specified"
fi
if [[ $DRY -eq 1 && $PURGE -eq 1 ]]; then
echo "${WARN} Purge mode will not have any real effect with dry or pedantic dry mode."
fi
}
parse_args_setup
# Time to handle arguments (or not if system does not support GNU's enhanced getopt or no arguments were passed)
if [[ $ENHANCED_GETOPT -eq 1 ]]; then
parse_first_args "$@"
if ! PARSED=$(getopt --options "${SHORTOPTS}" --longoptions "${LONGOPTS}" --name "$0" -- "$@"); then
echo "${ERROR} Failed to use getopt to parse arguments! Exiting with atypical error code 2..."
exit 2
fi
verbose_log "Parsed with getopt: $PARSED"
eval set -- "${PARSED}"
while [[ $# -gt 0 ]]; do
verbose_log "Met argument $1"
case $1 in
-h | --help)
# Already handled in parse_first_args local function, so this is a noop for reference
;;
-v | --verbose)
# Already handled in parse_first_args local function, so this is a noop for reference
;;
--dry-run)
DRY=1
verbose_log "Using dry run mode (does not install to system but to custom directory)"
;;
-d | --dry-run-dir)
shift 1
DRY_RUN_DIR_SET=1
DRY_RUN_DIR="$(realpath "$1")"
verbose_log "Setting DRY_RUN_DIR to $(realpath "$1")"
;;
--pedantic-dry-run)
PEDANTIC_DRY=1
echo "${NOTE} Using pedantic dry run mode, which will ${RED}NOT${RESET} install any packages but only build from source, even if you are missing apt packages. Use the --help or -h option for more info."
;;
--no-build)
NO_BUILD=1
echo "${NOTE} Using no build mode, which ${RED}DISABLES${RESET} building anything from source."
;;
-p | --preset)
shift 1
PRESET_ENABLED=1
PRESET="$(realpath "$1")"
verbose_log "Setting PRESET to $(realpath "$1")"
;;
--purge)
shift 1
PURGE=1
verbose_log
;;
--)
# For some reason, this option is always present when using getopt, so this is a noop
;;
*)
echo "${WARN} Ignoring positional argument: $1"
;;
esac
shift # Move to next argument
done
check_sane_arguments
fi
# End of arguments complaining and shenanigans with https://gist.github.com/mcnesium/bbfe60e4f43554cbc2880f2e7085956d used for help
}
set +a

View File

@ -4,81 +4,110 @@
# installing with NO-recommends # installing with NO-recommends
sddm1=( sddm1=(
sddm sddm
) )
sddm2=( sddm2=(
qt6-5compat-dev qt6-5compat-dev
qml6-module-qt5compat-graphicaleffects qml6-module-qt5compat-graphicaleffects
qt6-declarative-dev qt6-declarative-dev
qt6-svg-dev qt6-svg-dev
) )
# login managers to attempt to disable # login managers to attempt to disable
login=( login=(
lightdm lightdm
gdm3 gdm3
gdm gdm
lxdm lxdm
lxdm-gtk3 lxdm-gtk3
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
set -euo pipefail
IFS=$'\n\t'
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_sddm.log" LOG="Install-Logs/install-$(date +%d-%H%M%S)_sddm.log"
# Install SDDM (no-recommends) # Install SDDM (no-recommends)
printf "\n%s - Installing ${SKY_BLUE}SDDM and dependencies${RESET} .... \n" "${NOTE}" printf "\n%s - Installing ${SKY_BLUE}SDDM and dependencies${RESET} .... \n" "${NOTE}"
for PKG1 in "${sddm1[@]}" ; do for PKG1 in "${sddm1[@]}"; do
sudo apt install --no-install-recommends -y "$PKG1" | tee -a "$LOG" apt_install_no_recommends "$PKG1"
done done
# Installation of additional sddm stuff # Installation of additional sddm stuff
for PKG2 in "${sddm2[@]}"; do for PKG2 in "${sddm2[@]}"; do
install_package "$PKG2" "$LOG" install_package "$PKG2" "$LOG"
done done
# Check if other login managers are installed and disable their service before enabling SDDM # Check if other login managers are installed and disable their service before enabling SDDM
for login_manager in "${login[@]}"; do for login_manager in "${login[@]}"; do
if dpkg -l | grep -q "^ii $login_manager"; then if dpkg -l | grep -q "^ii $login_manager"; then
echo "Disabling $login_manager..." echo "Disabling $login_manager..."
# shellcheck disable=SC2024 if [[ $PEDANTIC_DRY -eq 1 ]]; then
sudo systemctl disable "$login_manager.service" >> "$LOG" 2>&1 || echo "Failed to disable $login_manager" >> "$LOG" echo "${NOTE} Not disabling $login_manager.service with systemctl disable"
echo "$login_manager disabled." else
fi sudo systemctl disable "$login_manager.service" | tee -a "$LOG" 2>&1 || echo "Failed to disable $login_manager" >>"$LOG"
fi
echo "$login_manager disabled."
fi
done done
# Double check with systemctl # Double check with systemctl
for manager in "${login[@]}"; do for manager in "${login[@]}"; do
if systemctl is-active --quiet "$manager.service" > /dev/null 2>&1; then if systemctl is-active --quiet "$manager.service" >/dev/null 2>&1; then
echo "$manager.service is active, disabling it..." >> "$LOG" 2>&1 echo "$manager.service is active, disabling it..." >>"$LOG" 2>&1
# shellcheck disable=SC2024 if [[ $DRY -eq 1 ]]; then
sudo systemctl disable "$manager.service" --now >> "$LOG" 2>&1 || echo "Failed to disable $manager.service" >> "$LOG" echo "${NOTE} Not disabling \"$manager.service\" with systemctl disable --now" >>"$LOG" 2>&1
else else
echo "$manager.service is not active" >> "$LOG" 2>&1 sudo systemctl disable "$manager.service" --now | tee -a "$LOG" 2>&1 || echo "Failed to disable $manager.service" >>"$LOG"
fi fi
else
echo "$manager.service is not active" >>"$LOG" 2>&1
fi
done done
printf "\n%.0s" {1..1} newlines 1
printf "${INFO} Activating sddm service........\n" echo "${INFO} Activating sddm service........"
sudo systemctl set-default graphical.target 2>&1 | tee -a "$LOG" if [[ $PEDANTIC_DRY -eq 1 ]]; then
sudo systemctl enable sddm.service 2>&1 | tee -a "$LOG" echo "${NOTE} Not setting graphical.target to be default or enabling sddm.service"
else
sudo systemctl set-default graphical.target 2>&1 | tee -a "$LOG"
sudo systemctl enable sddm.service 2>&1 | tee -a "$LOG"
fi
wayland_sessions_dir=/usr/share/wayland-sessions wayland_sessions_dir=/usr/share/wayland-sessions
[ ! -d "$wayland_sessions_dir" ] && { printf "$CAT - $wayland_sessions_dir not found, creating...\n"; sudo mkdir -p "$wayland_sessions_dir" 2>&1 | tee -a "$LOG"; } [ ! -d "$wayland_sessions_dir" ] && {
sudo cp assets/hyprland.desktop "$wayland_sessions_dir/" 2>&1 | tee -a "$LOG" echo "$CAT - $wayland_sessions_dir not found, creating..."
if [[ $DRY -eq 1 ]]; then
echo "${NOTE} Not making directory $wayland_sessions_dir with mkdir -p"
else
sudo mkdir -p "$wayland_sessions_dir" 2>&1 | tee -a "$LOG"
fi
}
printf "\n%.0s" {1..2} if [[ $DRY -eq 1 ]]; then
echo "${NOTE} Not copying assets/hyprland.desktop to $wayland_sessions_dir/ with cp"
else
sudo cp assets/hyprland.desktop "$wayland_sessions_dir/" 2>&1 | tee -a "$LOG"
fi
newlines 2

View File

@ -3,23 +3,28 @@
# wallust - pywal colors replacement # # wallust - pywal colors replacement #
wallust=( wallust=(
wallust wallust
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_wallust.log" LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_wallust.log"
# Create log directory if it doesn't exist # Create log directory if it doesn't exist
mkdir -p "$(dirname "$LOG")" mkdir -p "$(dirname "$LOG")"
@ -27,29 +32,29 @@ mkdir -p "$(dirname "$LOG")"
# Install up-to-date Rust # Install up-to-date Rust
echo "${INFO} Installing most ${YELLOW}up to date Rust compiler${RESET} ..." echo "${INFO} Installing most ${YELLOW}up to date Rust compiler${RESET} ..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 2>&1 | tee -a "$LOG" curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 2>&1 | tee -a "$LOG"
# shellcheck disable=SC1091
source "$HOME/.cargo/env" source "$HOME/.cargo/env"
printf "\n%.0s" {1..2} newlines 2
# Remove any existing Wallust binary # Remove any existing Wallust binary
if [[ -f "/usr/local/bin/wallust" ]]; then if [[ -f "/usr/local/bin/wallust" ]]; then
echo "Removing existing Wallust binary..." 2>&1 | tee -a "$LOG" echo "Removing existing Wallust binary..." 2>&1 | tee -a "$LOG"
sudo rm "/usr/local/bin/wallust" remove_file "/usr/local/bin/wallust"
fi fi
printf "\n%.0s" {1..2} newlines 2
# Install Wallust using Cargo # Install Wallust using Cargo
for WALL in "${wallust[@]}"; do for WALL in "${wallust[@]}"; do
cargo_install "$WALL" "$LOG" if cargo_install "$WALL" "$LOG"; then
if [ $? -eq 0 ]; then
echo "${OK} ${MAGENTA}Wallust${RESET} installed successfully." | tee -a "$LOG" echo "${OK} ${MAGENTA}Wallust${RESET} installed successfully." | tee -a "$LOG"
else else
echo "${ERROR} Installation of ${MAGENTA}$WALL${RESET} failed. Check the log file $LOG for details." | tee -a "$LOG" echo "${ERROR} Installation of ${MAGENTA}$WALL${RESET} failed. Check the log file $LOG for details." | tee -a "$LOG"
exit 1 exit 1
fi fi
done done
printf "\n%.0s" {1..1} newlines 1
# Move the newly compiled binary to /usr/local/bin # Move the newly compiled binary to /usr/local/bin
echo "Moving Wallust binary to /usr/local/bin..." | tee -a "$LOG" echo "Moving Wallust binary to /usr/local/bin..." | tee -a "$LOG"
if sudo mv "$HOME/.cargo/bin/wallust" /usr/local/bin 2>&1 | tee -a "$LOG"; then if sudo mv "$HOME/.cargo/bin/wallust" /usr/local/bin 2>&1 | tee -a "$LOG"; then
@ -59,5 +64,4 @@ else
exit 1 exit 1
fi fi
printf "\n%.0s" {1..2}
printf "\n%.0s" {1..2}

View File

@ -3,100 +3,100 @@
# Zsh and Oh my Zsh + Optional Pokemon ColorScripts# # Zsh and Oh my Zsh + Optional Pokemon ColorScripts#
zsh=( zsh=(
lsd lsd
zsh zsh
mercurial mercurial
zplug zplug
) )
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script set -euo pipefail
PARENT_DIR="$SCRIPT_DIR/.." IFS=$'\n\t'
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; }
SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then source "$SCRIPT_DIR/Global_functions.sh" || {
echo "Failed to source Global_functions.sh" echo "Failed to source Global_functions.sh"
exit 1 exit 1
fi }
# Set the name of the log file to include the current date and time # Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_zsh.log" LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_zsh.log"
# Check if the log file already exists, if yes, append a counter to make it unique # Check if the log file already exists, if yes, append a counter to make it unique
COUNTER=1 COUNTER=1
while [ -f "$LOG" ]; do while [ -f "$LOG" ]; do
LOG="Install-Logs/install-$(date +%d-%H%M%S)_${COUNTER}_zsh.log" LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_${COUNTER}_zsh.log"
((COUNTER++)) ((COUNTER++))
done done
# Installing zsh packages # Installing zsh packages
printf "${NOTE} Installing core zsh packages...${RESET}\n" echo "${NOTE} Installing core zsh packages..."
for ZSHP in "${zsh[@]}"; do for ZSHP in "${zsh[@]}"; do
install_package "$ZSHP" install_package "$ZSHP"
done done
printf "\n%.0s" {1..1} newlines 1
# Install Oh My Zsh, plugins, and set zsh as default shell # Install Oh My Zsh, plugins, and set zsh as default shell
if command -v zsh >/dev/null; then if command -v zsh >/dev/null; then
printf "${NOTE} Installing ${SKY_BLUE}Oh My Zsh and plugins${RESET} ...\n" echo "${NOTE} Installing ${SKY_BLUE}Oh My Zsh and plugins${RESET} ..."
if [ ! -d "$HOME/.oh-my-zsh" ]; then if [ ! -d "$HOME/.oh-my-zsh" ]; then
sh -c "$(curl -fsSL https://install.ohmyz.sh)" "" --unattended sh -c "$(curl -fsSL https://install.ohmyz.sh)" "" --unattended
else else
echo "${INFO} Directory .oh-my-zsh already exists. Skipping re-installation." 2>&1 | tee -a "$LOG" echo "${INFO} Directory .oh-my-zsh already exists. Skipping re-installation." 2>&1 | tee -a "$LOG"
fi fi
# Check if the directories exist before cloning the repositories
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]; then
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
else
echo "${INFO} Directory zsh-autosuggestions already exists. Cloning Skipped." 2>&1 | tee -a "$LOG"
fi
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]; then # Check if the directories exist before cloning the repositories
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]; then
else git clone https://github.com/zsh-users/zsh-autosuggestions "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/zsh-autosuggestions
echo "${INFO} Directory zsh-syntax-highlighting already exists. Cloning Skipped." 2>&1 | tee -a "$LOG" else
fi echo "${INFO} Directory zsh-autosuggestions already exists. Cloning Skipped." 2>&1 | tee -a "$LOG"
fi
# Check if ~/.zshrc and .zprofile exists, create a backup, and copy the new configuration
if [ -f "$HOME/.zshrc" ]; then
cp -b "$HOME/.zshrc" "$HOME/.zshrc-backup" || true
fi
if [ -f "$HOME/.zprofile" ]; then if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]; then
cp -b "$HOME/.zprofile" "$HOME/.zprofile-backup" || true git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/zsh-syntax-highlighting
fi else
echo "${INFO} Directory zsh-syntax-highlighting already exists. Cloning Skipped." 2>&1 | tee -a "$LOG"
# Copying the preconfigured zsh themes and profile fi
cp -r 'assets/.zshrc' ~/
cp -r 'assets/.zprofile' ~/
# Check if the current shell is zsh # Check if ~/.zshrc and .zprofile exists, create a backup, and copy the new configuration
current_shell=$(basename "$SHELL") if [ -f "$HOME/.zshrc" ]; then
if [ "$current_shell" != "zsh" ]; then cp -b "$HOME/.zshrc" "$HOME/.zshrc-backup" || true
printf "${NOTE} Changing default shell to ${MAGENTA}zsh${RESET}..." fi
printf "\n%.0s" {1..2}
# Loop to ensure the chsh command succeeds if [ -f "$HOME/.zprofile" ]; then
while ! chsh -s "$(command -v zsh)"; do cp -b "$HOME/.zprofile" "$HOME/.zprofile-backup" || true
echo "${ERROR} Authentication failed. Please enter the correct password." 2>&1 | tee -a "$LOG" fi
sleep 1
done
printf "${INFO} Shell changed successfully to ${MAGENTA}zsh${RESET}" 2>&1 | tee -a "$LOG" # Copying the preconfigured zsh themes and profile
else cp -r 'assets/.zshrc' ~/
echo "${NOTE} Your shell is already set to ${MAGENTA}zsh${RESET}." cp -r 'assets/.zprofile' ~/
fi
# Check if the current shell is zsh
current_shell=$(basename "$SHELL")
if [ "$current_shell" != "zsh" ]; then
echo "${NOTE} Changing default shell to ${MAGENTA}zsh${RESET}..."
newlines 1
# Loop to ensure the chsh command succeeds
while ! chsh -s "$(command -v zsh)"; do
echo "${ERROR} Authentication failed. Please enter the correct password." 2>&1 | tee -a "$LOG"
sleep 1
done
echo "${INFO} Shell changed successfully to ${MAGENTA}zsh${RESET}" 2>&1 | tee -a "$LOG"
else
echo "${NOTE} Your shell is already set to ${MAGENTA}zsh${RESET}."
fi
fi fi
# copy additional oh-my-zsh themes from assets # copy additional oh-my-zsh themes from assets
if [ -d "$HOME/.oh-my-zsh/themes" ]; then if [ -d "$HOME/.oh-my-zsh/themes" ]; then
cp -r assets/add_zsh_theme/* ~/.oh-my-zsh/themes >> "$LOG" 2>&1 cp -r "$PARENT_DIR"/assets/add_zsh_theme/* ~/.oh-my-zsh/themes >>"$LOG" 2>&1
fi fi
printf "\n%.0s" {1..2} newlines 2

View File

@ -1,87 +1,104 @@
#!/bin/bash #!/bin/bash
# https://github.com/JaKooLit # https://github.com/JaKooLit
clear # Do not complain about the following message in this file:
# Don't use variables in the printf format string. Use printf "..%s.." "$foo".
# Rationale: I want nice color formatting in printf.
# shellcheck disable=2059
# Set some colors for output messages # Let's be safer when programming in Bash
OK="$(tput setaf 2)[OK]$(tput sgr0)" set -euo pipefail
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" IFS=$'\n\t'
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
INFO="$(tput setaf 4)[INFO]$(tput sgr0)" PARENT_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
WARN="$(tput setaf 1)[WARN]$(tput sgr0)"
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" cd "$PARENT_DIR" || (echo "Failed to change directory to $PARENT_DIR, so exitting with error code 1." && exit 1)
MAGENTA="$(tput setaf 5)"
ORANGE="$(tput setaf 214)" # Set the name of the log file to include the current date and time
WARNING="$(tput setaf 1)" LOG="$PARENT_DIR/Install-Logs/01-Hyprland-Install-Scripts-$(date +%d-%H%M%S).log"
YELLOW="$(tput setaf 3)"
GREEN="$(tput setaf 2)" restore_cursor() {
BLUE="$(tput setaf 4)" tput cnorm
SKY_BLUE="$(tput setaf 6)" [[ $(type -t verbose_log) == "function" && -v VERBOSE ]] && verbose_log "Exiting, so restoring cursor in case 'tput civis' was executed."
RESET="$(tput sgr0)" }
cleanup() {
restore_cursor
echo -e "\n\n$1" | tee -a "$LOG"
exit 1
}
# In case user interrupts, switch back to old directory. Manually set colors for compatibility.
trap 'restore_cursor' EXIT
trap 'cleanup "$(tput setaf 4)[INFO]$(tput sgr0) Exiting by error encountered. (ERR)...\n$(tput setaf 251)[NOTE]$(tput sgr0) If you did not press Ctrl+D, check the most recent files in $PARENT_DIR/Install-Logs for possible reasons for such an early exit."' ERR
trap 'cleanup "$(tput setaf 12)[ACTION]$(tput sgr0) Exiting due to user-interrupt. (SIGINT)..."' SIGINT
trap 'cleanup "$(tput setaf 1)[ERROR]$(tput sgr0) Exiting due to abort signal. A critical error may have occurred internally. (SIGABRT)..."' SIGABRT
source "$PARENT_DIR/install-scripts/colors.sh" || {
echo "$(tput setaf 1)[ERROR]$(tput sgr0) Failed to source $PARENT_DIR/install-scripts/colors.sh" | tee -a "$LOG"
exit 1
}
# Check if running as root. If root, script will exit
if [[ $EUID -eq 0 ]]; then
echo "${ERROR} This script should ${RED}NOT${RESET} be executed as root!! Exiting......." | tee -a "$LOG"
printf "\n%.0s" {1..2}
exit 1
fi
source "$PARENT_DIR/install-scripts/Global_functions.sh" || {
echo "${ERROR} Failed to source $PARENT_DIR/install-scripts/Global_functions.sh" | tee -a "$LOG"
exit 1
}
parse_args "$@"
# Display warning message # Display warning message
echo -e "${WARNING}NOTE:${RESET} Hyprland on Repo is extremely outdated and will not be supported anymore." echo "${WARNING}WARNING:${RESET} Hyprland on Repo is extremely outdated and will not be supported anymore."
echo -e "Use this at your own risk." echo "Use this at your own risk."
echo -e "${WARNING}Any issues will not be dealt with${RESET}" echo "${RED}Any issues will not be dealt with${RESET}"
echo newlines 1
# Prompt user to continue or exit # Prompt user to continue or exit
read -rp "Do you want to continue with the installation? [y/N]: " confirm read -rp "Do you want to continue with the installation? [y/N]: " confirm
case "$confirm" in case "$confirm" in
[yY][eE][sS]|[yY]) [yY][eE][sS] | [yY])
echo -e "${OK} Continuing with installation..." echo "${OK} Continuing with installation..."
;; ;;
*) *)
echo -e "${NOTE} You chose not to continue. Exiting..." echo "${INFO} You chose not to continue. Exiting..."
exit 1
;;
esac
# Create Directory for Install Logs
if [ ! -d Install-Logs ]; then
mkdir Install-Logs
fi
# Set the name of the log file to include the current date and time
LOG="Install-Logs/01-Hyprland-Install-Scripts-$(date +%d-%H%M%S).log"
# Check if running as root. If root, script will exit
if [[ $EUID -eq 0 ]]; then
echo "${ERROR} This script should ${WARNING}NOT${RESET} be executed as root!! Exiting......." | tee -a "$LOG"
printf "\n%.0s" {1..2}
exit 1 exit 1
fi ;;
esac
# Function to check if the system is Ubuntu
is_ubuntu() {
# Check for 'Ubuntu' in /etc/os-release
if grep -q 'Ubuntu' /etc/os-release; then
return 0
fi
return 1
}
# Check if the system is Ubuntu # Check if the system is Ubuntu
if is_ubuntu; then if is_ubuntu; then
echo "${WARN}This script is ${WARNING}NOT intended for Ubuntu / Ubuntu Based${RESET}. Refer to ${YELLOW}README for the correct link for Ubuntu-Hyprland project${RESET}" | tee -a "$LOG" echo "${WARN}This script is ${RED}NOT intended for an Ubuntu / Ubuntu-based distribution${RESET}. Refer to ${YELLOW}README for the correct link for the Ubuntu-Hyprland project${RESET}" | tee -a "$LOG"
exit 1 exit 1
else
verbose_log "You are not using an Ubuntu / Ubuntu-based distribution."
fi fi
# install whiptails if detected not installed. Necessary for this version # install whiptails if detected not installed. Necessary for this version
if ! command -v whiptail >/dev/null; then if ! command -v whiptail >/dev/null; then
echo "${NOTE} - whiptail is not installed. Installing..." | tee -a "$LOG" if [[ $PEDANTIC_DRY -eq 1 ]]; then
sudo apt install -y whiptail echo "${NOTE} I won't install whiptail even though it is required." | tee -a "$LOG"
printf "\n%.0s" {1..1} else
echo "${NOTE} - whiptail is not installed. Installing..." | tee -a "$LOG"
apt_install whiptail
fi
newlines 1
else
verbose_log "whiptail already installed, not installing."
fi fi
newlines 2
printf "\n%.0s" {1..2}
echo -e "\e[35m echo -e "\e[35m
╦╔═┌─┐┌─┐╦ ╦ ╦┬ ┬┌─┐┬─┐┬ ┌─┐┌┐┌┌┬┐ ╦╔═┌─┐┌─┐╦ ╦ ╦┬ ┬┌─┐┬─┐┬ ┌─┐┌┐┌┌┬┐
╠╩╗│ ││ │║ ╠═╣└┬┘├─┘├┬┘│ ├─┤│││ ││ 2025 ╠╩╗│ ││ │║ ╠═╣└┬┘├─┘├┬┘│ ├─┤│││ ││ 2025
╩ ╩└─┘└─┘╩═╝ ╩ ╩ ┴ ┴ ┴└─┴─┘┴ ┴┘└┘─┴┘ Debian Trixie / SiD ╩ ╩└─┘└─┘╩═╝ ╩ ╩ ┴ ┴ ┴└─┴─┘┴ ┴┘└┘─┴┘ Debian Trixie / SiD
\e[0m" \e[0m"
printf "\n%.0s" {1..1} newlines 1
# Welcome message using whiptail (for displaying information) # Welcome message using whiptail (for displaying information)
whiptail --title "KooL Debian-Hyprland Trixie-SID (2025) Install Script" \ whiptail --title "KooL Debian-Hyprland Trixie-SID (2025) Install Script" \
@ -93,95 +110,57 @@ NOTE: If you are installing on a VM, ensure to enable 3D acceleration else Hyprl
# Ask if the user wants to proceed # Ask if the user wants to proceed
if ! whiptail --title "Proceed with Installation?" \ if ! whiptail --title "Proceed with Installation?" \
--yesno "VERY IMPORTANT!!!\n\nYou must be able to install from source by uncommenting deb-src on /etc/apt/sources.list else script may fail to install Hyprland.\n\n\nShall we proceed?" 15 60; then --yesno "VERY IMPORTANT!!!\n\nYou must be able to install from source by uncommenting deb-src on /etc/apt/sources.list else script may fail to install Hyprland.\n\n\nShall we proceed?" 15 60; then
echo -e "\n" newlines 2
echo "${INFO} You 🫵 chose ${YELLOW}NOT${RESET} to proceed. ${YELLOW}Exiting...${RESET}" | tee -a "$LOG" echo "${INFO} You 🫵 chose ${YELLOW}NOT${RESET} to proceed. ${YELLOW}Exiting...${RESET}" | tee -a "$LOG"
echo -e "\n" newlines 2
exit 1 exit 1
fi fi
echo "👌 ${OK} 🇵🇭 ${MAGENTA}KooL..${RESET} ${SKY_BLUE}lets continue with the installation...${RESET}" | tee -a "$LOG" echo "👌 ${OK} 🇵🇭 ${MAGENTA}KooL..${RESET} ${SKY_BLUE}let's continue with the installation...${RESET}" | tee -a "$LOG"
sleep 1 sleep 1
printf "\n%.0s" {1..1} newlines 1
# install pciutils if detected not installed. Necessary for detecting GPU # install pciutils if detected not installed. Necessary for detecting GPU
if ! dpkg -l | grep -w pciutils > /dev/null; then if ! dpkg -l | grep -w pciutils >/dev/null; then
echo "pciutils is not installed. Installing..." | tee -a "$LOG" if [[ $PEDANTIC_DRY -eq 1 ]]; then
sudo apt install -y pciutils echo "${NOTE} I won't install whiptail even though it is required." | tee -a "$LOG"
printf "\n%.0s" {1..1}
fi
# Path to the install-scripts directory
script_directory=install-scripts
# Function to execute a script if it exists and make it executable
execute_script() {
local script="$1"
local script_path="$script_directory/$script"
if [ -f "$script_path" ]; then
chmod +x "$script_path"
if [ -x "$script_path" ]; then
env "$script_path"
else
echo "Failed to make script '$script' executable." | tee -a "$LOG"
fi
else else
echo "Script '$script' not found in '$script_directory'." | tee -a "$LOG" echo "pciutils is not installed. Installing..." | tee -a "$LOG"
apt_install pciutils
fi fi
} newlines 1
else
verbose_log "pciutils already installed, not installing."
fi
################# #################
## Default values for the options (will be overwritten by preset file if available) ## Default values for the options (will be overwritten by preset file if --preset is used with a valid file)
gtk_themes="OFF" export gtk_themes="OFF"
bluetooth="OFF" export bluetooth="OFF"
thunar="OFF" export thunar="OFF"
ags="OFF" export ags="OFF"
sddm="OFF" export sddm="OFF"
sddm_theme="OFF" export sddm_theme="OFF"
xdph="OFF" export xdph="OFF"
zsh="OFF" export zsh="OFF"
pokemon="OFF" export pokemon="OFF"
rog="OFF" export rog="OFF"
dots="OFF" export dots="OFF"
input_group="OFF" export input_group="OFF"
nvidia="OFF" export nvidia="OFF"
# Function to load preset file # Load preset if PRESET_ENABLED is 1, which is only if PRESET is a valid file and set as an argument
load_preset() { if [[ $PRESET_ENABLED -eq 1 ]]; then
if [ -f "$1" ]; then # shellcheck disable=SC2153
echo "✅ Loading preset: $1" load_preset "$PRESET"
source "$1"
else
echo "⚠️ Preset file not found: $1. Using default values."
fi
}
# Check if --preset argument is passed
if [[ "$1" == "--preset" && -n "$2" ]]; then
load_preset "$2"
fi fi
# List of services to check for active login managers check_services_running
services=("gdm.service" "gdm3.service" "lightdm.service" "lxdm.service") # shellcheck disable=SC2034
NON_SDDM_SERVICES_RUNNING=$?
# Function to check if any login services are active if [[ $NON_SDDM_SERVICES_RUNNING -eq 1 ]]; then
check_services_running() {
active_services=() # Array to store active services
for svc in "${services[@]}"; do
if systemctl is-active --quiet "$svc"; then
active_services+=("$svc")
fi
done
if [ ${#active_services[@]} -gt 0 ]; then
return 0
else
return 1
fi
}
if check_services_running; then
active_list=$(printf "%s\n" "${active_services[@]}") active_list=$(printf "%s\n" "${active_services[@]}")
# Display the active login manager(s) in the whiptail message box # Display the active login manager(s) in the whiptail message box
@ -191,9 +170,12 @@ fi
# Check if NVIDIA GPU is detected # Check if NVIDIA GPU is detected
nvidia_detected=false nvidia_detected=false
if lspci | grep -i "nvidia" &> /dev/null; then if lspci | grep -i "nvidia" &>/dev/null; then
verbose_log "NVIDIA GPU detected."
nvidia_detected=true nvidia_detected=true
whiptail --title "NVIDIA GPU Detected" --msgbox "NVIDIA GPU detected in your system.\n\nNOTE: The script will install nvidia-dkms, nvidia-utils, and nvidia-settings if you choose to configure." 12 60 whiptail --title "NVIDIA GPU Detected" --msgbox "NVIDIA GPU detected in your system.\n\nNOTE: The script will install nvidia-dkms, nvidia-utils, and nvidia-settings if you choose to configure." 12 60
else
verbose_log "NVIDIA GPU not detected."
fi fi
# Initialize the options array for whiptail checklist # Initialize the options array for whiptail checklist
@ -203,6 +185,7 @@ options_command=(
# Add NVIDIA options if detected # Add NVIDIA options if detected
if [ "$nvidia_detected" == "true" ]; then if [ "$nvidia_detected" == "true" ]; then
verbose_log "Adding nvidia option to selection list"
options_command+=( options_command+=(
"nvidia" "Do you want script to configure NVIDIA GPU?" "OFF" "nvidia" "Do you want script to configure NVIDIA GPU?" "OFF"
) )
@ -211,25 +194,30 @@ fi
# Check if user is already in the 'input' group # Check if user is already in the 'input' group
input_group_detected=false input_group_detected=false
if ! groups "$(whoami)" | grep -q '\binput\b'; then if ! groups "$(whoami)" | grep -q '\binput\b'; then
verbose_log "You are not in the input group."
input_group_detected=true input_group_detected=true
whiptail --title "Input Group" --msgbox "You are not currently in the input group.\n\nAdding you to the input group might be necessary for the Waybar keyboard-state functionality." 12 60 whiptail --title "Input Group" --msgbox "You are not currently in the input group.\n\nAdding you to the input group might be necessary for the Waybar keyboard-state functionality." 12 60
else
verbose_log "You are already in the input group."
fi fi
# Add 'input_group' option if user is not in input group # Add 'input_group' option if user is not in input group
if [ "$input_group_detected" == "true" ]; then if [[ "$input_group_detected" == "true" ]]; then
verbose_log "Adding input_group option to selection list"
options_command+=( options_command+=(
"input_group" "Add your USER to input group for some waybar functionality?" "OFF" "input_group" "Add your USER to input group for some waybar functionality?" "OFF"
) )
fi fi
# Conditionally add SDDM and SDDM theme options if no active login manager is found # Conditionally add SDDM and SDDM theme options if no active login manager is found
if ! check_services_running; then if [[ $NON_SDDM_SERVICES_RUNNING -eq 0 ]]; then
options_command+=( options_command+=(
"sddm" "Install & configure SDDM login manager?" "OFF" "sddm" "Install & configure SDDM login manager?" "OFF"
"sddm_theme" "Download & Install Additional SDDM theme?" "OFF" "sddm_theme" "Download & Install Additional SDDM theme?" "OFF"
) )
fi fi
verbose_log "Adding remaining gtk_themes, bluetooth, thunar, ags, xdph, zsh, pokemon, rog, and dots options to selection"
# Add the remaining static options # Add the remaining static options
options_command+=( options_command+=(
"gtk_themes" "Install GTK themes (required for Dark/Light function)" "OFF" "gtk_themes" "Install GTK themes (required for Dark/Light function)" "OFF"
@ -245,31 +233,31 @@ options_command+=(
# Capture the selected options before the while loop starts # Capture the selected options before the while loop starts
while true; do while true; do
selected_options=$("${options_command[@]}" 3>&1 1>&2 2>&3)
# Check if the user pressed Cancel (exit status 1) # Check if the user pressed Cancel (exit status 1)
if [ $? -ne 0 ]; then if ! selected_options=$("${options_command[@]}" 3>&1 1>&2 2>&3); then
echo -e "\n" newlines 2
echo "${INFO} You 🫵 cancelled the selection. ${YELLOW}Goodbye!${RESET}" | tee -a "$LOG" echo "${INFO} You 🫵 cancelled the selection. ${YELLOW}Goodbye!${RESET}" | tee -a "$LOG"
exit 0 # Exit the script if Cancel is pressed exit 0 # Exit the script if Cancel is pressed
fi fi
# If no option was selected, notify and restart the selection # If no option was selected, notify and restart the selection
if [ -z "$selected_options" ]; then if [ -z "$selected_options" ]; then
verbose_log "No options selected."
whiptail --title "Warning" --msgbox "No options were selected. Please select at least one option." 10 60 whiptail --title "Warning" --msgbox "No options were selected. Please select at least one option." 10 60
continue # Return to selection if no options selected continue # Return to selection if no options selected
fi fi
# Strip the quotes and trim spaces if necessary (sanitize the input) # Strip the quotes and trim spaces if necessary (sanitize the input)
selected_options=$(echo "$selected_options" | tr -d '"' | tr -s ' ') selected_options=$(echo "$selected_options" | tr -d '"' | tr -s ' ')
# Convert selected options into an array (preserving spaces in values) # Convert selected options into an array (preserving spaces in values)
IFS=' ' read -r -a options <<< "$selected_options" IFS=' ' read -r -a options <<<"$selected_options"
# Check if the "dots" option was selected # Check if the "dots" option was selected
dots_selected="OFF" dots_selected="OFF"
for option in "${options[@]}"; do for option in "${options[@]}"; do
if [[ "$option" == "dots" ]]; then if [[ "$option" == "dots" ]]; then
verbose_log "dots option selected"
dots_selected="ON" dots_selected="ON"
break break
fi fi
@ -279,14 +267,14 @@ while true; do
if [[ "$dots_selected" == "OFF" ]]; then if [[ "$dots_selected" == "OFF" ]]; then
# Show a note about not selecting the "dots" option # Show a note about not selecting the "dots" option
if ! whiptail --title "KooL Hyprland Dot Files" --yesno \ if ! whiptail --title "KooL Hyprland Dot Files" --yesno \
"You have not selected to install the pre-configured KooL Hyprland dotfiles.\n\nKindly NOTE that if you proceed without Dots, Hyprland will start with default vanilla Hyprland configuration and I won't be able to give you support.\n\nWould you like to continue install without KooL Hyprland Dots or return to choices/options?" \ "You have not selected to install the pre-configured KooL Hyprland dotfiles.\n\nKindly NOTE that if you proceed without Dots, Hyprland will start with default vanilla Hyprland configuration and I won't be able to give you support.\n\nWould you like to continue install without KooL Hyprland Dots or return to choices/options?" \
--yes-button "Continue" --no-button "Return" 15 90; then --yes-button "Continue" --no-button "Return" 15 90; then
echo "🔙 Returning to options..." | tee -a "$LOG" echo "🔙 Returning to options..." | tee -a "$LOG"
continue continue
else else
# User chose to continue # User chose to continue
echo "${INFO} ⚠️ Continuing WITHOUT the dotfiles installation..." | tee -a "$LOG" echo "${INFO} ⚠️ Continuing WITHOUT the dotfiles installation..." | tee -a "$LOG"
printf "\n%.0s" {1..1} newlines 1
fi fi
fi fi
@ -299,19 +287,23 @@ while true; do
# Confirmation prompt # Confirmation prompt
if ! whiptail --title "Confirm Your Choices" --yesno "$(printf "%s" "$confirm_message")" 25 80; then if ! whiptail --title "Confirm Your Choices" --yesno "$(printf "%s" "$confirm_message")" 25 80; then
echo -e "\n" newlines 2
echo "${SKY_BLUE}You're not 🫵 happy${RESET}. ${YELLOW}Returning to options...${RESET}" | tee -a "$LOG" echo "${SKY_BLUE}You're not 🫵 happy${RESET}. ${YELLOW}Returning to options...${RESET}" | tee -a "$LOG"
continue continue
fi fi
echo "👌 ${OK} You confirmed your choices. Proceeding with ${SKY_BLUE}KooL 🇵🇭 Hyprland Installation...${RESET}" | tee -a "$LOG" echo "👌 ${OK} You confirmed your choices. Proceeding with ${SKY_BLUE}KooL 🇵🇭 Hyprland Installation...${RESET}" | tee -a "$LOG"
break break
done done
printf "\n%.0s" {1..1} newlines 1
echo "${INFO} Running a ${SKY_BLUE}full system update...${RESET}" | tee -a "$LOG" if [[ $PEDANTIC_DRY -eq 1 ]]; then
sudo apt update echo "${NOTE} I won't synchronize your package index files." | tee -a "$LOG"
else
echo "${INFO} ${SKY_BLUE}Synchronizing${RESET} package index files with apt update..." | tee -a "$LOG"
sudo apt update
fi
sleep 1 sleep 1
# execute pre clean up # execute pre clean up
@ -329,28 +321,6 @@ echo "${INFO} Installing ${SKY_BLUE}KooL Hyprland packages...${RESET}" | tee -a
sleep 1 sleep 1
execute_script "01-hypr-pkgs.sh" execute_script "01-hypr-pkgs.sh"
sleep 1 sleep 1
execute_script "hyprutils.sh" # Order is very specific for dependencies are scattered
sleep 1
execute_script "hyprlang.sh"
sleep 1
execute_script "hyprcursor.sh"
sleep 1
execute_script "hyprgraphics.sh"
sleep 1
execute_script "hyprland-qt-support.sh"
sleep 1
execute_script "hyprland-qtutils.sh"
sleep 1
execute_script "hyprwayland-scanner.sh"
sleep 1
execute_script "aquamarine.sh"
sleep 1
execute_script "hyprland-protocols.sh"
sleep 1
execute_script "hypridle.sh"
sleep 1
execute_script "hyprlock.sh"
sleep 1
execute_script "hyprland.sh" execute_script "hyprland.sh"
sleep 1 sleep 1
execute_script "wallust.sh" execute_script "wallust.sh"
@ -367,130 +337,148 @@ sleep 1
selected_options=$(echo "$selected_options" | tr -d '"' | tr -s ' ') selected_options=$(echo "$selected_options" | tr -d '"' | tr -s ' ')
# Convert selected options into an array (splitting by spaces) # Convert selected options into an array (splitting by spaces)
IFS=' ' read -r -a options <<< "$selected_options" IFS=' ' read -r -a options <<<"$selected_options"
# Loop through selected options # Loop through selected options
for option in "${options[@]}"; do for option in "${options[@]}"; do
case "$option" in case "$option" in
sddm) sddm)
if check_services_running; then if check_services_running; then
active_list=$(printf "%s\n" "${active_services[@]}") active_list=$(printf "%s\n" "${active_services[@]}")
whiptail --title "Error" --msgbox "One of the following login services is running:\n$active_list\n\nPlease stop & disable it or DO not choose SDDM." 12 60 whiptail --title "Error" --msgbox "One of the following login services is running:\n$active_list\n\nPlease stop & disable it or DO not choose SDDM." 12 60
exec "$0" exec "$0"
else else
echo "${INFO} Installing and configuring ${SKY_BLUE}SDDM...${RESET}" | tee -a "$LOG" echo "${INFO} Installing and configuring ${SKY_BLUE}SDDM...${RESET}" | tee -a "$LOG"
execute_script "sddm.sh" execute_script "sddm.sh"
fi fi
;; ;;
nvidia) nvidia)
echo "${INFO} Configuring ${SKY_BLUE}nvidia stuff${RESET}" | tee -a "$LOG" echo "${INFO} Configuring ${SKY_BLUE}nvidia stuff${RESET}" | tee -a "$LOG"
execute_script "nvidia.sh" execute_script "nvidia.sh"
;; ;;
gtk_themes) gtk_themes)
echo "${INFO} Installing ${SKY_BLUE}GTK themes...${RESET}" | tee -a "$LOG" echo "${INFO} Installing ${SKY_BLUE}GTK themes...${RESET}" | tee -a "$LOG"
execute_script "gtk_themes.sh" execute_script "gtk_themes.sh"
;; ;;
input_group) input_group)
echo "${INFO} Adding user into ${SKY_BLUE}input group...${RESET}" | tee -a "$LOG" echo "${INFO} Adding user into ${SKY_BLUE}input group...${RESET}" | tee -a "$LOG"
execute_script "InputGroup.sh" execute_script "InputGroup.sh"
;; ;;
ags) ags)
echo "${INFO} Installing ${SKY_BLUE}AGS v1 for Desktop Overview...${RESET}" | tee -a "$LOG" echo "${INFO} Installing ${SKY_BLUE}AGS v1 for Desktop Overview...${RESET}" | tee -a "$LOG"
execute_script "ags.sh" execute_script "ags.sh"
;; ;;
xdph) xdph)
echo "${INFO} Installing ${SKY_BLUE}xdg-desktop-portal-hyprland...${RESET}" | tee -a "$LOG" echo "${INFO} Installing ${SKY_BLUE}xdg-desktop-portal-hyprland...${RESET}" | tee -a "$LOG"
execute_script "xdph.sh" execute_script "xdph.sh"
;; ;;
bluetooth) bluetooth)
echo "${INFO} Configuring ${SKY_BLUE}Bluetooth...${RESET}" | tee -a "$LOG" echo "${INFO} Configuring ${SKY_BLUE}Bluetooth...${RESET}" | tee -a "$LOG"
execute_script "bluetooth.sh" execute_script "bluetooth.sh"
;; ;;
thunar) thunar)
echo "${INFO} Installing ${SKY_BLUE}Thunar file manager...${RESET}" | tee -a "$LOG" echo "${INFO} Installing ${SKY_BLUE}Thunar file manager...${RESET}" | tee -a "$LOG"
execute_script "thunar.sh" execute_script "thunar.sh"
execute_script "thunar_default.sh" execute_script "thunar_default.sh"
;; ;;
sddm_theme) sddm_theme)
echo "${INFO} Downloading & Installing ${SKY_BLUE}Additional SDDM theme...${RESET}" | tee -a "$LOG" echo "${INFO} Downloading & Installing ${SKY_BLUE}Additional SDDM theme...${RESET}" | tee -a "$LOG"
execute_script "sddm_theme.sh" execute_script "sddm_theme.sh"
;; ;;
zsh) zsh)
echo "${INFO} Installing ${SKY_BLUE}zsh with Oh-My-Zsh...${RESET}" | tee -a "$LOG" echo "${INFO} Installing ${SKY_BLUE}zsh with Oh-My-Zsh...${RESET}" | tee -a "$LOG"
execute_script "zsh.sh" execute_script "zsh.sh"
;; ;;
pokemon) pokemon)
echo "${INFO} Adding ${SKY_BLUE}Pokemon color scripts to terminal...${RESET}" | tee -a "$LOG" echo "${INFO} Adding ${SKY_BLUE}Pokemon color scripts to terminal...${RESET}" | tee -a "$LOG"
execute_script "zsh_pokemon.sh" execute_script "zsh_pokemon.sh"
;; ;;
rog) rog)
echo "${INFO} Installing ${SKY_BLUE}ROG laptop packages...${RESET}" | tee -a "$LOG" echo "${INFO} Installing ${SKY_BLUE}ROG laptop packages...${RESET}" | tee -a "$LOG"
execute_script "rog.sh" execute_script "rog.sh"
;; ;;
dots) dots)
echo "${INFO} Installing pre-configured ${SKY_BLUE}KooL Hyprland dotfiles...${RESET}" | tee -a "$LOG" echo "${INFO} Installing pre-configured ${SKY_BLUE}KooL Hyprland dotfiles...${RESET}" | tee -a "$LOG"
execute_script "dotfiles-branch.sh" execute_script "dotfiles-branch.sh"
;; ;;
*) *)
echo "Unknown option: $option" | tee -a "$LOG" echo "Unknown option: $option" | tee -a "$LOG"
;; ;;
esac esac
done done
# Perform cleanup # Perform cleanup
printf "\n${OK} Performing some clean up.\n" printf "\n${OK} Performing some clean up.\n"
verbose_log "Checking to remove files $WORKING_DIR/JetBrainsMono.tar.xz, $WORKING_DIR/VictorMonoAll.zip, and $WORKING_DIR/FantasqueSansMono.zip"
files_to_delete=("JetBrainsMono.tar.xz" "VictorMonoAll.zip" "FantasqueSansMono.zip") files_to_delete=("JetBrainsMono.tar.xz" "VictorMonoAll.zip" "FantasqueSansMono.zip")
for file in "${files_to_delete[@]}"; do for file in "${files_to_delete[@]}"; do
if [ -e "$file" ]; then if [ -e "$file" ]; then
echo "$file found. Deleting..." | tee -a "$LOG" if [[ $DRY -eq 1 ]]; then
rm "$file" echo "I am not deleting $file even though it should be cleaned up. Manually use 'rm $file' instead." | tee -a "$LOG"
echo "$file deleted successfully." | tee -a "$LOG" else
echo "$file found. Deleting..." | tee -a "$LOG"
rm "$file"
echo "$file deleted successfully." | tee -a "$LOG"
fi
fi fi
done done
# clear
clear
# copy fastfetch config if debian is not present # copy fastfetch config if debian is not present
if [ ! -f "$HOME/.config/fastfetch/debian.png" ]; then if [ ! -f "$HOME/.config/fastfetch/debian.png" ]; then
cp -r assets/fastfetch "$HOME/.config/" if [[ $DRY -eq 1 ]]; then
echo "${NOTE} I am not copying $WORKING_DIR/assets/fastfetch to $HOME/.config" | tee -a "$LOG"
else
verbose_log "Copying $WORKING_DIR/assets/fastfetch to $HOME/.config/ since $HOME/.config/fastfetch/debian.png is not present"
cp -r assets/fastfetch "$HOME/.config/"
fi
fi fi
printf "\n%.0s" {1..2} newlines 2
# final check essential packages if it is installed # final check essential packages if it is installed
execute_script "03-Final-Check.sh" execute_script "03-Final-Check.sh"
printf "\n%.0s" {1..1} newlines 1
# Check if either hyprland or hyprland-git is installed # Check if hyprland is installed, either by apt, which is installing via apt is not supported and therefore impossible, or by building from source, which is to check if some other possible location exists with command -v
if dpkg -l | grep -qw hyprland; then if check_if_installed_with_apt "hyprland" || command -v Hyprland >/dev/null; then
if check_if_installed_with_apt "hyprland"; then
verbose_log "hyprland is installed with apt"
else
verbose_log "hyprland is not installed with apt, but since the command, Hyprland, exists, I assume hyprland was built and installed from source"
fi
printf "\n ${OK} 👌 Hyprland is installed. However, some essential packages may not be installed. Please see above!" printf "\n ${OK} 👌 Hyprland is installed. However, some essential packages may not be installed. Please see above!"
printf "\n${CAT} Ignore this message if it states ${YELLOW}All essential packages${RESET} are installed as per above\n" printf "\n${CAT} Ignore this message if it states ${YELLOW}All essential packages${RESET} are installed as per above\n"
sleep 2 sleep 2
printf "\n%.0s" {1..2} newlines 2
printf "${SKY_BLUE}Thank you${RESET} 🫰 for using 🇵🇭 ${MAGENTA}KooL's Hyprland Dots${RESET}. ${YELLOW}Enjoy and Have a good day!${RESET}" printf "${SKY_BLUE}Thank you${RESET} 🫰 for using 🇵🇭 ${MAGENTA}KooL's Hyprland Dots${RESET}. ${YELLOW}Enjoy and Have a good day!${RESET}"
printf "\n%.0s" {1..2} newlines 2
printf "\n${NOTE} You can start Hyprland by typing ${SKY_BLUE}Hyprland${RESET} (IF SDDM is not installed) (note the capital H!).\n" printf "\n${NOTE} You can start Hyprland by typing ${SKY_BLUE}Hyprland${RESET} or ${SKY_BLUE}hyprland${RESET} (IF SDDM is not installed).\n"
printf "\n${NOTE} However, it is ${YELLOW}highly recommended to reboot${RESET} your system.\n\n" printf "\n${NOTE} However, it is ${YELLOW}highly recommended to reboot${RESET} your system.\n\n"
while true; do while true; do
echo -n "${CAT} Would you like to reboot now? (y/n): " echo -n "${CAT} Would you like to reboot now? (y/n): "
read HYP read -r HYP
HYP=$(echo "$HYP" | tr '[:upper:]' '[:lower:]') HYP=$(echo "$HYP" | tr '[:upper:]' '[:lower:]')
if [[ "$HYP" == "y" || "$HYP" == "yes" ]]; then if [[ "$HYP" == "y" || "$HYP" == "yes" ]]; then
echo "${INFO} Rebooting now..." if [[ $PEDANTIC_DRY -eq 1 ]]; then
systemctl reboot echo "${NOTE} Not rebooting, even with user confirmation, since pedantic dry run mode is enabled. However, you can still manually reboot with 'systemctl reboot'." | tee -a "$LOG"
break
fi
echo "${INFO} Rebooting now..." | tee -a "$LOG"
systemctl reboot
break break
elif [[ "$HYP" == "n" || "$HYP" == "no" ]]; then elif [[ "$HYP" == "n" || "$HYP" == "no" ]]; then
echo "👌 ${OK} You chose NOT to reboot" echo "👌 ${OK} You chose NOT to reboot" | tee -a "$LOG"
printf "\n%.0s" {1..1} newlines 1
# Check if NVIDIA GPU is present # Check if NVIDIA GPU is present
if lspci | grep -i "nvidia" &> /dev/null; then if lspci | grep -i "nvidia" &>/dev/null; then
echo "${INFO} HOWEVER ${YELLOW}NVIDIA GPU${RESET} detected. Reminder that you must REBOOT your SYSTEM..." echo "${INFO} HOWEVER ${YELLOW}NVIDIA GPU${RESET} detected. Reminder that you must REBOOT your SYSTEM..." | tee -a "$LOG"
printf "\n%.0s" {1..1} newlines 1
fi fi
break break
else else
@ -499,10 +487,10 @@ if dpkg -l | grep -qw hyprland; then
done done
else else
# Print error message if neither package is installed # Print error message if neither package is installed
printf "\n${WARN} Hyprland is NOT installed. Please check 00_CHECK-time_installed.log and other files in the Install-Logs/ directory..." printf "\n${WARN} Hyprland is NOT installed. Please check 00_CHECK-time_installed.log and other files in the Install-Logs/ directory..." | tee -a "$LOG"
printf "\n%.0s" {1..3} newlines 3
verbose_log "I shall exit with error code 1 since hyprland is probably not installed based on checking apt and /usr/bin for hyprland"
exit 1 exit 1
fi fi
printf "\n%.0s" {1..2} newlines 2

View File

@ -1,46 +1,50 @@
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# Define the options you want to preselect (either ON or OFF) # Define the options you want to preselect (either ON or OFF)
# IMPORTANT: answer should be inside "" # IMPORTANT: answer should be inside ""
# Remember to use the --preset option when calling install.sh so this is executed, such as
# ./install.sh --preset preset.sh
### Script will install nvidia-dkms nvidia-utils & nvidia-settings ### Script will install nvidia-dkms nvidia-utils & nvidia-settings
###-Would you like script to Configure NVIDIA for you? ###-Would you like script to Configure NVIDIA for you?
nvidia="OFF" export nvidia="OFF"
###-Install GTK themes (required for Dark/Light function)? ###-Install GTK themes (required for Dark/Light function)?
gtk_themes="ON" export gtk_themes="ON"
###-Do you want to configure Bluetooth? ###-Do you want to configure Bluetooth?
bluetooth="ON" export bluetooth="ON"
###-Do you want to install Thunar file manager? ###-Do you want to install Thunar file manager?
thunar="ON" export thunar="ON"
### Adding user to the 'input' group might be necessary for waybar keyboard-state functionality ### Adding user to the 'input' group might be necessary for waybar keyboard-state functionality
input_group="ON" export input_group="ON"
### Desktop overview Demo Link in README ### Desktop overview Demo Link in README
### Desktop overview Demo Link in README ### Desktop overview Demo Link in README
### Install AGS (aylur's GTK shell) v1 for Desktop-Like Overview?" ### Install AGS (aylur's GTK shell) v1 for Desktop-Like Overview?"
ags="ON" export ags="ON"
###-Install & configure SDDM log-in Manager ###-Install & configure SDDM log-in Manager
sddm="ON" export sddm="ON"
### install and download SDDM themes ### install and download SDDM themes
sddm_theme="ON" export sddm_theme="ON"
###-Install XDG-DESKTOP-PORTAL-HYPRLAND? (For proper Screen Share ie OBS) ###-Install XDG-DESKTOP-PORTAL-HYPRLAND? (For proper Screen Share ie OBS)
xdph="ON" export xdph="ON"
### Shell extension. Bash alternative ### Shell extension. Bash alternative
###-Install zsh, oh-my-zsh ###-Install zsh, oh-my-zsh
zsh="ON" export zsh="ON"
### add Pokemon color scripts to terminal ### add Pokemon color scripts to terminal
pokemon="ON" export pokemon="ON"
### This will install ASUSCTL & SUPERGFXCTL ### This will install ASUSCTL & SUPERGFXCTL
###-Installing on Asus ROG Laptops? ###-Installing on Asus ROG Laptops?
rog="OFF" export rog="OFF"
###-Download and Add pre-configured Hyprland dotfiles? ###-Download and Add pre-configured Hyprland dotfiles?
dots="ON" export dots="ON"

View File

@ -2,23 +2,10 @@
# 💫 https://github.com/JaKooLit 💫 # # 💫 https://github.com/JaKooLit 💫 #
# KooL Debian-Hyprland uninstall script # # KooL Debian-Hyprland uninstall script #
clear # Suddenly clearing is invasive to terminal
# clear
# Set some colors for output messages source "colors.sh"
OK="$(tput setaf 2)[OK]$(tput sgr0)"
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
INFO="$(tput setaf 4)[INFO]$(tput sgr0)"
WARN="$(tput setaf 1)[WARN]$(tput sgr0)"
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
MAGENTA="$(tput setaf 5)"
ORANGE="$(tput setaf 214)"
WARNING="$(tput setaf 1)"
YELLOW="$(tput setaf 3)"
GREEN="$(tput setaf 2)"
BLUE="$(tput setaf 4)"
SKY_BLUE="$(tput setaf 6)"
RESET="$(tput sgr0)"
printf "\n%.0s" {1..2} printf "\n%.0s" {1..2}
echo -e "\e[35m echo -e "\e[35m