#!/bin/bash # https://github.com/JaKooLit clear # Set some colors for output messages OK="$(tput setaf 2)[OK]$(tput sgr0)" ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" 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)" # 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......." printf "\n%.0s" {1..2} exit 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 } # Check if the system is Ubuntu 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} " exit 1 fi # Check if --preset argument is provided if [[ "$1" == "--preset" ]]; then # nvidia if [[ "$2" == "--nvidia" ]]; then sed -i 's/^nvidia=".*"/nvidia="Y"/' preset.sh fi source ./preset.sh fi printf "\n%.0s" {1..2} echo -e "\e[35m ╦╔═┌─┐┌─┐╦ ╦ ╦┬ ┬┌─┐┬─┐┬ ┌─┐┌┐┌┌┬┐ ╠╩╗│ ││ │║ ╠═╣└┬┘├─┘├┬┘│ ├─┤│││ ││ 2025 ╩ ╩└─┘└─┘╩═╝ ╩ ╩ ┴ ┴ ┴└─┴─┘┴ ┴┘└┘─┴┘ \e[0m" printf "\n%.0s" {1..1} # Welcome message echo "${SKY_BLUE}Welcome to JaKooLit's Debian Trixie/SID Hyprland (2025) Install Script!${RESET}" echo echo "${WARNING}ATTENTION: Run a full system update and Reboot first!! (Highly Recommended) ${RESET}" echo echo "${YELLOW}NOTE: You will be required to answer some questions during the installation! ${RESET}" echo echo "${YELLOW}NOTE: If you are installing on a VM, ensure to enable 3D acceleration else Hyprland wont start! ${RESET}" echo # Prompt user to proceed read -p "$(tput setaf 6)Would you like to proceed? (y/n): $(tput sgr0)" proceed if [ "$proceed" != "y" ]; then printf "\n%.0s" {1..2} echo "${INFO} Installation aborted. ${SKY_BLUE}No changes in your system.${RESET} ${YELLOW}Goodbye!${RESET}" printf "\n%.0s" {1..2} exit 1 fi printf "\n%.0s" {1..1} echo "${NOTE} Ensure to uncomment the ${YELLOW}deb-src's${RESET} in ${YELLOW}/etc/apt/sources.list${RESET}" read -p "${CAT} ${YELLOW}Very Important else script will likely fail${RESET}. OK to proceed? (y/n): ${RESET}" proceed2 if [ "$proceed2" != "y" ]; then printf "\n%.0s" {1..2} echo "Installation aborted! Kindly edit your ${YELLOW}sources.list${RESET} first. Refer to readme." printf "\n%.0s" {1..2} exit 1 fi # Create Directory for Install Logs if [ ! -d Install-Logs ]; then mkdir Install-Logs fi printf "\n%.0s" {1..1} # install pciutils if detected not installed. Necessary for detecting GPU if ! dpkg -l | grep -w pciutils > /dev/null; then echo "pciutils is not installed. Installing..." sudo apt install -y pciutils printf "\n%.0s" {1..1} fi # Function to colorize prompts colorize_prompt() { local color="$1" local message="$2" echo -n "${color}${message}$(tput sgr0)" } # Set the name of the log file to include the current date and time LOG="install-$(date +%d-%H%M%S).log" # Define the directory where your scripts are located script_directory=install-scripts # Function to ask a yes/no question and set the response in a variable ask_yes_no() { if [[ ! -z "${!2}" ]]; then echo "$(colorize_prompt "$CAT" "$1 (Preset): ${!2}")" if [[ "${!2}" = [Yy] ]]; then return 0 else return 1 fi else eval "$2=''" fi while true; do read -p "$(colorize_prompt "$CAT" "$1 (y/n): ")" choice case "$choice" in [Yy]* ) eval "$2='Y'"; return 0;; [Nn]* ) eval "$2='N'"; return 1;; * ) echo "Please answer with y or n.";; esac done } # Function to ask a custom question with specific options and set the response in a variable ask_custom_option() { local prompt="$1" local valid_options="$2" local response_var="$3" while true; do read -p "$(colorize_prompt "$CAT" "$prompt ($valid_options): ")" choice if [[ " $valid_options " == *" $choice "* ]]; then eval "$response_var='$choice'" return 0 else echo "Please choose one of the provided options: $valid_options" fi done } # 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 USE_PRESET=$use_preset "$script_path" else echo "Failed to make script '$script' executable." fi else echo "Script '$script' not found in '$script_directory'." fi } # Collect user responses to all questions # Check if nvidia is present if lspci | grep -i "nvidia" &> /dev/null; then printf "\n" printf "${INFO} ${YELLOW}NVIDIA GPU${RESET} detected in your system \n" ask_yes_no "-Do you want script to configure ${YELLOW}NVIDIA${RESET} for you?" nvidia fi printf "\n" ask_yes_no "-Install ${YELLOW}GTK themes${RESET} (required for Dark/Light function)?" gtk_themes printf "\n" ask_yes_no "-Do you want to configure ${YELLOW}Bluetooth${RESET}?" bluetooth printf "\n" ask_yes_no "-Do you want to install ${YELLOW}Thunar file manager${RESET}?" thunar if [[ "$thunar" == "Y" ]]; then ask_yes_no "-Set ${YELLOW}Thunar${RESET} as the default file manager?" thunar_choice fi # Input group printf "\n" if ! groups "$(whoami)" | grep -q '\binput\b'; then printf "${NOTE} adding to ${YELLOW}input${RESET} group might be necessary for ${YELLOW}waybar keyboard-state functionality${RESET} \n" ask_yes_no "-Would you like to be added to the ${YELLOW}input${RESET} group?" input_group fi printf "\n" printf "${NOTE} ${YELLOW}AGS Desktop Overview DEMO link${RESET} on README\n" ask_yes_no "-Install ${YELLOW}AGS (aylur's GTK shell) v1${RESET} for Desktop-Like Overview?" ags printf "\n" ask_yes_no "-Install & configure ${YELLOW}SDDM${RESET} as login manager?" sddm # check if any known login managers are active when users choose to install sddm if [ "$sddm" == "y" ] || [ "$sddm" == "Y" ]; then # List of services to check services=("gdm.service" "gdm3.service" "lightdm.service" "lxdm.service") # Loop through each service for svc in "${services[@]}"; do if systemctl is-active --quiet "$svc"; then echo "${ERROR} ${MAGENTA}$svc${RESET} is active. stop or disable it first or ${YELLOW}DO NOT choose SDDM${RESET} to install." echo "${NOTE} If you have GDM, no need to install SDDM. GDM will work fine as Login Manager for Hyprland." printf "\n%.0s" {1..2} exit 1 fi done fi if [[ "$sddm" == "Y" ]]; then ask_yes_no "-Download and Install ${YELLOW}SDDM Theme?${RESET} " sddm_theme fi printf "\n" ask_yes_no "-Install ${YELLOW}XDG-DESKTOP-PORTAL-HYPRLAND?${RESET} (For proper Screen Share, e.g., OBS)" xdph printf "\n" ask_yes_no "-Install ${YELLOW}zsh${RESET} with ${YELLOW}oh-my-zsh?${RESET}" zsh if [[ "$zsh" == "Y" ]]; then ask_yes_no "-Add ${YELLOW}Pokemon color scripts?${RESET} in your terminal?" pokemon_choice fi printf "\n" ask_yes_no "-Installing on ${YELLOW}Asus ROG laptops?${RESET}" rog printf "\n" ask_yes_no "-Do you want to add pre-configured ${YELLOW}KooL's Hyprland dotfiles?${RESET}" dots printf "\n" # Ensuring all in the scripts folder are made executable chmod +x install-scripts/* sleep 1 sudo apt update # execute pre clean up execute_script "02-pre-cleanup.sh" # Install hyprland packages execute_script "00-dependencies.sh" execute_script "01-hypr-pkgs.sh" execute_script "fonts.sh" execute_script "wallust.sh" #execute_script "imagemagick.sh" #this is for compiling from source. 07 Sep 2024 execute_script "swww.sh" execute_script "rofi-wayland.sh" sleep 1 execute_script "hyprland.sh" execute_script "hyprlock.sh" execute_script "hypridle.sh" # execute_script "waybar-git.sh" only if waybar on repo is old if [ "$nvidia" == "Y" ]; then execute_script "nvidia.sh" fi if [ "$gtk_themes" == "Y" ]; then execute_script "gtk_themes.sh" fi if [ "$bluetooth" == "Y" ]; then execute_script "bluetooth.sh" fi if [ "$thunar" == "Y" ]; then execute_script "thunar.sh" fi if [ "$thunar_choice" == "Y" ]; then execute_script "thunar_default.sh" fi if [ "$ags" == "Y" ]; then execute_script "ags.sh" fi if [ "$sddm" == "Y" ]; then execute_script "sddm.sh" fi if [ "$sddm_theme" == "Y" ]; then execute_script "sddm_theme.sh" fi if [ "$xdph" == "Y" ]; then execute_script "xdph.sh" fi if [ "$zsh" == "Y" ]; then execute_script "zsh.sh" fi if [ "$pokemon_choice" == "Y" ]; then execute_script "zsh_pokemon.sh" fi if [ "$input_group" == "Y" ]; then execute_script "InputGroup.sh" fi if [ "$rog" == "Y" ]; then execute_script "rog.sh" fi if [ "$dots" == "Y" ]; then execute_script "dotfiles-branch.sh" fi # Clean up printf "\n${OK} performing some clean up.\n" if [ -e "JetBrainsMono.tar.xz" ]; then echo "JetBrainsMono.tar.xz found. Deleting..." rm JetBrainsMono.tar.xz echo "JetBrainsMono.tar.xz deleted successfully." fi clear # copy fastfetch config if debian is not present if [ ! -f "$HOME/.config/fastfetch/debian.png" ]; then cp -r assets/fastfetch "$HOME/.config/" fi printf "\n%.0s" {1..2} # final check essential packages if it is installed execute_script "03-Final-Check.sh" printf "\n%.0s" {1..1} # Check if either hyprland or hyprland-git is installed if dpkg -l | grep -qw hyprland; then 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" sleep 2 printf "\n%.0s" {1..2} 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} 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} However, it is ${YELLOW}highly recommended to reboot${RESET} your system.\n\n" read -rp "${CAT} Would you like to reboot now? (y/n): " HYP HYP=$(echo "$HYP" | tr '[:upper:]' '[:lower:]') if [[ "$HYP" == "y" || "$HYP" == "yes" ]]; then echo "${INFO} Rebooting now..." systemctl reboot elif [[ "$HYP" == "n" || "$HYP" == "no" ]]; then echo "${OK} You choose NOT to reboot" printf "\n%.0s" {1..1} # Check if NVIDIA GPU is present if lspci | grep -i "nvidia" &> /dev/null; then echo "${INFO} HOWEVER ${YELLOW}NVIDIA GPU${RESET} detected. Reminder that you must REBOOT your SYSTEM..." printf "\n%.0s" {1..1} fi else echo "${WARN} Invalid response. Please answer with 'y' or 'n'. Exiting." exit 1 fi else # 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%.0s" {1..3} exit 1 fi printf "\n%.0s" {1..2}