From 9ec9cc0e25b0c77573a68d6bc53b94829408bd48 Mon Sep 17 00:00:00 2001 From: cyclesw <1939653182@qq.com> Date: Wed, 1 Oct 2025 01:36:57 +0800 Subject: [PATCH 01/18] fix: ignore case (The latest Hyprland process name has changed) --- .config/quickshell/ii/modules/common/functions/Session.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/common/functions/Session.qml b/.config/quickshell/ii/modules/common/functions/Session.qml index 1afc45817..bbb9932c3 100644 --- a/.config/quickshell/ii/modules/common/functions/Session.qml +++ b/.config/quickshell/ii/modules/common/functions/Session.qml @@ -22,7 +22,7 @@ Singleton { function logout() { closeAllWindows(); - Quickshell.execDetached(["pkill", "Hyprland"]); + Quickshell.execDetached(["pkill", "-i", "Hyprland"]); } function launchTaskManager() { From d1b70185f1a6bfe797c759d0960bff70a6909fd1 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 1 Oct 2025 08:15:07 +0200 Subject: [PATCH 02/18] styledtext: fix letter spacing (#2092) --- .config/quickshell/ii/modules/common/widgets/StyledText.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/common/widgets/StyledText.qml b/.config/quickshell/ii/modules/common/widgets/StyledText.qml index 4f07d67ef..ffc4e827d 100644 --- a/.config/quickshell/ii/modules/common/widgets/StyledText.qml +++ b/.config/quickshell/ii/modules/common/widgets/StyledText.qml @@ -11,7 +11,7 @@ Text { renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter font { - hintingPreference: Font.PreferFullHinting + hintingPreference: Font.PreferDefaultHinting family: Appearance?.font.family.main ?? "sans-serif" pixelSize: Appearance?.font.pixelSize.small ?? 15 } From 87c031b825144d2e38fa4b3725509ac8a88dd378 Mon Sep 17 00:00:00 2001 From: clsty Date: Wed, 1 Oct 2025 20:44:25 +0800 Subject: [PATCH 03/18] Rearrange install.sh to split Arch thingy apart --- install.sh | 299 ++--------------------------------- scriptdata/checkdeps.sh | 24 --- scriptdata/dependencies.conf | 5 - scriptdata/functions | 13 +- scriptdata/install-deps-arch | 116 ++++++++++++++ scriptdata/install-files | 176 +++++++++++++++++++++ scriptdata/install-greeting | 34 ++++ scriptdata/install-setups | 15 ++ scriptdata/installers | 42 +---- scriptdata/options | 2 +- 10 files changed, 355 insertions(+), 371 deletions(-) delete mode 100755 scriptdata/checkdeps.sh delete mode 100644 scriptdata/dependencies.conf create mode 100644 scriptdata/install-deps-arch create mode 100644 scriptdata/install-files create mode 100644 scriptdata/install-greeting create mode 100644 scriptdata/install-setups diff --git a/install.sh b/install.sh index 227254d13..ba06afcd9 100755 --- a/install.sh +++ b/install.sh @@ -6,296 +6,19 @@ source ./scriptdata/functions source ./scriptdata/installers source ./scriptdata/options -##################################################################################### -if ! command -v pacman >/dev/null 2>&1; then - printf "\e[31m[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...\e[0m\n" - exit 1 -fi prevent_sudo_or_root - -startask () { - printf "\e[34m[$0]: Hi there! Before we start:\n" - printf '\n' - printf '[NEW] illogical-impulse is now powered by Quickshell. If you were using the old version with AGS and would like to keep it, do not run this script.\n' - printf ' The AGS version, although uses less memory, has much worse performance (it uses Gtk3). \n' - printf ' If you aren'\''t running on ewaste, the Quickshell version is recommended. \n' - printf ' If you would like the AGS version anyway, run the script in its branch instead: git checkout ii-ags && ./install.sh\n' - printf '\n' - printf 'This script: 1. only works for Arch Linux and Arch-based distros.\n' - printf ' 2. does not handle system-level/hardware stuff like Nvidia drivers\n' - printf "\e[31m" - - printf "Would you like to create a backup for \"$XDG_CONFIG_HOME\" and \"$HOME/.local/\" folders?\n[y/N]: " - read -p " " backup_confirm - case $backup_confirm in - [yY][eE][sS]|[yY]) - backup_configs - ;; - *) - echo "Skipping backup..." - ;; - esac - - - printf '\n' - printf 'Do you want to confirm every time before a command executes?\n' - printf ' y = Yes, ask me before executing each of them. (DEFAULT)\n' - printf ' n = No, just execute them automatically.\n' - printf ' a = Abort.\n' - read -p "====> " p - case $p in - n) ask=false ;; - a) exit 1 ;; - *) ask=true ;; - esac -} - -case $ask in - false)sleep 0 ;; - *)startask ;; -esac - set -e -##################################################################################### -printf "\e[36m[$0]: 1. Get packages and setup user groups/services\n\e[0m" - -# Issue #363 -case $SKIP_SYSUPDATE in - true) sleep 0;; - *) v sudo pacman -Syu;; -esac - -remove_bashcomments_emptylines ${DEPLISTFILE} ./cache/dependencies_stripped.conf -readarray -t pkglist < ./cache/dependencies_stripped.conf - -# Use yay. Because paru does not support cleanbuild. -# Also see https://wiki.hyprland.org/FAQ/#how-do-i-update -if ! command -v yay >/dev/null 2>&1;then - echo -e "\e[33m[$0]: \"yay\" not found.\e[0m" - showfun install-yay - v install-yay -fi - -# Install extra packages from dependencies.conf as declared by the user -if (( ${#pkglist[@]} != 0 )); then - if $ask; then - # execute per element of the array $pkglist - for i in "${pkglist[@]}";do v yay -S --needed $i;done - else - # execute for all elements of the array $pkglist in one line - v yay -S --needed --noconfirm ${pkglist[*]} - fi -fi - -showfun handle-deprecated-dependencies -v handle-deprecated-dependencies - -# https://github.com/end-4/dots-hyprland/issues/581 -# yay -Bi is kinda hit or miss, instead cd into the relevant directory and manually source and install deps -install-local-pkgbuild() { - local location=$1 - local installflags=$2 - - x pushd $location - - source ./PKGBUILD - x yay -S $installflags --asdeps "${depends[@]}" - x makepkg -Asi --noconfirm - - x popd -} - -# Install core dependencies from the meta-packages -metapkgs=(./arch-packages/illogical-impulse-{audio,backlight,basic,fonts-themes,kde,portal,python,screencapture,toolkit,widgets}) -metapkgs+=(./arch-packages/illogical-impulse-hyprland) -metapkgs+=(./arch-packages/illogical-impulse-microtex-git) -# metapkgs+=(./arch-packages/illogical-impulse-oneui4-icons-git) -[[ -f /usr/share/icons/Bibata-Modern-Classic/index.theme ]] || \ - metapkgs+=(./arch-packages/illogical-impulse-bibata-modern-classic-bin) - -for i in "${metapkgs[@]}"; do - metainstallflags="--needed" - $ask && showfun install-local-pkgbuild || metainstallflags="$metainstallflags --noconfirm" - v install-local-pkgbuild "$i" "$metainstallflags" -done - -# These python packages are installed using uv, not pacman. -showfun install-python-packages -v install-python-packages - -## Optional dependencies -if pacman -Qs ^plasma-browser-integration$ ;then SKIP_PLASMAINTG=true;fi -case $SKIP_PLASMAINTG in - true) sleep 0;; - *) - if $ask;then - echo -e "\e[33m[$0]: NOTE: The size of \"plasma-browser-integration\" is about 600 MiB.\e[0m" - echo -e "\e[33mIt is needed if you want playtime of media in Firefox to be shown on the music controls widget.\e[0m" - echo -e "\e[33mInstall it? [y/N]\e[0m" - read -p "====> " p - else - p=y - fi - case $p in - y) x sudo pacman -S --needed --noconfirm plasma-browser-integration ;; - *) echo "Ok, won't install" - esac - ;; -esac - -v sudo usermod -aG video,i2c,input "$(whoami)" -v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf" -v systemctl --user enable ydotool --now -v sudo systemctl enable bluetooth --now -v gsettings set org.gnome.desktop.interface font-name 'Rubik 11' -v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' -v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly - ##################################################################################### -printf "\e[36m[$0]: 2. Copying + Configuring\e[0m\n" - -# In case some folders does not exists -v mkdir -p $XDG_BIN_HOME $XDG_CACHE_HOME $XDG_CONFIG_HOME $XDG_DATA_HOME - -# `--delete' for rsync to make sure that -# original dotfiles and new ones in the SAME DIRECTORY -# (eg. in ~/.config/hypr) won't be mixed together - -# MISC (For .config/* but not fish, not Hyprland) -case $SKIP_MISCCONF in - true) sleep 0;; - *) - for i in $(find .config/ -mindepth 1 -maxdepth 1 ! -name 'fish' ! -name 'hypr' -exec basename {} \;); do -# i=".config/$i" - echo "[$0]: Found target: .config/$i" - if [ -d ".config/$i" ];then v rsync -av --delete ".config/$i/" "$XDG_CONFIG_HOME/$i/" - elif [ -f ".config/$i" ];then v rsync -av ".config/$i" "$XDG_CONFIG_HOME/$i" - fi - done - ;; -esac - -case $SKIP_FISH in - true) sleep 0;; - *) - v rsync -av --delete .config/fish/ "$XDG_CONFIG_HOME"/fish/ - ;; -esac - -# For Hyprland -case $SKIP_HYPRLAND in - true) sleep 0;; - *) - v rsync -av --delete --exclude '/custom' --exclude '/hyprlock.conf' --exclude '/hypridle.conf' --exclude '/hyprland.conf' .config/hypr/ "$XDG_CONFIG_HOME"/hypr/ - t="$XDG_CONFIG_HOME/hypr/hyprland.conf" - if [ -f $t ];then - echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" - v mv $t $t.old - v cp -f .config/hypr/hyprland.conf $t - existed_hypr_conf_firstrun=y - else - echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" - v cp .config/hypr/hyprland.conf $t - existed_hypr_conf=n - fi - t="$XDG_CONFIG_HOME/hypr/hypridle.conf" - if [ -f $t ];then - echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" - v cp -f .config/hypr/hypridle.conf $t.new - existed_hypridle_conf=y - else - echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" - v cp .config/hypr/hypridle.conf $t - existed_hypridle_conf=n - fi - t="$XDG_CONFIG_HOME/hypr/hyprlock.conf" - if [ -f $t ];then - echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" - v cp -f .config/hypr/hyprlock.conf $t.new - existed_hyprlock_conf=y - else - echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" - v cp .config/hypr/hyprlock.conf $t - existed_hyprlock_conf=n - fi - t="$XDG_CONFIG_HOME/hypr/custom" - if [ -d $t ];then - echo -e "\e[34m[$0]: \"$t\" already exists, will not do anything.\e[0m" - else - echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" - v rsync -av --delete .config/hypr/custom/ $t/ - fi - ;; -esac - - -# some foldes (eg. .local/bin) should be processed separately to avoid `--delete' for rsync, -# since the files here come from different places, not only about one program. -# v rsync -av ".local/bin/" "$XDG_BIN_HOME" # No longer needed since scripts are no longer in ~/.local/bin -v rsync -av ".local/share/icons/" "${XDG_DATA_HOME:-$HOME/.local/share}"/icons/ -v rsync -av ".local/share/konsole/" "${XDG_DATA_HOME:-$HOME/.local/share}"/konsole/ - -# Prevent hyprland from not fully loaded -sleep 1 -try hyprctl reload - -existed_zsh_conf=n -grep -q 'source ${XDG_CONFIG_HOME:-~/.config}/zshrc.d/dots-hyprland.zsh' ~/.zshrc && existed_zsh_conf=y - -warn_files=() -warn_files_tests=() -warn_files_tests+=(/usr/local/lib/{GUtils-1.0.typelib,Gvc-1.0.typelib,libgutils.so,libgvc.so}) -warn_files_tests+=(/usr/local/share/fonts/TTF/Rubik{,-Italic}'[wght]'.ttf) -warn_files_tests+=(/usr/local/share/licenses/ttf-rubik) -warn_files_tests+=(/usr/local/share/fonts/TTF/Gabarito-{Black,Bold,ExtraBold,Medium,Regular,SemiBold}.ttf) -warn_files_tests+=(/usr/local/share/licenses/ttf-gabarito) -warn_files_tests+=(/usr/local/share/icons/OneUI{,-dark,-light}) -warn_files_tests+=(/usr/local/share/icons/Bibata-Modern-Classic) -warn_files_tests+=(/usr/local/bin/{LaTeX,res}) -for i in ${warn_files_tests[@]}; do - echo $i - test -f $i && warn_files+=($i) - test -d $i && warn_files+=($i) -done - +# 0. Before we start +source ./scriptdata/install-greeting ;; ##################################################################################### -printf "\n" -printf "\n" -printf "\n" -printf "\e[36m[$0]: Finished\e[0m\n" -printf "\n" -printf "\e[36mWhen starting Hyprland from your display manager (login screen) \e[30m\e[46m DO NOT SELECT UWSM \e[0m\e[36m\e[0m\n" -printf "\n" -printf "\e[36mIf you are already running Hyprland,\e[0m\n" -printf "\e[36mPress \e[30m\e[46m Ctrl+Super+T \e[0m\e[36m to select a wallpaper\e[0m\n" -printf "\e[36mPress \e[30m\e[46m Super+/ \e[0m\e[36m for a list of keybinds\e[0m\n" -printf "\n" -printf "\e[36mFor suggestions/hints after installation:\e[0m\n" -printf "\e[36m\e[4m https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/01setup/#post-installation \e[0m\n" -printf "\n" - -case $existed_hypr_conf_firstrun in - y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before. As it seems it is your first run, we replaced it with a new one. \e[0m\n" - printf "\e[33mAs it seems it is your first run, we replaced it with a new one. The old one has been renamed to \"$XDG_CONFIG_HOME/hypr/hyprland.conf.old\".\e[0m\n" -;;esac -case $existed_hypr_conf in - y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before and we didn't overwrite it. \e[0m\n" - printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hyprland.conf.new\" as a reference for a proper format.\e[0m\n" -;;esac -case $existed_hypridle_conf in - y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hypridle.conf\" already existed before and we didn't overwrite it. \e[0m\n" - printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hypridle.conf.new\" as a reference for a proper format.\e[0m\n" -;;esac -case $existed_hyprlock_conf in - y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprlock.conf\" already existed before and we didn't overwrite it. \e[0m\n" - printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hyprlock.conf.new\" as a reference for a proper format.\e[0m\n" -;;esac - -if [[ -z "${ILLOGICAL_IMPULSE_VIRTUAL_ENV}" ]]; then - printf "\n\e[31m[$0]: \!! Important \!! : Please ensure environment variable \e[0m \$ILLOGICAL_IMPULSE_VIRTUAL_ENV \e[31m is set to proper value (by default \"~/.local/state/quickshell/.venv\"), or Quickshell config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.\e[0m\n" -fi - -if [[ ! -z "${warn_files[@]}" ]]; then - printf "\n\e[31m[$0]: \!! Important \!! : Please delete \e[0m ${warn_files[*]} \e[31m manually as soon as possible, since we\'re now using AUR package or local PKGBUILD to install them for Arch(based) Linux distros, and they'll take precedence over our installation, or at least take up more space.\e[0m\n" -fi +printf "\e[36m[$0]: 1. Install dependencies\n\e[0m" +# TODO: if `--via-nix` is specified, source `install-deps-nix` instead. +source ./scriptdata/install-deps-arch +##################################################################################### +printf "\e[36m[$0]: 2. Setup for user groups/services etc\n\e[0m" +source ./scriptdata/install-setups +##################################################################################### +printf "\e[36m[$0]: 3. Copying + Configuring\e[0m\n" +source ./scriptdata/install-files diff --git a/scriptdata/checkdeps.sh b/scriptdata/checkdeps.sh deleted file mode 100755 index 16c40066e..000000000 --- a/scriptdata/checkdeps.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# Check whether pkgs exist in AUR or repos of Arch. -# This is a workaround for https://github.com/end-4/dots-hyprland/discussions/204 -# Do NOT abuse this since it consumes extra bandwidth from AUR server. - -set -e -cd "$(dirname "$0")" -cd .. -export base="$(pwd)" -source ./scriptdata/functions -source ./scriptdata/installers - -pkglistfile=$(mktemp) -pkglistfile_orig=./scriptdata/dependencies.conf -pkglistfile_orig_s=./cache/dependencies_stripped.conf -remove_bashcomments_emptylines $pkglistfile_orig $pkglistfile_orig_s - -cat $pkglistfile_orig_s | sed "s_\ _\n_g" > $pkglistfile - -echo "The non-existent pkgs in $pkglistfile_orig are listed as follows." -# Borrowed from https://bbs.archlinux.org/viewtopic.php?pid=1490795#p1490795 -comm -23 <(sort -u $pkglistfile) <(sort -u <(wget -q -O - https://aur.archlinux.org/packages.gz | gunzip) <(pacman -Ssq)) -echo "End of list. If nothing appears, then all pkgs exist." -rm $pkglistfile diff --git a/scriptdata/dependencies.conf b/scriptdata/dependencies.conf deleted file mode 100644 index de16fe7ed..000000000 --- a/scriptdata/dependencies.conf +++ /dev/null @@ -1,5 +0,0 @@ -### This file supports bash-style comments, and blank lines. -### PKGs on same line will be sent to `yay` together, unless `-f` is specified. - -### Most dependencies have been moved to meta packages as declared in arch-packages. -### Use this file for declaring extra dependencies which you need but are not declared by default. diff --git a/scriptdata/functions b/scriptdata/functions index f4559fb02..a1304d249 100644 --- a/scriptdata/functions +++ b/scriptdata/functions @@ -69,17 +69,6 @@ function remove_bashcomments_emptylines(){ } function prevent_sudo_or_root(){ case $(whoami) in - root)echo -e "\e[31m[$0]: This script is NOT to be executed with sudo or as root. Aborting...\e[0m";exit 1;; + root) echo -e "\e[31m[$0]: This script is NOT to be executed with sudo or as root. Aborting...\e[0m";exit 1;; esac } - - -function backup_configs() { - local backup_dir="$BACKUP_DIR" - mkdir -p "$backup_dir" - echo "Backing up $XDG_CONFIG_HOME to $backup_dir/config_backup" - rsync -av --progress "$XDG_CONFIG_HOME/" "$backup_dir/config_backup/" - - echo "Backing up $HOME/.local to $backup_dir/local_backup" - rsync -av --progress "$HOME/.local/" "$backup_dir/local_backup/" -} diff --git a/scriptdata/install-deps-arch b/scriptdata/install-deps-arch new file mode 100644 index 000000000..a390f34f7 --- /dev/null +++ b/scriptdata/install-deps-arch @@ -0,0 +1,116 @@ +# This script is meant to be sourced. +# It's not for directly running. + +install-yay() { + x sudo pacman -S --needed --noconfirm base-devel + x git clone https://aur.archlinux.org/yay-bin.git /tmp/buildyay + x cd /tmp/buildyay + x makepkg -o + x makepkg -se + x makepkg -i --noconfirm + x cd $base + rm -rf /tmp/buildyay +} + +handle-deprecated-dependencies (){ + printf "\e[36m[$0]: Removing deprecated dependencies:\e[0m\n" + for i in illogical-impulse-{microtex,pymyc-aur,ags,agsv1} {hyprutils,hyprpicker,hyprlang,hypridle,hyprland-qt-support,hyprland-qtutils,hyprlock,xdg-desktop-portal-hyprland,hyprcursor,hyprwayland-scanner,hyprland}-git;do try sudo pacman --noconfirm -Rdd $i;done +# Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages + remove_bashcomments_emptylines ./scriptdata/previous_dependencies.conf ./cache/old_deps_stripped.conf + readarray -t old_deps_list < ./cache/old_deps_stripped.conf + pacman -Qeq > ./cache/pacman_explicit_packages + readarray -t explicitly_installed < ./cache/pacman_explicit_packages + + echo "Attempting to set previously explicitly installed deps as implicit..." + for i in "${explicitly_installed[@]}"; do for j in "${old_deps_list[@]}"; do + [ "$i" = "$j" ] && yay -D --asdeps "$i" + done; done + + return 0 +} + +##################################################################################### +if ! command -v pacman >/dev/null 2>&1; then + printf "\e[31m[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...\e[0m\n" + exit 1 +fi + +# Issue #363 +case $SKIP_SYSUPDATE in + true) sleep 0;; + *) v sudo pacman -Syu;; +esac + +remove_bashcomments_emptylines ${DEPLISTFILE} ./cache/dependencies_stripped.conf +readarray -t pkglist < ./cache/dependencies_stripped.conf + +# Use yay. Because paru does not support cleanbuild. +# Also see https://wiki.hyprland.org/FAQ/#how-do-i-update +if ! command -v yay >/dev/null 2>&1;then + echo -e "\e[33m[$0]: \"yay\" not found.\e[0m" + showfun install-yay + v install-yay +fi + +# Install extra packages from dependencies.conf as declared by the user +if (( ${#pkglist[@]} != 0 )); then + if $ask; then + # execute per element of the array $pkglist + for i in "${pkglist[@]}";do v yay -S --needed $i;done + else + # execute for all elements of the array $pkglist in one line + v yay -S --needed --noconfirm ${pkglist[*]} + fi +fi + +showfun handle-deprecated-dependencies +v handle-deprecated-dependencies + +# https://github.com/end-4/dots-hyprland/issues/581 +# yay -Bi is kinda hit or miss, instead cd into the relevant directory and manually source and install deps +install-local-pkgbuild() { + local location=$1 + local installflags=$2 + + x pushd $location + + source ./PKGBUILD + x yay -S $installflags --asdeps "${depends[@]}" + x makepkg -Asi --noconfirm + + x popd +} + +# Install core dependencies from the meta-packages +metapkgs=(./arch-packages/illogical-impulse-{audio,backlight,basic,fonts-themes,kde,portal,python,screencapture,toolkit,widgets}) +metapkgs+=(./arch-packages/illogical-impulse-hyprland) +metapkgs+=(./arch-packages/illogical-impulse-microtex-git) +# metapkgs+=(./arch-packages/illogical-impulse-oneui4-icons-git) +[[ -f /usr/share/icons/Bibata-Modern-Classic/index.theme ]] || \ + metapkgs+=(./arch-packages/illogical-impulse-bibata-modern-classic-bin) + +for i in "${metapkgs[@]}"; do + metainstallflags="--needed" + $ask && showfun install-local-pkgbuild || metainstallflags="$metainstallflags --noconfirm" + v install-local-pkgbuild "$i" "$metainstallflags" +done + +## Optional dependencies +if pacman -Qs ^plasma-browser-integration$ ;then SKIP_PLASMAINTG=true;fi +case $SKIP_PLASMAINTG in + true) sleep 0;; + *) + if $ask;then + echo -e "\e[33m[$0]: NOTE: The size of \"plasma-browser-integration\" is about 600 MiB.\e[0m" + echo -e "\e[33mIt is needed if you want playtime of media in Firefox to be shown on the music controls widget.\e[0m" + echo -e "\e[33mInstall it? [y/N]\e[0m" + read -p "====> " p + else + p=y + fi + case $p in + y) x sudo pacman -S --needed --noconfirm plasma-browser-integration ;; + *) echo "Ok, won't install" + esac + ;; +esac diff --git a/scriptdata/install-files b/scriptdata/install-files new file mode 100644 index 000000000..e77e756f3 --- /dev/null +++ b/scriptdata/install-files @@ -0,0 +1,176 @@ +# This script is meant to be sourced. +# It's not for directly running. + +# TODO: make function backup_configs only cover the possibly overwritten ones. +function backup_configs() { + local backup_dir="$BACKUP_DIR" + mkdir -p "$backup_dir" + echo "Backing up $XDG_CONFIG_HOME to $backup_dir/config_backup" + rsync -av --progress "$XDG_CONFIG_HOME/" "$backup_dir/config_backup/" + + echo "Backing up $HOME/.local to $backup_dir/local_backup" + rsync -av --progress "$HOME/.local/" "$backup_dir/local_backup/" +} + +function ask_backup_configs() { + printf "\e[31m" + printf "Would you like to create a backup for \"$XDG_CONFIG_HOME\" and \"$HOME/.local/\" folders?\n[y/N]: " + read -p " " backup_confirm + case $backup_confirm in + [yY][eE][sS]|[yY]) backup_configs ;; + *) echo "Skipping backup..." ;; + esac + printf "\e[00m" +} + +##################################################################################### + +# In case some folders does not exists +v mkdir -p $XDG_BIN_HOME $XDG_CACHE_HOME $XDG_CONFIG_HOME $XDG_DATA_HOME + +case $ask in + false) sleep 0 ;; + *) ask_backup_configs ;; +esac + +# `--delete' for rsync to make sure that +# original dotfiles and new ones in the SAME DIRECTORY +# (eg. in ~/.config/hypr) won't be mixed together + +# MISC (For .config/* but not fish, not Hyprland) +case $SKIP_MISCCONF in + true) sleep 0;; + *) + for i in $(find .config/ -mindepth 1 -maxdepth 1 ! -name 'fish' ! -name 'hypr' -exec basename {} \;); do +# i=".config/$i" + echo "[$0]: Found target: .config/$i" + if [ -d ".config/$i" ];then v rsync -av --delete ".config/$i/" "$XDG_CONFIG_HOME/$i/" + elif [ -f ".config/$i" ];then v rsync -av ".config/$i" "$XDG_CONFIG_HOME/$i" + fi + done + ;; +esac + +case $SKIP_FISH in + true) sleep 0;; + *) + v rsync -av --delete .config/fish/ "$XDG_CONFIG_HOME"/fish/ + ;; +esac + +# For Hyprland +case $SKIP_HYPRLAND in + true) sleep 0;; + *) + v rsync -av --delete --exclude '/custom' --exclude '/hyprlock.conf' --exclude '/hypridle.conf' --exclude '/hyprland.conf' .config/hypr/ "$XDG_CONFIG_HOME"/hypr/ + t="$XDG_CONFIG_HOME/hypr/hyprland.conf" + if [ -f $t ];then + echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" + v mv $t $t.old + v cp -f .config/hypr/hyprland.conf $t + existed_hypr_conf_firstrun=y + else + echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" + v cp .config/hypr/hyprland.conf $t + existed_hypr_conf=n + fi + t="$XDG_CONFIG_HOME/hypr/hypridle.conf" + if [ -f $t ];then + echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" + v cp -f .config/hypr/hypridle.conf $t.new + existed_hypridle_conf=y + else + echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" + v cp .config/hypr/hypridle.conf $t + existed_hypridle_conf=n + fi + t="$XDG_CONFIG_HOME/hypr/hyprlock.conf" + if [ -f $t ];then + echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" + v cp -f .config/hypr/hyprlock.conf $t.new + existed_hyprlock_conf=y + else + echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" + v cp .config/hypr/hyprlock.conf $t + existed_hyprlock_conf=n + fi + t="$XDG_CONFIG_HOME/hypr/custom" + if [ -d $t ];then + echo -e "\e[34m[$0]: \"$t\" already exists, will not do anything.\e[0m" + else + echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" + v rsync -av --delete .config/hypr/custom/ $t/ + fi + ;; +esac + + +# some foldes (eg. .local/bin) should be processed separately to avoid `--delete' for rsync, +# since the files here come from different places, not only about one program. +# v rsync -av ".local/bin/" "$XDG_BIN_HOME" # No longer needed since scripts are no longer in ~/.local/bin +v rsync -av ".local/share/icons/" "${XDG_DATA_HOME:-$HOME/.local/share}"/icons/ +v rsync -av ".local/share/konsole/" "${XDG_DATA_HOME:-$HOME/.local/share}"/konsole/ + +# Prevent hyprland from not fully loaded +sleep 1 +try hyprctl reload + +existed_zsh_conf=n +grep -q 'source ${XDG_CONFIG_HOME:-~/.config}/zshrc.d/dots-hyprland.zsh' ~/.zshrc && existed_zsh_conf=y + +warn_files=() +warn_files_tests=() +warn_files_tests+=(/usr/local/lib/{GUtils-1.0.typelib,Gvc-1.0.typelib,libgutils.so,libgvc.so}) +warn_files_tests+=(/usr/local/share/fonts/TTF/Rubik{,-Italic}'[wght]'.ttf) +warn_files_tests+=(/usr/local/share/licenses/ttf-rubik) +warn_files_tests+=(/usr/local/share/fonts/TTF/Gabarito-{Black,Bold,ExtraBold,Medium,Regular,SemiBold}.ttf) +warn_files_tests+=(/usr/local/share/licenses/ttf-gabarito) +warn_files_tests+=(/usr/local/share/icons/OneUI{,-dark,-light}) +warn_files_tests+=(/usr/local/share/icons/Bibata-Modern-Classic) +warn_files_tests+=(/usr/local/bin/{LaTeX,res}) +for i in ${warn_files_tests[@]}; do + echo $i + test -f $i && warn_files+=($i) + test -d $i && warn_files+=($i) +done + +##################################################################################### +printf "\n" +printf "\n" +printf "\n" +printf "\e[36m[$0]: Finished\e[0m\n" +printf "\n" +printf "\e[36mWhen starting Hyprland from your display manager (login screen) \e[30m\e[46m DO NOT SELECT UWSM \e[0m\e[36m\e[0m\n" +printf "\n" +printf "\e[36mIf you are already running Hyprland,\e[0m\n" +printf "\e[36mPress \e[30m\e[46m Ctrl+Super+T \e[0m\e[36m to select a wallpaper\e[0m\n" +printf "\e[36mPress \e[30m\e[46m Super+/ \e[0m\e[36m for a list of keybinds\e[0m\n" +printf "\n" +printf "\e[36mFor suggestions/hints after installation:\e[0m\n" +printf "\e[36m\e[4m https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/01setup/#post-installation \e[0m\n" +printf "\n" + +case $existed_hypr_conf_firstrun in + y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before. As it seems it is your first run, we replaced it with a new one. \e[0m\n" + printf "\e[33mAs it seems it is your first run, we replaced it with a new one. The old one has been renamed to \"$XDG_CONFIG_HOME/hypr/hyprland.conf.old\".\e[0m\n" +;;esac +case $existed_hypr_conf in + y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before and we didn't overwrite it. \e[0m\n" + printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hyprland.conf.new\" as a reference for a proper format.\e[0m\n" +;;esac +case $existed_hypridle_conf in + y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hypridle.conf\" already existed before and we didn't overwrite it. \e[0m\n" + printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hypridle.conf.new\" as a reference for a proper format.\e[0m\n" +;;esac +case $existed_hyprlock_conf in + y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprlock.conf\" already existed before and we didn't overwrite it. \e[0m\n" + printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hyprlock.conf.new\" as a reference for a proper format.\e[0m\n" +;;esac + +if [[ -z "${ILLOGICAL_IMPULSE_VIRTUAL_ENV}" ]]; then + printf "\n\e[31m[$0]: \!! Important \!! : Please ensure environment variable \e[0m \$ILLOGICAL_IMPULSE_VIRTUAL_ENV \e[31m is set to proper value (by default \"~/.local/state/quickshell/.venv\"), or Quickshell config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.\e[0m\n" +fi + +if [[ ! -z "${warn_files[@]}" ]]; then + printf "\n\e[31m[$0]: \!! Important \!! : Please delete \e[0m ${warn_files[*]} \e[31m manually as soon as possible, since we\'re now using AUR package or local PKGBUILD to install them for Arch(based) Linux distros, and they'll take precedence over our installation, or at least take up more space.\e[0m\n" +fi diff --git a/scriptdata/install-greeting b/scriptdata/install-greeting new file mode 100644 index 000000000..37954993c --- /dev/null +++ b/scriptdata/install-greeting @@ -0,0 +1,34 @@ +# This script is meant to be sourced. +# It's not for directly running. + +##################################################################################### + +printf "\e[34m[$0]: Hi there! Before we start:\n" +printf '\n' +printf '[NEW] illogical-impulse is now powered by Quickshell. If you were using the old version with AGS and would like to keep it, do not run this script.\n' +printf ' The AGS version, although uses less memory, has much worse performance (it uses Gtk3). \n' +printf ' If you aren'\''t running on ewaste, the Quickshell version is recommended. \n' +printf ' If you would like the AGS version anyway, run the script in its branch instead: git checkout ii-ags && ./install.sh\n' +printf '\n' +printf 'This script does not handle system-level/hardware stuff like Nvidia drivers.\n' +printf "\e[00m" + + +case $ask in + false) sleep 0 ;; + *) + printf "\e[31m" + printf '\n' + printf 'Do you want to confirm every time before a command executes?\n' + printf ' y = Yes, ask me before executing each of them. (DEFAULT)\n' + printf ' n = No, I know everything this script will do, just execute them automatically.\n' + printf ' a = Abort.\n' + read -p "====> " p + case $p in + n) ask=false ;; + a) exit 1 ;; + *) ask=true ;; + esac + printf "\e[00m" + ;; +esac diff --git a/scriptdata/install-setups b/scriptdata/install-setups new file mode 100644 index 000000000..923ac2bc5 --- /dev/null +++ b/scriptdata/install-setups @@ -0,0 +1,15 @@ +# This script is meant to be sourced. +# It's not for directly running. + +##################################################################################### +# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies. +showfun install-python-packages +v install-python-packages + +v sudo usermod -aG video,i2c,input "$(whoami)" +v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf" +v systemctl --user enable ydotool --now +v sudo systemctl enable bluetooth --now +v gsettings set org.gnome.desktop.interface font-name 'Rubik 11' +v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' +v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly diff --git a/scriptdata/installers b/scriptdata/installers index 7de00454c..4cf45f3a9 100644 --- a/scriptdata/installers +++ b/scriptdata/installers @@ -1,6 +1,4 @@ -# This file is provided for non-Arch(based) distros. -# As for Arch Linux, we use local PKGBUILDs or AUR packages, which is the "right" way compared to copying files directly into /usr/local/* . -# P.S. install-yay() should be kept for Arch(based) distros. +# This file is provided for any distros, mainly non-Arch(based) distros. # This script depends on `functions' . # This is NOT a script for execution, but for loading functions, so NOT need execution permission or shebang. @@ -10,19 +8,6 @@ # cd "$(dirname "$0")" # export base="$(pwd)" -# Only for Arch(based) distro. -install-yay() { - x sudo pacman -S --needed --noconfirm base-devel - x git clone https://aur.archlinux.org/yay-bin.git /tmp/buildyay - x cd /tmp/buildyay - x makepkg -o - x makepkg -se - x makepkg -i --noconfirm - x cd $base - rm -rf /tmp/buildyay -} - -# Not for Arch(based) distro. install-agsv1 (){ x mkdir -p $base/cache/agsv1 x cd $base/cache/agsv1 @@ -38,7 +23,6 @@ install-agsv1 (){ x cd $base } -# Not for Arch(based) distro. install-Rubik (){ x mkdir -p $base/cache/Rubik x cd $base/cache/Rubik @@ -54,7 +38,6 @@ install-Rubik (){ x cd $base } -# Not for Arch(based) distro. install-Gabarito (){ x mkdir -p $base/cache/Gabarito x cd $base/cache/Gabarito @@ -69,7 +52,6 @@ install-Gabarito (){ x cd $base } -# Not for Arch(based) distro. install-OneUI (){ x mkdir -p $base/cache/OneUI4-Icons x cd $base/cache/OneUI4-Icons @@ -84,7 +66,6 @@ install-OneUI (){ x cd $base } -# Not for Arch(based) distro. install-bibata (){ x mkdir -p $base/cache/bibata-cursor x cd $base/cache/bibata-cursor @@ -98,7 +79,6 @@ install-bibata (){ x cd $base } -# Not for Arch(based) distro. install-MicroTeX (){ x mkdir -p $base/cache/MicroTeX x cd $base/cache/MicroTeX @@ -115,12 +95,10 @@ install-MicroTeX (){ x cd $base } -# Not for Arch(based) distro. install-uv (){ x bash <(curl -LJs "https://astral.sh/uv/install.sh") } -# Both for Arch(based) and other distros. install-python-packages (){ UV_NO_MODIFY_PATH=1 ILLOGICAL_IMPULSE_VIRTUAL_ENV=$XDG_STATE_HOME/quickshell/.venv @@ -131,21 +109,3 @@ install-python-packages (){ x uv pip install -r scriptdata/requirements.txt x deactivate # We don't need the virtual environment anymore } - -# Only for Arch(based) distro. -handle-deprecated-dependencies (){ - printf "\e[36m[$0]: Removing deprecated dependencies:\e[0m\n" - for i in illogical-impulse-{microtex,pymyc-aur,ags,agsv1} {hyprutils,hyprpicker,hyprlang,hypridle,hyprland-qt-support,hyprland-qtutils,hyprlock,xdg-desktop-portal-hyprland,hyprcursor,hyprwayland-scanner,hyprland}-git;do try sudo pacman --noconfirm -Rdd $i;done -# Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages - remove_bashcomments_emptylines ./scriptdata/previous_dependencies.conf ./cache/old_deps_stripped.conf - readarray -t old_deps_list < ./cache/old_deps_stripped.conf - pacman -Qeq > ./cache/pacman_explicit_packages - readarray -t explicitly_installed < ./cache/pacman_explicit_packages - - echo "Attempting to set previously explicitly installed deps as implicit..." - for i in "${explicitly_installed[@]}"; do for j in "${old_deps_list[@]}"; do - [ "$i" = "$j" ] && yay -D --asdeps "$i" - done; done - - return 0 -} diff --git a/scriptdata/options b/scriptdata/options index 2194ed14b..300bd2b15 100644 --- a/scriptdata/options +++ b/scriptdata/options @@ -12,7 +12,7 @@ If no option is specified, run default install process. -h, --help Print this help message and exit -f, --force (Dangerous) Force mode without any confirm -c, --clean Clean the build cache first - -s, --skip-sysupdate Skip \"sudo pacman -Syu\" + -s, --skip-sysupdate Skip system package upgrade e.g. \"sudo pacman -Syu\" --skip-hyprland Skip installing the config for Hyprland --skip-fish Skip installing the config for Fish --skip-plasmaintg Skip installing plasma-browser-integration From 9f711c20e00e4e23760d7f94df34c7d1d3c71bbb Mon Sep 17 00:00:00 2001 From: clsty Date: Wed, 1 Oct 2025 21:40:06 +0800 Subject: [PATCH 04/18] Use variable to store color for script output --- diagnose | 6 ++-- install.sh | 6 ++-- manual-install-helper.sh | 4 +-- scriptdata/environment-variables | 12 +++++++ scriptdata/functions | 42 ++++++++++++------------- scriptdata/install-deps-arch | 12 +++---- scriptdata/install-files | 54 ++++++++++++++++---------------- scriptdata/install-greeting | 14 ++++----- uninstall.sh | 10 +++--- 9 files changed, 87 insertions(+), 73 deletions(-) diff --git a/diagnose b/diagnose index df1d0dee4..c7008c55d 100755 --- a/diagnose +++ b/diagnose @@ -1,13 +1,15 @@ #!/usr/bin/env bash # # This script is for quickly generate helpful info -# +# It should be as independent as possible and should not source other files unless it has to +COLOR_RED='\e[31m' +COLOR_RESET='\e[00m' cd "$(dirname "$0")";export base="$(pwd)" output_file=diagnose.result;rm $output_file export LANG=C;export LC_ALL=C case $(whoami) in - root)echo -e "\e[31m[$0]: This script is NOT to be executed with sudo or as root. Aborting...\e[0m";exit 1;; + root)echo -e "${COLOR_RED}[$0]: This script is NOT to be executed with sudo or as root. Aborting...${COLOR_RESET}";exit 1;; esac diff --git a/install.sh b/install.sh index ba06afcd9..cb8a83d6d 100755 --- a/install.sh +++ b/install.sh @@ -13,12 +13,12 @@ set -e # 0. Before we start source ./scriptdata/install-greeting ;; ##################################################################################### -printf "\e[36m[$0]: 1. Install dependencies\n\e[0m" +printf "${COLOR_CYAN}[$0]: 1. Install dependencies\n${COLOR_RESET}" # TODO: if `--via-nix` is specified, source `install-deps-nix` instead. source ./scriptdata/install-deps-arch ##################################################################################### -printf "\e[36m[$0]: 2. Setup for user groups/services etc\n\e[0m" +printf "${COLOR_CYAN}[$0]: 2. Setup for user groups/services etc\n${COLOR_RESET}" source ./scriptdata/install-setups ##################################################################################### -printf "\e[36m[$0]: 3. Copying + Configuring\e[0m\n" +printf "${COLOR_CYAN}[$0]: 3. Copying + Configuring\n${COLOR_RESET}" source ./scriptdata/install-files diff --git a/manual-install-helper.sh b/manual-install-helper.sh index d594f2c16..7f92a7aae 100755 --- a/manual-install-helper.sh +++ b/manual-install-helper.sh @@ -10,7 +10,7 @@ source ./scriptdata/functions source ./scriptdata/installers prevent_sudo_or_root -if command -v pacman >/dev/null 2>&1;then printf "\e[31m[$0]: pacman found, it seems that the system is ArchLinux or Arch-based distro. Aborting...\e[0m\n";exit 1;fi +if command -v pacman >/dev/null 2>&1;then printf "${COLOR_RED}[$0]: pacman found, it seems that the system is ArchLinux or Arch-based distro. Aborting...${COLOR_RESET}\n";exit 1;fi v install-Rubik v install-Gabarito v install-OneUI @@ -20,5 +20,5 @@ v install-uv v install-python-packages if [[ -z "${ILLOGICAL_IMPULSE_VIRTUAL_ENV}" ]]; then - printf "\n\e[31m[$0]: \!! Important \!! : Please ensure environment variable \e[0m \$ILLOGICAL_IMPULSE_VIRTUAL_ENV \e[31m is set to proper value (by default \"~/.local/state/ags/.venv\"), or AGS config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.\e[0m\n" + printf "\n${COLOR_RED}[$0]: \!! Important \!! : Please ensure environment variable ${COLOR_RESET} \$ILLOGICAL_IMPULSE_VIRTUAL_ENV ${COLOR_RED} is set to proper value (by default \"~/.local/state/ags/.venv\"), or AGS config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.${COLOR_RESET}\n" fi diff --git a/scriptdata/environment-variables b/scriptdata/environment-variables index 353b0bf8e..ef71c7d21 100644 --- a/scriptdata/environment-variables +++ b/scriptdata/environment-variables @@ -5,3 +5,15 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config} XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} BACKUP_DIR=${BACKUP_DIR:-$HOME/backup} + + +COLOR_RED='\e[00m\e[31m' +COLOR_GREEN='\e[00m\e[32m' +COLOR_YELLOW='\e[00m\e[33m' +COLOR_BLUE='\e[00m\e[34m' +COLOR_PURPLE='\e[00m\e[35m' +COLOR_CYAN='\e[00m\e[36m' +COLOR_RESET='\e[00m' + +STYLE_UNDERLINE='\e[4m' +BG_COLOR_CYAN='\e[30m\e[46m' diff --git a/scriptdata/functions b/scriptdata/functions index a1304d249..86cce1507 100644 --- a/scriptdata/functions +++ b/scriptdata/functions @@ -8,60 +8,60 @@ function try { "$@" || sleep 0; } function v() { echo -e "####################################################" - echo -e "\e[34m[$0]: Next command:\e[0m" - echo -e "\e[32m$@\e[0m" + echo -e "${COLOR_BLUE}[$0]: Next command:${COLOR_RESET}" + echo -e "${COLOR_GREEN}$@${COLOR_RESET}" execute=true if $ask;then while true;do - echo -e "\e[34mExecute? \e[0m" + echo -e "${COLOR_BLUE}Execute? ${COLOR_RESET}" echo " y = Yes" echo " e = Exit now" echo " s = Skip this command (NOT recommended - your setup might not work correctly)" echo " yesforall = Yes and don't ask again; NOT recommended unless you really sure" read -p "====> " p case $p in - [yY]) echo -e "\e[34mOK, executing...\e[0m" ;break ;; - [eE]) echo -e "\e[34mExiting...\e[0m" ;exit ;break ;; - [sS]) echo -e "\e[34mAlright, skipping this one...\e[0m" ;execute=false ;break ;; - "yesforall") echo -e "\e[34mAlright, won't ask again. Executing...\e[0m"; ask=false ;break ;; - *) echo -e "\e[31mPlease enter [y/e/s/yesforall].\e[0m";; + [yY]) echo -e "${COLOR_BLUE}OK, executing...${COLOR_RESET}" ;break ;; + [eE]) echo -e "${COLOR_BLUE}Exiting...${COLOR_RESET}" ;exit ;break ;; + [sS]) echo -e "${COLOR_BLUE}Alright, skipping this one...${COLOR_RESET}" ;execute=false ;break ;; + "yesforall") echo -e "${COLOR_BLUE}Alright, won't ask again. Executing...${COLOR_RESET}"; ask=false ;break ;; + *) echo -e "${COLOR_RED}Please enter [y/e/s/yesforall].${COLOR_RESET}";; esac done fi if $execute;then x "$@";else - echo -e "\e[33m[$0]: Skipped \"$@\"\e[0m" + echo -e "${COLOR_YELLOW}[$0]: Skipped \"$@\"${COLOR_RESET}" fi } # When use v() for a defined function, use x() INSIDE its definition to catch errors. function x() { if "$@";then cmdstatus=0;else cmdstatus=1;fi # 0=normal; 1=failed; 2=failed but ignored while [ $cmdstatus == 1 ] ;do - echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed." + echo -e "${COLOR_RED}[$0]: Command \"${COLOR_GREEN}$@${COLOR_RED}\" has failed." echo -e "You may need to resolve the problem manually BEFORE repeating this command." - echo -e "[Tip] If a certain package is failing to install, try installing it separately in another terminal.\e[0m" + echo -e "[Tip] If a certain package is failing to install, try installing it separately in another terminal.${COLOR_RESET}" echo " r = Repeat this command (DEFAULT)" echo " e = Exit now" echo " i = Ignore this error and continue (your setup might not work correctly)" read -p " [R/e/i]: " p case $p in - [iI]) echo -e "\e[34mAlright, ignore and continue...\e[0m";cmdstatus=2;; - [eE]) echo -e "\e[34mAlright, will exit.\e[0m";break;; - *) echo -e "\e[34mOK, repeating...\e[0m" + [iI]) echo -e "${COLOR_BLUE}Alright, ignore and continue...${COLOR_RESET}";cmdstatus=2;; + [eE]) echo -e "${COLOR_BLUE}Alright, will exit.${COLOR_RESET}";break;; + *) echo -e "${COLOR_BLUE}OK, repeating...${COLOR_RESET}" if "$@";then cmdstatus=0;else cmdstatus=1;fi ;; esac done case $cmdstatus in - 0) echo -e "\e[34m[$0]: Command \"\e[32m$@\e[34m\" finished.\e[0m";; - 1) echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed. Exiting...\e[0m";exit 1;; - 2) echo -e "\e[31m[$0]: Command \"\e[32m$@\e[31m\" has failed but ignored by user.\e[0m";; + 0) echo -e "${COLOR_BLUE}[$0]: Command \"${COLOR_GREEN}$@${COLOR_BLUE}\" finished.${COLOR_RESET}";; + 1) echo -e "${COLOR_RED}[$0]: Command \"${COLOR_GREEN}$@${COLOR_RED}\" has failed. Exiting...${COLOR_RESET}";exit 1;; + 2) echo -e "${COLOR_RED}[$0]: Command \"${COLOR_GREEN}$@${COLOR_RED}\" has failed but ignored by user.${COLOR_RESET}";; esac } function showfun() { - echo -e "\e[34m[$0]: The definition of function \"$1\" is as follows:\e[0m" - printf "\e[32m" + echo -e "${COLOR_BLUE}[$0]: The definition of function \"$1\" is as follows:${COLOR_RESET}" + printf "${COLOR_GREEN}" type -a $1 - printf "\e[97m" + printf "${COLOR_RESET}" } function remove_bashcomments_emptylines(){ mkdir -p $(dirname $2) @@ -69,6 +69,6 @@ function remove_bashcomments_emptylines(){ } function prevent_sudo_or_root(){ case $(whoami) in - root) echo -e "\e[31m[$0]: This script is NOT to be executed with sudo or as root. Aborting...\e[0m";exit 1;; + root) echo -e "${COLOR_RED}[$0]: This script is NOT to be executed with sudo or as root. Aborting...${COLOR_RESET}";exit 1;; esac } diff --git a/scriptdata/install-deps-arch b/scriptdata/install-deps-arch index a390f34f7..adc56760c 100644 --- a/scriptdata/install-deps-arch +++ b/scriptdata/install-deps-arch @@ -13,7 +13,7 @@ install-yay() { } handle-deprecated-dependencies (){ - printf "\e[36m[$0]: Removing deprecated dependencies:\e[0m\n" + printf "${COLOR_CYAN}[$0]: Removing deprecated dependencies:${COLOR_RESET}\n" for i in illogical-impulse-{microtex,pymyc-aur,ags,agsv1} {hyprutils,hyprpicker,hyprlang,hypridle,hyprland-qt-support,hyprland-qtutils,hyprlock,xdg-desktop-portal-hyprland,hyprcursor,hyprwayland-scanner,hyprland}-git;do try sudo pacman --noconfirm -Rdd $i;done # Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages remove_bashcomments_emptylines ./scriptdata/previous_dependencies.conf ./cache/old_deps_stripped.conf @@ -31,7 +31,7 @@ handle-deprecated-dependencies (){ ##################################################################################### if ! command -v pacman >/dev/null 2>&1; then - printf "\e[31m[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...\e[0m\n" + printf "${COLOR_RED}[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...${COLOR_RESET}\n" exit 1 fi @@ -47,7 +47,7 @@ readarray -t pkglist < ./cache/dependencies_stripped.conf # Use yay. Because paru does not support cleanbuild. # Also see https://wiki.hyprland.org/FAQ/#how-do-i-update if ! command -v yay >/dev/null 2>&1;then - echo -e "\e[33m[$0]: \"yay\" not found.\e[0m" + echo -e "${COLOR_YELLOW}[$0]: \"yay\" not found.${COLOR_RESET}" showfun install-yay v install-yay fi @@ -101,9 +101,9 @@ case $SKIP_PLASMAINTG in true) sleep 0;; *) if $ask;then - echo -e "\e[33m[$0]: NOTE: The size of \"plasma-browser-integration\" is about 600 MiB.\e[0m" - echo -e "\e[33mIt is needed if you want playtime of media in Firefox to be shown on the music controls widget.\e[0m" - echo -e "\e[33mInstall it? [y/N]\e[0m" + echo -e "${COLOR_YELLOW}[$0]: NOTE: The size of \"plasma-browser-integration\" is about 600 MiB.${COLOR_RESET}" + echo -e "${COLOR_YELLOW}It is needed if you want playtime of media in Firefox to be shown on the music controls widget.${COLOR_RESET}" + echo -e "${COLOR_YELLOW}Install it? [y/N]${COLOR_RESET}" read -p "====> " p else p=y diff --git a/scriptdata/install-files b/scriptdata/install-files index e77e756f3..e49399ced 100644 --- a/scriptdata/install-files +++ b/scriptdata/install-files @@ -13,14 +13,14 @@ function backup_configs() { } function ask_backup_configs() { - printf "\e[31m" + printf "${COLOR_RED}" printf "Would you like to create a backup for \"$XDG_CONFIG_HOME\" and \"$HOME/.local/\" folders?\n[y/N]: " read -p " " backup_confirm case $backup_confirm in [yY][eE][sS]|[yY]) backup_configs ;; *) echo "Skipping backup..." ;; esac - printf "\e[00m" + printf "${COLOR_RESET}" } ##################################################################################### @@ -65,40 +65,40 @@ case $SKIP_HYPRLAND in v rsync -av --delete --exclude '/custom' --exclude '/hyprlock.conf' --exclude '/hypridle.conf' --exclude '/hyprland.conf' .config/hypr/ "$XDG_CONFIG_HOME"/hypr/ t="$XDG_CONFIG_HOME/hypr/hyprland.conf" if [ -f $t ];then - echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" + echo -e "${COLOR_BLUE}[$0]: \"$t\" already exists.${COLOR_RESET}" v mv $t $t.old v cp -f .config/hypr/hyprland.conf $t existed_hypr_conf_firstrun=y else - echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" + echo -e "${COLOR_YELLOW}[$0]: \"$t\" does not exist yet.${COLOR_RESET}" v cp .config/hypr/hyprland.conf $t existed_hypr_conf=n fi t="$XDG_CONFIG_HOME/hypr/hypridle.conf" if [ -f $t ];then - echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" + echo -e "${COLOR_BLUE}[$0]: \"$t\" already exists.${COLOR_RESET}" v cp -f .config/hypr/hypridle.conf $t.new existed_hypridle_conf=y else - echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" + echo -e "${COLOR_YELLOW}[$0]: \"$t\" does not exist yet.${COLOR_RESET}" v cp .config/hypr/hypridle.conf $t existed_hypridle_conf=n fi t="$XDG_CONFIG_HOME/hypr/hyprlock.conf" if [ -f $t ];then - echo -e "\e[34m[$0]: \"$t\" already exists.\e[0m" + echo -e "${COLOR_BLUE}[$0]: \"$t\" already exists.${COLOR_RESET}" v cp -f .config/hypr/hyprlock.conf $t.new existed_hyprlock_conf=y else - echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" + echo -e "${COLOR_YELLOW}[$0]: \"$t\" does not exist yet.${COLOR_RESET}" v cp .config/hypr/hyprlock.conf $t existed_hyprlock_conf=n fi t="$XDG_CONFIG_HOME/hypr/custom" if [ -d $t ];then - echo -e "\e[34m[$0]: \"$t\" already exists, will not do anything.\e[0m" + echo -e "${COLOR_BLUE}[$0]: \"$t\" already exists, will not do anything.${COLOR_RESET}" else - echo -e "\e[33m[$0]: \"$t\" does not exist yet.\e[0m" + echo -e "${COLOR_YELLOW}[$0]: \"$t\" does not exist yet.${COLOR_RESET}" v rsync -av --delete .config/hypr/custom/ $t/ fi ;; @@ -138,39 +138,39 @@ done printf "\n" printf "\n" printf "\n" -printf "\e[36m[$0]: Finished\e[0m\n" +printf "${COLOR_CYAN}[$0]: Finished${COLOR_RESET}\n" printf "\n" -printf "\e[36mWhen starting Hyprland from your display manager (login screen) \e[30m\e[46m DO NOT SELECT UWSM \e[0m\e[36m\e[0m\n" +printf "${COLOR_CYAN}When starting Hyprland from your display manager (login screen) ${COLOR_RED} DO NOT SELECT UWSM ${COLOR_RESET}\n" printf "\n" -printf "\e[36mIf you are already running Hyprland,\e[0m\n" -printf "\e[36mPress \e[30m\e[46m Ctrl+Super+T \e[0m\e[36m to select a wallpaper\e[0m\n" -printf "\e[36mPress \e[30m\e[46m Super+/ \e[0m\e[36m for a list of keybinds\e[0m\n" +printf "${COLOR_CYAN}If you are already running Hyprland,${COLOR_RESET}\n" +printf "${COLOR_CYAN}Press ${BG_COLOR_CYAN} Ctrl+Super+T ${BG_COLOR_CYAN} to select a wallpaper${COLOR_RESET}\n" +printf "${COLOR_CYAN}Press ${BG_COLOR_CYAN} Super+/ ${COLOR_CYAN} for a list of keybinds${COLOR_RESET}\n" printf "\n" -printf "\e[36mFor suggestions/hints after installation:\e[0m\n" -printf "\e[36m\e[4m https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/01setup/#post-installation \e[0m\n" +printf "${COLOR_CYAN}For suggestions/hints after installation:${COLOR_RESET}\n" +printf "${COLOR_CYAN}${STYLE_UNDERLINE} https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/01setup/#post-installation ${COLOR_RESET}\n" printf "\n" case $existed_hypr_conf_firstrun in - y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before. As it seems it is your first run, we replaced it with a new one. \e[0m\n" - printf "\e[33mAs it seems it is your first run, we replaced it with a new one. The old one has been renamed to \"$XDG_CONFIG_HOME/hypr/hyprland.conf.old\".\e[0m\n" + y) printf "\n${COLOR_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before. As it seems it is your first run, we replaced it with a new one. ${COLOR_RESET}\n" + printf "${COLOR_YELLOW}As it seems it is your first run, we replaced it with a new one. The old one has been renamed to \"$XDG_CONFIG_HOME/hypr/hyprland.conf.old\".${COLOR_RESET}\n" ;;esac case $existed_hypr_conf in - y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before and we didn't overwrite it. \e[0m\n" - printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hyprland.conf.new\" as a reference for a proper format.\e[0m\n" + y) printf "\n${COLOR_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before and we didn't overwrite it. ${COLOR_RESET}\n" + printf "${COLOR_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hyprland.conf.new\" as a reference for a proper format.${COLOR_RESET}\n" ;;esac case $existed_hypridle_conf in - y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hypridle.conf\" already existed before and we didn't overwrite it. \e[0m\n" - printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hypridle.conf.new\" as a reference for a proper format.\e[0m\n" + y) printf "\n${COLOR_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hypridle.conf\" already existed before and we didn't overwrite it. ${COLOR_RESET}\n" + printf "${COLOR_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hypridle.conf.new\" as a reference for a proper format.${COLOR_RESET}\n" ;;esac case $existed_hyprlock_conf in - y) printf "\n\e[33m[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprlock.conf\" already existed before and we didn't overwrite it. \e[0m\n" - printf "\e[33mPlease use \"$XDG_CONFIG_HOME/hypr/hyprlock.conf.new\" as a reference for a proper format.\e[0m\n" + y) printf "\n${COLOR_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprlock.conf\" already existed before and we didn't overwrite it. ${COLOR_RESET}\n" + printf "${COLOR_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hyprlock.conf.new\" as a reference for a proper format.${COLOR_RESET}\n" ;;esac if [[ -z "${ILLOGICAL_IMPULSE_VIRTUAL_ENV}" ]]; then - printf "\n\e[31m[$0]: \!! Important \!! : Please ensure environment variable \e[0m \$ILLOGICAL_IMPULSE_VIRTUAL_ENV \e[31m is set to proper value (by default \"~/.local/state/quickshell/.venv\"), or Quickshell config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.\e[0m\n" + printf "\n${COLOR_RED}[$0]: \!! Important \!! : Please ensure environment variable ${COLOR_RESET} \$ILLOGICAL_IMPULSE_VIRTUAL_ENV ${COLOR_RED} is set to proper value (by default \"~/.local/state/quickshell/.venv\"), or Quickshell config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.${COLOR_RESET}\n" fi if [[ ! -z "${warn_files[@]}" ]]; then - printf "\n\e[31m[$0]: \!! Important \!! : Please delete \e[0m ${warn_files[*]} \e[31m manually as soon as possible, since we\'re now using AUR package or local PKGBUILD to install them for Arch(based) Linux distros, and they'll take precedence over our installation, or at least take up more space.\e[0m\n" + printf "\n${COLOR_RED}[$0]: \!! Important \!! : Please delete ${COLOR_RESET} ${warn_files[*]} ${COLOR_RED} manually as soon as possible, since we\'re now using AUR package or local PKGBUILD to install them for Arch(based) Linux distros, and they'll take precedence over our installation, or at least take up more space.${COLOR_RESET}\n" fi diff --git a/scriptdata/install-greeting b/scriptdata/install-greeting index 37954993c..f49800926 100644 --- a/scriptdata/install-greeting +++ b/scriptdata/install-greeting @@ -3,7 +3,7 @@ ##################################################################################### -printf "\e[34m[$0]: Hi there! Before we start:\n" +printf "${COLOR_BLUE}[$0]: Hi there! Before we start:\n" printf '\n' printf '[NEW] illogical-impulse is now powered by Quickshell. If you were using the old version with AGS and would like to keep it, do not run this script.\n' printf ' The AGS version, although uses less memory, has much worse performance (it uses Gtk3). \n' @@ -11,13 +11,13 @@ printf ' If you aren'\''t running on ewaste, the Quickshell version is reco printf ' If you would like the AGS version anyway, run the script in its branch instead: git checkout ii-ags && ./install.sh\n' printf '\n' printf 'This script does not handle system-level/hardware stuff like Nvidia drivers.\n' -printf "\e[00m" +printf "${COLOR_RESET}" case $ask in false) sleep 0 ;; *) - printf "\e[31m" + printf "${COLOR_RED}" printf '\n' printf 'Do you want to confirm every time before a command executes?\n' printf ' y = Yes, ask me before executing each of them. (DEFAULT)\n' @@ -25,10 +25,10 @@ case $ask in printf ' a = Abort.\n' read -p "====> " p case $p in - n) ask=false ;; - a) exit 1 ;; - *) ask=true ;; + n) ask=false ;; + a) exit 1 ;; + *) ask=true ;; esac - printf "\e[00m" + printf "${COLOR_RESET}" ;; esac diff --git a/uninstall.sh b/uninstall.sh index 390092bf7..b48cc79db 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -5,8 +5,8 @@ source ./scriptdata/functions prevent_sudo_or_root function v() { - echo -e "[$0]: \e[32mNow executing:\e[0m" - echo -e "\e[32m$@\e[0m" + echo -e "[$0]: ${COLOR_GREEN}Now executing:${COLOR_RESET}" + echo -e "${COLOR_GREEN}$@${COLOR_RESET}" "$@" } @@ -21,7 +21,7 @@ set -e ############################################################################################################################## # Undo Step 3: Removing copied config and local folders -printf '\e[36mRemoving copied config and local folders...\n\e[97m' +printf "${COLOR_CYAN}Removing copied config and local folders...\n${COLOR_RESET}" for i in ags fish fontconfig foot fuzzel hypr mpv wlogout "starship.toml" rubyshot do v rm -rf "$XDG_CONFIG_HOME/$i" @@ -43,7 +43,7 @@ v sudo rm -rf "$XDG_STATE_HOME/ags" ############################################################################################################################## # Undo Step 1: Remove added user from video, i2c, and input groups and remove yay packages -printf '\e[36mRemoving user from video, i2c, and input groups and removing packages...\n\e[97m' +printf "${COLOR_CYAN}Removing user from video, i2c, and input groups and removing packages...\n${COLOR_RESET}" user=$(whoami) v sudo gpasswd -d "$user" video v sudo gpasswd -d "$user" i2c @@ -56,4 +56,4 @@ read -p "Do you want to uninstall packages used by the dotfiles?\nCtrl+C to exit # Removing installed yay packages and dependencies v yay -Rns illogical-impulse-{agsv1,audio,backlight,basic,bibata-modern-classic-bin,fonts-themes,gnome,gtk,hyprland,microtex-git,oneui4-icons-git,portal,python,screencapture,widgets} plasma-browser-integration -printf '\e[36mUninstall Complete.\n\e[97m' +printf "${COLOR_CYAN}Uninstall Complete.\n${COLOR_RESET}" From a7097014a391788a8db3d79f31f282ed416a13dd Mon Sep 17 00:00:00 2001 From: clsty Date: Wed, 1 Oct 2025 21:44:06 +0800 Subject: [PATCH 05/18] Quick fix syntax --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index cb8a83d6d..62dccc33c 100755 --- a/install.sh +++ b/install.sh @@ -11,7 +11,7 @@ set -e ##################################################################################### # 0. Before we start -source ./scriptdata/install-greeting ;; +source ./scriptdata/install-greeting ##################################################################################### printf "${COLOR_CYAN}[$0]: 1. Install dependencies\n${COLOR_RESET}" # TODO: if `--via-nix` is specified, source `install-deps-nix` instead. From 7aa1230553e0875293e4a2f8b0275b984b1b5dd6 Mon Sep 17 00:00:00 2001 From: clsty Date: Wed, 1 Oct 2025 21:49:46 +0800 Subject: [PATCH 06/18] Rename scripts for syntax highlighting --- install.sh | 16 ++++++++-------- manual-install-helper.sh | 6 +++--- ...onment-variables => environment-variables.sh} | 0 scriptdata/{functions => functions.sh} | 0 .../{install-deps-arch => install-deps-arch.sh} | 0 scriptdata/{install-files => install-files.sh} | 0 .../{install-greeting => install-greeting.sh} | 0 scriptdata/{install-setups => install-setups.sh} | 0 scriptdata/{installers => installers.sh} | 6 +++--- scriptdata/{options => options.sh} | 0 uninstall.sh | 4 ++-- 11 files changed, 16 insertions(+), 16 deletions(-) rename scriptdata/{environment-variables => environment-variables.sh} (100%) rename scriptdata/{functions => functions.sh} (100%) rename scriptdata/{install-deps-arch => install-deps-arch.sh} (100%) rename scriptdata/{install-files => install-files.sh} (100%) rename scriptdata/{install-greeting => install-greeting.sh} (100%) rename scriptdata/{install-setups => install-setups.sh} (100%) rename scriptdata/{installers => installers.sh} (98%) rename scriptdata/{options => options.sh} (100%) diff --git a/install.sh b/install.sh index 62dccc33c..a3436eeb0 100755 --- a/install.sh +++ b/install.sh @@ -1,24 +1,24 @@ #!/usr/bin/env bash cd "$(dirname "$0")" export base="$(pwd)" -source ./scriptdata/environment-variables -source ./scriptdata/functions -source ./scriptdata/installers -source ./scriptdata/options +source ./scriptdata/environment-variables.sh +source ./scriptdata/functions.sh +source ./scriptdata/installers.sh +source ./scriptdata/options.sh prevent_sudo_or_root set -e ##################################################################################### # 0. Before we start -source ./scriptdata/install-greeting +source ./scriptdata/install-greeting.sh ##################################################################################### printf "${COLOR_CYAN}[$0]: 1. Install dependencies\n${COLOR_RESET}" # TODO: if `--via-nix` is specified, source `install-deps-nix` instead. -source ./scriptdata/install-deps-arch +source ./scriptdata/install-deps-arch.sh ##################################################################################### printf "${COLOR_CYAN}[$0]: 2. Setup for user groups/services etc\n${COLOR_RESET}" -source ./scriptdata/install-setups +source ./scriptdata/install-setups.sh ##################################################################################### printf "${COLOR_CYAN}[$0]: 3. Copying + Configuring\n${COLOR_RESET}" -source ./scriptdata/install-files +source ./scriptdata/install-files.sh diff --git a/manual-install-helper.sh b/manual-install-helper.sh index 7f92a7aae..7ea34ebee 100755 --- a/manual-install-helper.sh +++ b/manual-install-helper.sh @@ -5,9 +5,9 @@ cd "$(dirname "$0")" export base="$(pwd)" -source ./scriptdata/environment-variables -source ./scriptdata/functions -source ./scriptdata/installers +source ./scriptdata/environment-variables.sh +source ./scriptdata/functions.sh +source ./scriptdata/installers.sh prevent_sudo_or_root if command -v pacman >/dev/null 2>&1;then printf "${COLOR_RED}[$0]: pacman found, it seems that the system is ArchLinux or Arch-based distro. Aborting...${COLOR_RESET}\n";exit 1;fi diff --git a/scriptdata/environment-variables b/scriptdata/environment-variables.sh similarity index 100% rename from scriptdata/environment-variables rename to scriptdata/environment-variables.sh diff --git a/scriptdata/functions b/scriptdata/functions.sh similarity index 100% rename from scriptdata/functions rename to scriptdata/functions.sh diff --git a/scriptdata/install-deps-arch b/scriptdata/install-deps-arch.sh similarity index 100% rename from scriptdata/install-deps-arch rename to scriptdata/install-deps-arch.sh diff --git a/scriptdata/install-files b/scriptdata/install-files.sh similarity index 100% rename from scriptdata/install-files rename to scriptdata/install-files.sh diff --git a/scriptdata/install-greeting b/scriptdata/install-greeting.sh similarity index 100% rename from scriptdata/install-greeting rename to scriptdata/install-greeting.sh diff --git a/scriptdata/install-setups b/scriptdata/install-setups.sh similarity index 100% rename from scriptdata/install-setups rename to scriptdata/install-setups.sh diff --git a/scriptdata/installers b/scriptdata/installers.sh similarity index 98% rename from scriptdata/installers rename to scriptdata/installers.sh index 4cf45f3a9..52b74173a 100644 --- a/scriptdata/installers +++ b/scriptdata/installers.sh @@ -1,9 +1,9 @@ -# This file is provided for any distros, mainly non-Arch(based) distros. - -# This script depends on `functions' . +# This script depends on `functions.sh' . # This is NOT a script for execution, but for loading functions, so NOT need execution permission or shebang. # NOTE that you NOT need to `cd ..' because the `$0' is NOT this file, but the script file which will source this file. +# This file is provided for any distros, mainly non-Arch(based) distros. + # The script that use this file should have two lines on its top as follows: # cd "$(dirname "$0")" # export base="$(pwd)" diff --git a/scriptdata/options b/scriptdata/options.sh similarity index 100% rename from scriptdata/options rename to scriptdata/options.sh diff --git a/uninstall.sh b/uninstall.sh index b48cc79db..c72bf5f17 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash cd "$(dirname "$0")" -source ./scriptdata/environment-variables -source ./scriptdata/functions +source ./scriptdata/environment-variables.sh +source ./scriptdata/functions.sh prevent_sudo_or_root function v() { From 852172a7ff44a3af0c29ed9d9448742724eeadaf Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 00:35:33 +0800 Subject: [PATCH 07/18] Add distro and arch detect, add skip options --- install.sh | 25 +++++++---- scriptdata/environment-variables.sh | 1 + scriptdata/functions.sh | 6 +-- scriptdata/install-deps-any.sh | 11 +++++ scriptdata/install-deps-arch.sh | 4 +- scriptdata/install-deps-nix.sh | 4 ++ scriptdata/install-files.sh | 4 +- scriptdata/install-greeting.sh | 64 ++++++++++++++++++++++++++++- scriptdata/installers.sh | 16 ++++---- scriptdata/options.sh | 21 ++++------ 10 files changed, 121 insertions(+), 35 deletions(-) create mode 100644 scriptdata/install-deps-any.sh create mode 100644 scriptdata/install-deps-nix.sh diff --git a/install.sh b/install.sh index a3436eeb0..664282114 100755 --- a/install.sh +++ b/install.sh @@ -13,12 +13,23 @@ set -e # 0. Before we start source ./scriptdata/install-greeting.sh ##################################################################################### -printf "${COLOR_CYAN}[$0]: 1. Install dependencies\n${COLOR_RESET}" -# TODO: if `--via-nix` is specified, source `install-deps-nix` instead. -source ./scriptdata/install-deps-arch.sh +if [[ "${SKIP_ALLDEPS}" != true ]]; then + printf "${COLOR_CYAN}[$0]: 1. Install dependencies\n${COLOR_RESET}" + if [[ "${INSTALL_VIA_NIX}" == "true" ]]; then + source ./scriptdata/install-deps-nix.sh + elif [[ "${OS_DISTRO_ID}" == "arch" || "${OS_DISTRO_ID_LIKE}" == "arch" ]]; then + source ./scriptdata/install-deps-arch.sh + else + source ./scriptdata/install-deps-any.sh + fi +fi ##################################################################################### -printf "${COLOR_CYAN}[$0]: 2. Setup for user groups/services etc\n${COLOR_RESET}" -source ./scriptdata/install-setups.sh +if [[ "${SKIP_ALLSETUPS}" != true ]]; then + printf "${COLOR_CYAN}[$0]: 2. Setup for user groups/services etc\n${COLOR_RESET}" + source ./scriptdata/install-setups.sh +fi ##################################################################################### -printf "${COLOR_CYAN}[$0]: 3. Copying + Configuring\n${COLOR_RESET}" -source ./scriptdata/install-files.sh +if [[ "${SKIP_ALLFILES}" != true ]]; then + printf "${COLOR_CYAN}[$0]: 3. Copying + Configuring\n${COLOR_RESET}" + source ./scriptdata/install-files.sh +fi diff --git a/scriptdata/environment-variables.sh b/scriptdata/environment-variables.sh index ef71c7d21..44057679c 100644 --- a/scriptdata/environment-variables.sh +++ b/scriptdata/environment-variables.sh @@ -17,3 +17,4 @@ COLOR_RESET='\e[00m' STYLE_UNDERLINE='\e[4m' BG_COLOR_CYAN='\e[30m\e[46m' +BG_COLOR_RED='\e[30m\e[41m' diff --git a/scriptdata/functions.sh b/scriptdata/functions.sh index 86cce1507..e5477fa0c 100644 --- a/scriptdata/functions.sh +++ b/scriptdata/functions.sh @@ -6,7 +6,7 @@ # export base="$(pwd)" function try { "$@" || sleep 0; } -function v() { +function v(){ echo -e "####################################################" echo -e "${COLOR_BLUE}[$0]: Next command:${COLOR_RESET}" echo -e "${COLOR_GREEN}$@${COLOR_RESET}" @@ -33,7 +33,7 @@ function v() { fi } # When use v() for a defined function, use x() INSIDE its definition to catch errors. -function x() { +function x(){ if "$@";then cmdstatus=0;else cmdstatus=1;fi # 0=normal; 1=failed; 2=failed but ignored while [ $cmdstatus == 1 ] ;do echo -e "${COLOR_RED}[$0]: Command \"${COLOR_GREEN}$@${COLOR_RED}\" has failed." @@ -57,7 +57,7 @@ function x() { 2) echo -e "${COLOR_RED}[$0]: Command \"${COLOR_GREEN}$@${COLOR_RED}\" has failed but ignored by user.${COLOR_RESET}";; esac } -function showfun() { +function showfun(){ echo -e "${COLOR_BLUE}[$0]: The definition of function \"$1\" is as follows:${COLOR_RESET}" printf "${COLOR_GREEN}" type -a $1 diff --git a/scriptdata/install-deps-any.sh b/scriptdata/install-deps-any.sh new file mode 100644 index 000000000..b106cfbe6 --- /dev/null +++ b/scriptdata/install-deps-any.sh @@ -0,0 +1,11 @@ +# This script is meant to be sourced. +# It's not for directly running. + +# This file is currently WIP. + +v install-Rubik +v install-Gabarito +v install-OneUI +v install-bibata +v install-MicroTeX +v install-uv diff --git a/scriptdata/install-deps-arch.sh b/scriptdata/install-deps-arch.sh index adc56760c..ecf1402ed 100644 --- a/scriptdata/install-deps-arch.sh +++ b/scriptdata/install-deps-arch.sh @@ -1,7 +1,7 @@ # This script is meant to be sourced. # It's not for directly running. -install-yay() { +install-yay(){ x sudo pacman -S --needed --noconfirm base-devel x git clone https://aur.archlinux.org/yay-bin.git /tmp/buildyay x cd /tmp/buildyay @@ -12,7 +12,7 @@ install-yay() { rm -rf /tmp/buildyay } -handle-deprecated-dependencies (){ +handle-deprecated-dependencies(){ printf "${COLOR_CYAN}[$0]: Removing deprecated dependencies:${COLOR_RESET}\n" for i in illogical-impulse-{microtex,pymyc-aur,ags,agsv1} {hyprutils,hyprpicker,hyprlang,hypridle,hyprland-qt-support,hyprland-qtutils,hyprlock,xdg-desktop-portal-hyprland,hyprcursor,hyprwayland-scanner,hyprland}-git;do try sudo pacman --noconfirm -Rdd $i;done # Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages diff --git a/scriptdata/install-deps-nix.sh b/scriptdata/install-deps-nix.sh new file mode 100644 index 000000000..77697e501 --- /dev/null +++ b/scriptdata/install-deps-nix.sh @@ -0,0 +1,4 @@ +# This script is meant to be sourced. +# It's not for directly running. + +# This file is currently WIP. diff --git a/scriptdata/install-files.sh b/scriptdata/install-files.sh index e49399ced..845f45c4b 100644 --- a/scriptdata/install-files.sh +++ b/scriptdata/install-files.sh @@ -2,7 +2,7 @@ # It's not for directly running. # TODO: make function backup_configs only cover the possibly overwritten ones. -function backup_configs() { +function backup_configs(){ local backup_dir="$BACKUP_DIR" mkdir -p "$backup_dir" echo "Backing up $XDG_CONFIG_HOME to $backup_dir/config_backup" @@ -12,7 +12,7 @@ function backup_configs() { rsync -av --progress "$HOME/.local/" "$backup_dir/local_backup/" } -function ask_backup_configs() { +function ask_backup_configs(){ printf "${COLOR_RED}" printf "Would you like to create a backup for \"$XDG_CONFIG_HOME\" and \"$HOME/.local/\" folders?\n[y/N]: " read -p " " backup_confirm diff --git a/scriptdata/install-greeting.sh b/scriptdata/install-greeting.sh index f49800926..295fefbfb 100644 --- a/scriptdata/install-greeting.sh +++ b/scriptdata/install-greeting.sh @@ -11,9 +11,9 @@ printf ' If you aren'\''t running on ewaste, the Quickshell version is reco printf ' If you would like the AGS version anyway, run the script in its branch instead: git checkout ii-ags && ./install.sh\n' printf '\n' printf 'This script does not handle system-level/hardware stuff like Nvidia drivers.\n' +printf "\n" printf "${COLOR_RESET}" - case $ask in false) sleep 0 ;; *) @@ -32,3 +32,65 @@ case $ask in printf "${COLOR_RESET}" ;; esac + +#################### +# Detect architecture +# Helpful link(s): +# http://stackoverflow.com/questions/45125516 +export MACHINE_ARCH=$(uname -m) +case $MACHINE_ARCH in + "x86_64") sleep 0;; + *) + printf "${COLOR_YELLOW}" + printf "===WARNING===\n" + printf "Detected machine architecture: ${MACHINE_ARCH}\n" + printf "This script only supports x86_64.\n" + printf "It is very likely to fail when installing dependencies on your machine.\n" + printf "\n" + printf "${COLOR_RESET}" + ;; + esac + +#################### +# Detect distro +# Helpful link(s): +# http://stackoverflow.com/questions/29581754 +# https://github.com/which-distro/os-release +export OS_RELEASE_FILE=${OS_RELEASE_FILE:-/etc/os-release} +test -f ${OS_RELEASE_FILE} || \ + ( echo "${OS_RELEASE_FILE} does not exist. Aborting..." ; exit 1 ; ) +export OS_DISTRO_ID=$(awk -F'=' '/^ID=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) +export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) +case $OS_DISTRO_ID in + "arch"|"endeavouros"|"cachyos") sleep 0;; + *) + case $OS_DISTRO_ID_LIKE in + "arch") + printf "${COLOR_YELLOW}" + printf "===WARNING===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" + printf "This script supports Arch Linux, so it should also work for your distro ideally.\n" + printf "Still, there is a chance that it not works as expected or even fails.\n" + printf "\n" + printf "${COLOR_RESET}" + ;; + *) + printf "${COLOR_RED}" + printf "===URGENT===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "Currently, only Arch(-based) distros are supported.\n" + printf "If you continue, this script will still move on and try to install some dependencies for you.\n" + printf "But it may disrupt your system and will likely fail without your manual intervention. Only continue at your own risk.\n" + printf "${COLOR_RESET}" + printf "${BG_COLOR_RED}" + printf "To tell you the truth, it is completely not worky at this time. The prompt here is only for testing and WIP. PLEASE JUST QUIT IMMEDIATELY.${COLOR_RESET}\n" + read -p "Still continue? [y/N] ====> " p + case $p in + [yY]) sleep 0 ;; + *) exit 1 ;; + esac + ;; + esac + ;; +esac diff --git a/scriptdata/installers.sh b/scriptdata/installers.sh index 52b74173a..ffbf2bc53 100644 --- a/scriptdata/installers.sh +++ b/scriptdata/installers.sh @@ -8,7 +8,7 @@ # cd "$(dirname "$0")" # export base="$(pwd)" -install-agsv1 (){ +install-agsv1(){ x mkdir -p $base/cache/agsv1 x cd $base/cache/agsv1 try git init -b main @@ -23,7 +23,7 @@ install-agsv1 (){ x cd $base } -install-Rubik (){ +install-Rubik(){ x mkdir -p $base/cache/Rubik x cd $base/cache/Rubik try git init -b main @@ -38,7 +38,7 @@ install-Rubik (){ x cd $base } -install-Gabarito (){ +install-Gabarito(){ x mkdir -p $base/cache/Gabarito x cd $base/cache/Gabarito try git init -b main @@ -52,7 +52,7 @@ install-Gabarito (){ x cd $base } -install-OneUI (){ +install-OneUI(){ x mkdir -p $base/cache/OneUI4-Icons x cd $base/cache/OneUI4-Icons try git init -b main @@ -66,7 +66,7 @@ install-OneUI (){ x cd $base } -install-bibata (){ +install-bibata(){ x mkdir -p $base/cache/bibata-cursor x cd $base/cache/bibata-cursor name="Bibata-Modern-Classic" @@ -79,7 +79,7 @@ install-bibata (){ x cd $base } -install-MicroTeX (){ +install-MicroTeX(){ x mkdir -p $base/cache/MicroTeX x cd $base/cache/MicroTeX try git init -b master @@ -95,11 +95,11 @@ install-MicroTeX (){ x cd $base } -install-uv (){ +install-uv(){ x bash <(curl -LJs "https://astral.sh/uv/install.sh") } -install-python-packages (){ +install-python-packages(){ UV_NO_MODIFY_PATH=1 ILLOGICAL_IMPULSE_VIRTUAL_ENV=$XDG_STATE_HOME/quickshell/.venv x mkdir -p $(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV) diff --git a/scriptdata/options.sh b/scriptdata/options.sh index 300bd2b15..0a4f7b49f 100644 --- a/scriptdata/options.sh +++ b/scriptdata/options.sh @@ -12,15 +12,17 @@ If no option is specified, run default install process. -h, --help Print this help message and exit -f, --force (Dangerous) Force mode without any confirm -c, --clean Clean the build cache first + --skip-alldeps Skip the whole process installing dependency + --skip-allsetups Skip the whole process setting up user groups/services etc + --skip-allfiles Skip the whole process copying configuration files -s, --skip-sysupdate Skip system package upgrade e.g. \"sudo pacman -Syu\" --skip-hyprland Skip installing the config for Hyprland --skip-fish Skip installing the config for Fish --skip-plasmaintg Skip installing plasma-browser-integration --skip-miscconf Skip copying the dirs and files to \".configs\" except for AGS, Fish and Hyprland - --deplistfile Specify a dependency list file. By default - \"./scriptdata/dependencies.conf\" --fontset (Unavailable yet) Use a set of pre-defined font and config + --via-nix (Unavailable yet) Use Nix to install dependencies " } @@ -31,7 +33,7 @@ cleancache(){ # `man getopt` to see more para=$(getopt \ -o hfk:cs \ - -l help,force,fontset:,deplistfile:,clean,skip-sysupdate,skip-fish,skip-hyprland,skip-plasmaintg,skip-miscconf \ + -l help,force,fontset:,clean,skip-alldeps,skip-allsetups,skip-allfiles,skip-sysupdate,skip-fish,skip-hyprland,skip-plasmaintg,skip-miscconf,via-nix \ -n "$0" -- "$@") [ $? != 0 ] && echo "$0: Error when getopt, please recheck parameters." && exit 1 ##################################################################################### @@ -48,7 +50,6 @@ while true ; do done ##################################################################################### ## getopt Phase 2 -DEPLISTFILE=./scriptdata/dependencies.conf eval set -- "$para" while true ; do @@ -57,21 +58,17 @@ while true ; do -c|--clean) shift;; ## Ones without parameter -f|--force) ask=false;shift;; + --skip-alldeps) SKIP_PLASMAINTG=true;shift;; + --skip-allsetups) SKIP_ALLSETUPS=true;shift;; + --skip-allfiles) SKIP_ALLFILES=true;shift;; -s|--skip-sysupdate) SKIP_SYSUPDATE=true;shift;; --skip-hyprland) SKIP_HYPRLAND=true;shift;; --skip-fish) SKIP_FISH=true;shift;; --skip-miscconf) SKIP_MISCCONF=true;shift;; --skip-plasmaintg) SKIP_PLASMAINTG=true;shift;; + --via-nix) INSTALL_VIA_NIX=true;shift;; ## Ones with parameter - --deplistfile) - if [ -f "$2" ];then - DEPLISTFILE="$2" - else - echo -e "Deplist file \"$2\" does not exist.";exit 1 - fi - shift 2 ;; - --fontset) case $2 in "default"|"zh-CN"|"vi") fontset="$2";; From 4085b4a74a4f4a206d1498b3467c61bc7f72efee Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 01:57:20 +0800 Subject: [PATCH 08/18] Improve dependency install process --- diagnose | 12 +++ install.sh | 8 +- ...l-deps-any.sh => install-deps-fallback.sh} | 0 scriptdata/install-deps.sh | 100 ++++++++++++++++++ scriptdata/install-greeting.sh | 62 ----------- scriptdata/options.sh | 2 +- 6 files changed, 114 insertions(+), 70 deletions(-) rename scriptdata/{install-deps-any.sh => install-deps-fallback.sh} (100%) create mode 100644 scriptdata/install-deps.sh diff --git a/diagnose b/diagnose index c7008c55d..3d67cdb81 100755 --- a/diagnose +++ b/diagnose @@ -32,6 +32,17 @@ ii_exec() { "$@" err=$?;if [ ! $err -eq 0 ];then echo "[---EXIT $err---]";else echo "[---SUCCESS---]";fi } +ii_check_distro_id() { + OS_RELEASE_FILE=/etc/os-release + if [[ -f "$OS_RELEASE_FILE" ]]; then + OS_DISTRO_ID=$(awk -F'=' '/^ID=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) + OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) + echo "distro ID: $OS_DISTRO_ID" + echo "distro ID_LIKE: $OS_DISTRO_ID_LIKE" + else + echo "$OS_RELEASE_FILE does not exist." + fi +} ii_check_distro() { lsb_release -a || cat /etc/os-release || cat /etc/lsb-release } @@ -46,6 +57,7 @@ x git remote get-url origin x git rev-parse HEAD e "Checking distro" +x ii_check_distro_id x ii_check_distro e "Checking variables" diff --git a/install.sh b/install.sh index 664282114..ce0ce1a35 100755 --- a/install.sh +++ b/install.sh @@ -15,13 +15,7 @@ source ./scriptdata/install-greeting.sh ##################################################################################### if [[ "${SKIP_ALLDEPS}" != true ]]; then printf "${COLOR_CYAN}[$0]: 1. Install dependencies\n${COLOR_RESET}" - if [[ "${INSTALL_VIA_NIX}" == "true" ]]; then - source ./scriptdata/install-deps-nix.sh - elif [[ "${OS_DISTRO_ID}" == "arch" || "${OS_DISTRO_ID_LIKE}" == "arch" ]]; then - source ./scriptdata/install-deps-arch.sh - else - source ./scriptdata/install-deps-any.sh - fi + source ./scriptdata/install-deps.sh fi ##################################################################################### if [[ "${SKIP_ALLSETUPS}" != true ]]; then diff --git a/scriptdata/install-deps-any.sh b/scriptdata/install-deps-fallback.sh similarity index 100% rename from scriptdata/install-deps-any.sh rename to scriptdata/install-deps-fallback.sh diff --git a/scriptdata/install-deps.sh b/scriptdata/install-deps.sh new file mode 100644 index 000000000..28131c24a --- /dev/null +++ b/scriptdata/install-deps.sh @@ -0,0 +1,100 @@ +# This script is meant to be sourced. +# It's not for directly running. + +#################### +# Detect architecture +# Helpful link(s): +# http://stackoverflow.com/questions/45125516 +export MACHINE_ARCH=$(uname -m) +case $MACHINE_ARCH in + "x86_64") sleep 0;; + *) + printf "${COLOR_YELLOW}" + printf "===WARNING===\n" + printf "Detected machine architecture: ${MACHINE_ARCH}\n" + printf "This script only supports x86_64.\n" + printf "It is very likely to fail when installing dependencies on your machine.\n" + printf "\n" + printf "${COLOR_RESET}" + ;; + esac + +#################### +# Detect distro +# Helpful link(s): +# http://stackoverflow.com/questions/29581754 +# https://github.com/which-distro/os-release +export OS_RELEASE_FILE=${OS_RELEASE_FILE:-/etc/os-release} +test -f ${OS_RELEASE_FILE} || \ + ( echo "${OS_RELEASE_FILE} does not exist. Aborting..." ; exit 1 ; ) +export OS_DISTRO_ID=$(awk -F'=' '/^ID=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) +export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) + + + +if [[ "$INSTALL_VIA_NIX" == "true" ]]; then + + printf "${COLOR_YELLOW}" + printf "===WARNING===\n" + printf "Nix will be used to install dependencies.\n" + printf "The process is still WIP.\n" + printf "Only continue at your own risk.\n" + printf "\n" + printf "${COLOR_RESET}" + source ./scriptdata/install-deps-nix.sh + +elif [[ "$OS_DISTRO_ID" =~ ^(arch|endeavouros)$ ]]; then + + printf "${COLOR_GREEN}" + printf "===INFO===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "\n" + printf "${COLOR_RESET}" + source ./scriptdata/install-deps-arch.sh + +elif [[ -f "./scriptdata/install-deps-${OS_DISTRO_ID}.sh" ]]; then + + printf "${COLOR_BLUE}" + printf "===NOTICE===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "./scriptdata/install-deps-${OS_DISTRO_ID}.sh detected and will be used.\n" + printf "It is not officially supported by github:end-4/dots-hyprland .\n" + printf "Use it only at your own risk.\n" + printf "\n" + printf "${COLOR_RESET}" + source ./scriptdata/install-deps-${OS_DISTRO_ID}.sh + +elif [[ "$OS_DISTRO_ID_LIKE" == "arch" ]]; then + + printf "${COLOR_YELLOW}" + printf "===WARNING===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" + printf "This script supports Arch Linux, so it should also work for your distro ideally.\n" + printf "Still, there is a chance that it not works as expected or even fails.\n" + printf "Use it only at your own risk.\n" + printf "\n" + printf "${COLOR_RESET}" + source ./scriptdata/install-deps-arch.sh + +else + + printf "${COLOR_RED}" + printf "===URGENT===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" + printf "No suitable dependency installation script found.\n" + printf "./scriptdata/install-deps-fallback.sh will be used.\n" + printf "It may disrupt your system and will likely fail without your manual intervention.\n" + printf "Only continue at your own risk.\n" + printf "${COLOR_RESET}" + printf "${BG_COLOR_RED}" + printf "To tell you the truth, it is completely not worky at this time. The prompt here is only for testing and WIP. PLEASE JUST QUIT IMMEDIATELY.${COLOR_RESET}\n" + read -p "Still continue? [y/N] ====> " p + case $p in + [yY]) sleep 0 ;; + *) exit 1 ;; + esac + source ./scriptdata/install-deps-fallback.sh + +fi diff --git a/scriptdata/install-greeting.sh b/scriptdata/install-greeting.sh index 295fefbfb..3da9615c1 100644 --- a/scriptdata/install-greeting.sh +++ b/scriptdata/install-greeting.sh @@ -32,65 +32,3 @@ case $ask in printf "${COLOR_RESET}" ;; esac - -#################### -# Detect architecture -# Helpful link(s): -# http://stackoverflow.com/questions/45125516 -export MACHINE_ARCH=$(uname -m) -case $MACHINE_ARCH in - "x86_64") sleep 0;; - *) - printf "${COLOR_YELLOW}" - printf "===WARNING===\n" - printf "Detected machine architecture: ${MACHINE_ARCH}\n" - printf "This script only supports x86_64.\n" - printf "It is very likely to fail when installing dependencies on your machine.\n" - printf "\n" - printf "${COLOR_RESET}" - ;; - esac - -#################### -# Detect distro -# Helpful link(s): -# http://stackoverflow.com/questions/29581754 -# https://github.com/which-distro/os-release -export OS_RELEASE_FILE=${OS_RELEASE_FILE:-/etc/os-release} -test -f ${OS_RELEASE_FILE} || \ - ( echo "${OS_RELEASE_FILE} does not exist. Aborting..." ; exit 1 ; ) -export OS_DISTRO_ID=$(awk -F'=' '/^ID=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) -export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) -case $OS_DISTRO_ID in - "arch"|"endeavouros"|"cachyos") sleep 0;; - *) - case $OS_DISTRO_ID_LIKE in - "arch") - printf "${COLOR_YELLOW}" - printf "===WARNING===\n" - printf "Detected distro ID: ${OS_DISTRO_ID}\n" - printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" - printf "This script supports Arch Linux, so it should also work for your distro ideally.\n" - printf "Still, there is a chance that it not works as expected or even fails.\n" - printf "\n" - printf "${COLOR_RESET}" - ;; - *) - printf "${COLOR_RED}" - printf "===URGENT===\n" - printf "Detected distro ID: ${OS_DISTRO_ID}\n" - printf "Currently, only Arch(-based) distros are supported.\n" - printf "If you continue, this script will still move on and try to install some dependencies for you.\n" - printf "But it may disrupt your system and will likely fail without your manual intervention. Only continue at your own risk.\n" - printf "${COLOR_RESET}" - printf "${BG_COLOR_RED}" - printf "To tell you the truth, it is completely not worky at this time. The prompt here is only for testing and WIP. PLEASE JUST QUIT IMMEDIATELY.${COLOR_RESET}\n" - read -p "Still continue? [y/N] ====> " p - case $p in - [yY]) sleep 0 ;; - *) exit 1 ;; - esac - ;; - esac - ;; -esac diff --git a/scriptdata/options.sh b/scriptdata/options.sh index 0a4f7b49f..715b542c6 100644 --- a/scriptdata/options.sh +++ b/scriptdata/options.sh @@ -58,7 +58,7 @@ while true ; do -c|--clean) shift;; ## Ones without parameter -f|--force) ask=false;shift;; - --skip-alldeps) SKIP_PLASMAINTG=true;shift;; + --skip-alldeps) SKIP_ALLDEPS=true;shift;; --skip-allsetups) SKIP_ALLSETUPS=true;shift;; --skip-allfiles) SKIP_ALLFILES=true;shift;; -s|--skip-sysupdate) SKIP_SYSUPDATE=true;shift;; From 530987152cafb1376247941c5aaa749fbf597bf4 Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 02:12:07 +0800 Subject: [PATCH 09/18] Fix message in uninstall.sh --- uninstall.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uninstall.sh b/uninstall.sh index c72bf5f17..a7528de86 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -51,7 +51,8 @@ v sudo gpasswd -d "$user" input v sudo rm /etc/modules-load.d/i2c-dev.conf ############################################################################################################################## -read -p "Do you want to uninstall packages used by the dotfiles?\nCtrl+C to exit, or press Enter to proceed" +read -p "Do you want to uninstall the illogical-impulse-* meta packages (Arch Linux only)? +Ctrl+C to exit, or press Enter to proceed" # Removing installed yay packages and dependencies v yay -Rns illogical-impulse-{agsv1,audio,backlight,basic,bibata-modern-classic-bin,fonts-themes,gnome,gtk,hyprland,microtex-git,oneui4-icons-git,portal,python,screencapture,widgets} plasma-browser-integration From 58e99403ad4ac5d00ddcb5e1d4fc0e2e3d67ad41 Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 02:24:11 +0800 Subject: [PATCH 10/18] Add comment. --- scriptdata/install-deps-nix.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scriptdata/install-deps-nix.sh b/scriptdata/install-deps-nix.sh index 77697e501..9451b2a5f 100644 --- a/scriptdata/install-deps-nix.sh +++ b/scriptdata/install-deps-nix.sh @@ -2,3 +2,21 @@ # It's not for directly running. # This file is currently WIP. +# +# +# TODO: +# Write a proper `flake.nix` and optionally `home.nix` and other files (under a new folder `scriptdata/iiqs-hm`) to install all dependencies that `scriptdata/install-deps-arch.sh` does. (excluding the screenlock) +# +# TODO: +# In this script, i.e. `scriptdata/install-deps.nix.sh`, implement the process below: +# 1. Warning user about "this script is only experimental and must only use it at your own risks.", and prompt `y/N` (default N) before proceeding. +# 2. If nix not installed: +# 1. install nix via [DeterminateSystems/nix-installer](https://github.com/DeterminateSystems/nix-installer). +# 2. Enable nix (probably in `.zshrc` or `~/.config/fish`). +# 3. Ensure the experimental feature, Nix Flake, is enabled. +# 3. Sync (copy) `iiqs-hm` folder to `~/.config/iiqs-hm` using `rsync`. +# 4. Use something like `home-manager switch --flake .#iiqs` to install the dependencies. +# 5. Install screen lock using system package manager of the current distro. +# +# TODO: +# Write guide for people already use nix, so they can manually grab things from this repo to their own Nix/home-manager configurations to install the dependencies. From 7bd3f1e08d29fdcc8e9d9f2dda74deb6723fb686 Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 02:31:44 +0800 Subject: [PATCH 11/18] Update comment. --- scriptdata/install-deps-nix.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scriptdata/install-deps-nix.sh b/scriptdata/install-deps-nix.sh index 9451b2a5f..0342b1996 100644 --- a/scriptdata/install-deps-nix.sh +++ b/scriptdata/install-deps-nix.sh @@ -17,6 +17,7 @@ # 3. Sync (copy) `iiqs-hm` folder to `~/.config/iiqs-hm` using `rsync`. # 4. Use something like `home-manager switch --flake .#iiqs` to install the dependencies. # 5. Install screen lock using system package manager of the current distro. +# Note that this script must be idempotent. # # TODO: # Write guide for people already use nix, so they can manually grab things from this repo to their own Nix/home-manager configurations to install the dependencies. From f87e6e2b6ae2f22ee3d9ade6525a213c80aeeb7c Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 02:41:48 +0800 Subject: [PATCH 12/18] Update message in install-deps.sh --- scriptdata/install-deps.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scriptdata/install-deps.sh b/scriptdata/install-deps.sh index 28131c24a..5351686a3 100644 --- a/scriptdata/install-deps.sh +++ b/scriptdata/install-deps.sh @@ -48,13 +48,14 @@ elif [[ "$OS_DISTRO_ID" =~ ^(arch|endeavouros)$ ]]; then printf "${COLOR_GREEN}" printf "===INFO===\n" printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "./scriptdata/install-deps-arch.sh will be used.\n" printf "\n" printf "${COLOR_RESET}" source ./scriptdata/install-deps-arch.sh elif [[ -f "./scriptdata/install-deps-${OS_DISTRO_ID}.sh" ]]; then - printf "${COLOR_BLUE}" + printf "${COLOR_PURPLE}" printf "===NOTICE===\n" printf "Detected distro ID: ${OS_DISTRO_ID}\n" printf "./scriptdata/install-deps-${OS_DISTRO_ID}.sh detected and will be used.\n" @@ -70,7 +71,8 @@ elif [[ "$OS_DISTRO_ID_LIKE" == "arch" ]]; then printf "===WARNING===\n" printf "Detected distro ID: ${OS_DISTRO_ID}\n" printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" - printf "This script supports Arch Linux, so it should also work for your distro ideally.\n" + printf "./scriptdata/install-deps-arch.sh will be used.\n" + printf "Ideally, it should also work for your distro.\n" printf "Still, there is a chance that it not works as expected or even fails.\n" printf "Use it only at your own risk.\n" printf "\n" From 34c9cbeedbe5c917cb164bd0638cbbc540875e27 Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 05:54:35 +0800 Subject: [PATCH 13/18] Tweaks for text and names --- README.md | 2 +- diagnose | 6 +-- {arch-packages => dist-arch}/.gitignore | 0 .../illogical-impulse-audio/PKGBUILD | 0 .../illogical-impulse-backlight/PKGBUILD | 0 .../illogical-impulse-basic/PKGBUILD | 0 .../PKGBUILD | 0 .../illogical-impulse-fonts-themes/PKGBUILD | 0 .../illogical-impulse-hyprland/PKGBUILD | 0 .../illogical-impulse-kde/PKGBUILD | 0 .../illogical-impulse-microtex-git/.gitignore | 0 .../illogical-impulse-microtex-git/PKGBUILD | 0 .../.gitignore | 0 .../PKGBUILD | 0 .../illogical-impulse-portal/PKGBUILD | 0 .../illogical-impulse-python/PKGBUILD | 0 .../illogical-impulse-screencapture/PKGBUILD | 0 .../illogical-impulse-toolkit/PKGBUILD | 0 .../illogical-impulse-widgets/PKGBUILD | 0 install.sh | 6 +-- manual-install-helper.sh | 24 --------- scriptdata/environment-variables.sh | 25 +++++---- scriptdata/functions.sh | 42 +++++++-------- scriptdata/install-deps-arch.sh | 22 ++++---- scriptdata/install-deps.sh | 42 ++++++++------- scriptdata/install-files.sh | 54 +++++++++---------- scriptdata/install-greeting.sh | 8 +-- uninstall.sh | 10 ++-- update.sh | 8 +-- 29 files changed, 117 insertions(+), 132 deletions(-) rename {arch-packages => dist-arch}/.gitignore (100%) rename {arch-packages => dist-arch}/illogical-impulse-audio/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-backlight/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-basic/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-bibata-modern-classic-bin/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-fonts-themes/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-hyprland/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-kde/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-microtex-git/.gitignore (100%) rename {arch-packages => dist-arch}/illogical-impulse-microtex-git/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-oneui4-icons-git/.gitignore (100%) rename {arch-packages => dist-arch}/illogical-impulse-oneui4-icons-git/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-portal/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-python/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-screencapture/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-toolkit/PKGBUILD (100%) rename {arch-packages => dist-arch}/illogical-impulse-widgets/PKGBUILD (100%) delete mode 100755 manual-install-helper.sh diff --git a/README.md b/README.md index 982f10273..28e0552d2 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ | [Hyprland](https://github.com/hyprwm/hyprland) | The compositor (manages and renders windows) | | [Quickshell](https://quickshell.outfoxxed.me/) | A QtQuick-based widget system, used for the status bar, sidebars, etc. | - - For the full list of dependencies, see the [arch-packages folder](https://github.com/end-4/dots-hyprland/tree/main/arch-packages) + - For the full list of dependencies, see the [dist-arch folder](https://github.com/end-4/dots-hyprland/tree/main/dist-arch) - THERE IS NO WAYBAR STOP FUCKING CALLING EVERY BAR WAYBAR diff --git a/diagnose b/diagnose index 3d67cdb81..667cba850 100755 --- a/diagnose +++ b/diagnose @@ -2,14 +2,14 @@ # # This script is for quickly generate helpful info # It should be as independent as possible and should not source other files unless it has to -COLOR_RED='\e[31m' -COLOR_RESET='\e[00m' +STY_RED='\e[31m' +STY_RESET='\e[00m' cd "$(dirname "$0")";export base="$(pwd)" output_file=diagnose.result;rm $output_file export LANG=C;export LC_ALL=C case $(whoami) in - root)echo -e "${COLOR_RED}[$0]: This script is NOT to be executed with sudo or as root. Aborting...${COLOR_RESET}";exit 1;; + root)echo -e "${STY_RED}[$0]: This script is NOT to be executed with sudo or as root. Aborting...${STY_RESET}";exit 1;; esac diff --git a/arch-packages/.gitignore b/dist-arch/.gitignore similarity index 100% rename from arch-packages/.gitignore rename to dist-arch/.gitignore diff --git a/arch-packages/illogical-impulse-audio/PKGBUILD b/dist-arch/illogical-impulse-audio/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-audio/PKGBUILD rename to dist-arch/illogical-impulse-audio/PKGBUILD diff --git a/arch-packages/illogical-impulse-backlight/PKGBUILD b/dist-arch/illogical-impulse-backlight/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-backlight/PKGBUILD rename to dist-arch/illogical-impulse-backlight/PKGBUILD diff --git a/arch-packages/illogical-impulse-basic/PKGBUILD b/dist-arch/illogical-impulse-basic/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-basic/PKGBUILD rename to dist-arch/illogical-impulse-basic/PKGBUILD diff --git a/arch-packages/illogical-impulse-bibata-modern-classic-bin/PKGBUILD b/dist-arch/illogical-impulse-bibata-modern-classic-bin/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-bibata-modern-classic-bin/PKGBUILD rename to dist-arch/illogical-impulse-bibata-modern-classic-bin/PKGBUILD diff --git a/arch-packages/illogical-impulse-fonts-themes/PKGBUILD b/dist-arch/illogical-impulse-fonts-themes/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-fonts-themes/PKGBUILD rename to dist-arch/illogical-impulse-fonts-themes/PKGBUILD diff --git a/arch-packages/illogical-impulse-hyprland/PKGBUILD b/dist-arch/illogical-impulse-hyprland/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-hyprland/PKGBUILD rename to dist-arch/illogical-impulse-hyprland/PKGBUILD diff --git a/arch-packages/illogical-impulse-kde/PKGBUILD b/dist-arch/illogical-impulse-kde/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-kde/PKGBUILD rename to dist-arch/illogical-impulse-kde/PKGBUILD diff --git a/arch-packages/illogical-impulse-microtex-git/.gitignore b/dist-arch/illogical-impulse-microtex-git/.gitignore similarity index 100% rename from arch-packages/illogical-impulse-microtex-git/.gitignore rename to dist-arch/illogical-impulse-microtex-git/.gitignore diff --git a/arch-packages/illogical-impulse-microtex-git/PKGBUILD b/dist-arch/illogical-impulse-microtex-git/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-microtex-git/PKGBUILD rename to dist-arch/illogical-impulse-microtex-git/PKGBUILD diff --git a/arch-packages/illogical-impulse-oneui4-icons-git/.gitignore b/dist-arch/illogical-impulse-oneui4-icons-git/.gitignore similarity index 100% rename from arch-packages/illogical-impulse-oneui4-icons-git/.gitignore rename to dist-arch/illogical-impulse-oneui4-icons-git/.gitignore diff --git a/arch-packages/illogical-impulse-oneui4-icons-git/PKGBUILD b/dist-arch/illogical-impulse-oneui4-icons-git/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-oneui4-icons-git/PKGBUILD rename to dist-arch/illogical-impulse-oneui4-icons-git/PKGBUILD diff --git a/arch-packages/illogical-impulse-portal/PKGBUILD b/dist-arch/illogical-impulse-portal/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-portal/PKGBUILD rename to dist-arch/illogical-impulse-portal/PKGBUILD diff --git a/arch-packages/illogical-impulse-python/PKGBUILD b/dist-arch/illogical-impulse-python/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-python/PKGBUILD rename to dist-arch/illogical-impulse-python/PKGBUILD diff --git a/arch-packages/illogical-impulse-screencapture/PKGBUILD b/dist-arch/illogical-impulse-screencapture/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-screencapture/PKGBUILD rename to dist-arch/illogical-impulse-screencapture/PKGBUILD diff --git a/arch-packages/illogical-impulse-toolkit/PKGBUILD b/dist-arch/illogical-impulse-toolkit/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-toolkit/PKGBUILD rename to dist-arch/illogical-impulse-toolkit/PKGBUILD diff --git a/arch-packages/illogical-impulse-widgets/PKGBUILD b/dist-arch/illogical-impulse-widgets/PKGBUILD similarity index 100% rename from arch-packages/illogical-impulse-widgets/PKGBUILD rename to dist-arch/illogical-impulse-widgets/PKGBUILD diff --git a/install.sh b/install.sh index ce0ce1a35..4acf78f7e 100755 --- a/install.sh +++ b/install.sh @@ -14,16 +14,16 @@ set -e source ./scriptdata/install-greeting.sh ##################################################################################### if [[ "${SKIP_ALLDEPS}" != true ]]; then - printf "${COLOR_CYAN}[$0]: 1. Install dependencies\n${COLOR_RESET}" + printf "${STY_CYAN}[$0]: 1. Install dependencies\n${STY_RESET}" source ./scriptdata/install-deps.sh fi ##################################################################################### if [[ "${SKIP_ALLSETUPS}" != true ]]; then - printf "${COLOR_CYAN}[$0]: 2. Setup for user groups/services etc\n${COLOR_RESET}" + printf "${STY_CYAN}[$0]: 2. Setup for user groups/services etc\n${STY_RESET}" source ./scriptdata/install-setups.sh fi ##################################################################################### if [[ "${SKIP_ALLFILES}" != true ]]; then - printf "${COLOR_CYAN}[$0]: 3. Copying + Configuring\n${COLOR_RESET}" + printf "${STY_CYAN}[$0]: 3. Copying + Configuring\n${STY_RESET}" source ./scriptdata/install-files.sh fi diff --git a/manual-install-helper.sh b/manual-install-helper.sh deleted file mode 100755 index 7ea34ebee..000000000 --- a/manual-install-helper.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# -# This script is for installing/updating some "packages" for non-Arch users. -# - -cd "$(dirname "$0")" -export base="$(pwd)" -source ./scriptdata/environment-variables.sh -source ./scriptdata/functions.sh -source ./scriptdata/installers.sh -prevent_sudo_or_root - -if command -v pacman >/dev/null 2>&1;then printf "${COLOR_RED}[$0]: pacman found, it seems that the system is ArchLinux or Arch-based distro. Aborting...${COLOR_RESET}\n";exit 1;fi -v install-Rubik -v install-Gabarito -v install-OneUI -v install-bibata -v install-MicroTeX -v install-uv -v install-python-packages - -if [[ -z "${ILLOGICAL_IMPULSE_VIRTUAL_ENV}" ]]; then - printf "\n${COLOR_RED}[$0]: \!! Important \!! : Please ensure environment variable ${COLOR_RESET} \$ILLOGICAL_IMPULSE_VIRTUAL_ENV ${COLOR_RED} is set to proper value (by default \"~/.local/state/ags/.venv\"), or AGS config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.${COLOR_RESET}\n" -fi diff --git a/scriptdata/environment-variables.sh b/scriptdata/environment-variables.sh index 44057679c..0da81f112 100644 --- a/scriptdata/environment-variables.sh +++ b/scriptdata/environment-variables.sh @@ -7,14 +7,19 @@ XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} BACKUP_DIR=${BACKUP_DIR:-$HOME/backup} -COLOR_RED='\e[00m\e[31m' -COLOR_GREEN='\e[00m\e[32m' -COLOR_YELLOW='\e[00m\e[33m' -COLOR_BLUE='\e[00m\e[34m' -COLOR_PURPLE='\e[00m\e[35m' -COLOR_CYAN='\e[00m\e[36m' -COLOR_RESET='\e[00m' +STY_RED='\e[00m\e[31m' +STY_GREEN='\e[00m\e[32m' +STY_YELLOW='\e[00m\e[33m' +STY_BLUE='\e[00m\e[34m' +STY_PURPLE='\e[00m\e[35m' +STY_CYAN='\e[00m\e[36m' -STYLE_UNDERLINE='\e[4m' -BG_COLOR_CYAN='\e[30m\e[46m' -BG_COLOR_RED='\e[30m\e[41m' +STY_BG_RED='\e[30m\e[41m' +STY_BG_GREEN='\e[30m\e[42m' +STY_BG_YELLOW='\e[30m\e[43m' +STY_BG_BLUE='\e[30m\e[44m' +STY_BG_PURPLE='\e[30m\e[45m' +STY_BG_CYAN='\e[30m\e[46m' + +STY_UNDERLINE='\e[4m' +STY_RESET='\e[00m' diff --git a/scriptdata/functions.sh b/scriptdata/functions.sh index e5477fa0c..19410b5eb 100644 --- a/scriptdata/functions.sh +++ b/scriptdata/functions.sh @@ -8,60 +8,60 @@ function try { "$@" || sleep 0; } function v(){ echo -e "####################################################" - echo -e "${COLOR_BLUE}[$0]: Next command:${COLOR_RESET}" - echo -e "${COLOR_GREEN}$@${COLOR_RESET}" + echo -e "${STY_BLUE}[$0]: Next command:${STY_RESET}" + echo -e "${STY_GREEN}$@${STY_RESET}" execute=true if $ask;then while true;do - echo -e "${COLOR_BLUE}Execute? ${COLOR_RESET}" + echo -e "${STY_BLUE}Execute? ${STY_RESET}" echo " y = Yes" echo " e = Exit now" echo " s = Skip this command (NOT recommended - your setup might not work correctly)" echo " yesforall = Yes and don't ask again; NOT recommended unless you really sure" read -p "====> " p case $p in - [yY]) echo -e "${COLOR_BLUE}OK, executing...${COLOR_RESET}" ;break ;; - [eE]) echo -e "${COLOR_BLUE}Exiting...${COLOR_RESET}" ;exit ;break ;; - [sS]) echo -e "${COLOR_BLUE}Alright, skipping this one...${COLOR_RESET}" ;execute=false ;break ;; - "yesforall") echo -e "${COLOR_BLUE}Alright, won't ask again. Executing...${COLOR_RESET}"; ask=false ;break ;; - *) echo -e "${COLOR_RED}Please enter [y/e/s/yesforall].${COLOR_RESET}";; + [yY]) echo -e "${STY_BLUE}OK, executing...${STY_RESET}" ;break ;; + [eE]) echo -e "${STY_BLUE}Exiting...${STY_RESET}" ;exit ;break ;; + [sS]) echo -e "${STY_BLUE}Alright, skipping this one...${STY_RESET}" ;execute=false ;break ;; + "yesforall") echo -e "${STY_BLUE}Alright, won't ask again. Executing...${STY_RESET}"; ask=false ;break ;; + *) echo -e "${STY_RED}Please enter [y/e/s/yesforall].${STY_RESET}";; esac done fi if $execute;then x "$@";else - echo -e "${COLOR_YELLOW}[$0]: Skipped \"$@\"${COLOR_RESET}" + echo -e "${STY_YELLOW}[$0]: Skipped \"$@\"${STY_RESET}" fi } # When use v() for a defined function, use x() INSIDE its definition to catch errors. function x(){ if "$@";then cmdstatus=0;else cmdstatus=1;fi # 0=normal; 1=failed; 2=failed but ignored while [ $cmdstatus == 1 ] ;do - echo -e "${COLOR_RED}[$0]: Command \"${COLOR_GREEN}$@${COLOR_RED}\" has failed." + echo -e "${STY_RED}[$0]: Command \"${STY_GREEN}$@${STY_RED}\" has failed." echo -e "You may need to resolve the problem manually BEFORE repeating this command." - echo -e "[Tip] If a certain package is failing to install, try installing it separately in another terminal.${COLOR_RESET}" + echo -e "[Tip] If a certain package is failing to install, try installing it separately in another terminal.${STY_RESET}" echo " r = Repeat this command (DEFAULT)" echo " e = Exit now" echo " i = Ignore this error and continue (your setup might not work correctly)" read -p " [R/e/i]: " p case $p in - [iI]) echo -e "${COLOR_BLUE}Alright, ignore and continue...${COLOR_RESET}";cmdstatus=2;; - [eE]) echo -e "${COLOR_BLUE}Alright, will exit.${COLOR_RESET}";break;; - *) echo -e "${COLOR_BLUE}OK, repeating...${COLOR_RESET}" + [iI]) echo -e "${STY_BLUE}Alright, ignore and continue...${STY_RESET}";cmdstatus=2;; + [eE]) echo -e "${STY_BLUE}Alright, will exit.${STY_RESET}";break;; + *) echo -e "${STY_BLUE}OK, repeating...${STY_RESET}" if "$@";then cmdstatus=0;else cmdstatus=1;fi ;; esac done case $cmdstatus in - 0) echo -e "${COLOR_BLUE}[$0]: Command \"${COLOR_GREEN}$@${COLOR_BLUE}\" finished.${COLOR_RESET}";; - 1) echo -e "${COLOR_RED}[$0]: Command \"${COLOR_GREEN}$@${COLOR_RED}\" has failed. Exiting...${COLOR_RESET}";exit 1;; - 2) echo -e "${COLOR_RED}[$0]: Command \"${COLOR_GREEN}$@${COLOR_RED}\" has failed but ignored by user.${COLOR_RESET}";; + 0) echo -e "${STY_BLUE}[$0]: Command \"${STY_GREEN}$@${STY_BLUE}\" finished.${STY_RESET}";; + 1) echo -e "${STY_RED}[$0]: Command \"${STY_GREEN}$@${STY_RED}\" has failed. Exiting...${STY_RESET}";exit 1;; + 2) echo -e "${STY_RED}[$0]: Command \"${STY_GREEN}$@${STY_RED}\" has failed but ignored by user.${STY_RESET}";; esac } function showfun(){ - echo -e "${COLOR_BLUE}[$0]: The definition of function \"$1\" is as follows:${COLOR_RESET}" - printf "${COLOR_GREEN}" + echo -e "${STY_BLUE}[$0]: The definition of function \"$1\" is as follows:${STY_RESET}" + printf "${STY_GREEN}" type -a $1 - printf "${COLOR_RESET}" + printf "${STY_RESET}" } function remove_bashcomments_emptylines(){ mkdir -p $(dirname $2) @@ -69,6 +69,6 @@ function remove_bashcomments_emptylines(){ } function prevent_sudo_or_root(){ case $(whoami) in - root) echo -e "${COLOR_RED}[$0]: This script is NOT to be executed with sudo or as root. Aborting...${COLOR_RESET}";exit 1;; + root) echo -e "${STY_RED}[$0]: This script is NOT to be executed with sudo or as root. Aborting...${STY_RESET}";exit 1;; esac } diff --git a/scriptdata/install-deps-arch.sh b/scriptdata/install-deps-arch.sh index ecf1402ed..ed906efef 100644 --- a/scriptdata/install-deps-arch.sh +++ b/scriptdata/install-deps-arch.sh @@ -13,7 +13,7 @@ install-yay(){ } handle-deprecated-dependencies(){ - printf "${COLOR_CYAN}[$0]: Removing deprecated dependencies:${COLOR_RESET}\n" + printf "${STY_CYAN}[$0]: Removing deprecated dependencies:${STY_RESET}\n" for i in illogical-impulse-{microtex,pymyc-aur,ags,agsv1} {hyprutils,hyprpicker,hyprlang,hypridle,hyprland-qt-support,hyprland-qtutils,hyprlock,xdg-desktop-portal-hyprland,hyprcursor,hyprwayland-scanner,hyprland}-git;do try sudo pacman --noconfirm -Rdd $i;done # Convert old dependencies to non explicit dependencies so that they can be orphaned if not in meta packages remove_bashcomments_emptylines ./scriptdata/previous_dependencies.conf ./cache/old_deps_stripped.conf @@ -31,7 +31,7 @@ handle-deprecated-dependencies(){ ##################################################################################### if ! command -v pacman >/dev/null 2>&1; then - printf "${COLOR_RED}[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...${COLOR_RESET}\n" + printf "${STY_RED}[$0]: pacman not found, it seems that the system is not ArchLinux or Arch-based distros. Aborting...${STY_RESET}\n" exit 1 fi @@ -47,7 +47,7 @@ readarray -t pkglist < ./cache/dependencies_stripped.conf # Use yay. Because paru does not support cleanbuild. # Also see https://wiki.hyprland.org/FAQ/#how-do-i-update if ! command -v yay >/dev/null 2>&1;then - echo -e "${COLOR_YELLOW}[$0]: \"yay\" not found.${COLOR_RESET}" + echo -e "${STY_YELLOW}[$0]: \"yay\" not found.${STY_RESET}" showfun install-yay v install-yay fi @@ -82,12 +82,12 @@ install-local-pkgbuild() { } # Install core dependencies from the meta-packages -metapkgs=(./arch-packages/illogical-impulse-{audio,backlight,basic,fonts-themes,kde,portal,python,screencapture,toolkit,widgets}) -metapkgs+=(./arch-packages/illogical-impulse-hyprland) -metapkgs+=(./arch-packages/illogical-impulse-microtex-git) -# metapkgs+=(./arch-packages/illogical-impulse-oneui4-icons-git) +metapkgs=(./dist-arch/illogical-impulse-{audio,backlight,basic,fonts-themes,kde,portal,python,screencapture,toolkit,widgets}) +metapkgs+=(./dist-arch/illogical-impulse-hyprland) +metapkgs+=(./dist-arch/illogical-impulse-microtex-git) +# metapkgs+=(./dist-arch/packages/illogical-impulse-oneui4-icons-git) [[ -f /usr/share/icons/Bibata-Modern-Classic/index.theme ]] || \ - metapkgs+=(./arch-packages/illogical-impulse-bibata-modern-classic-bin) + metapkgs+=(./dist-arch/illogical-impulse-bibata-modern-classic-bin) for i in "${metapkgs[@]}"; do metainstallflags="--needed" @@ -101,9 +101,9 @@ case $SKIP_PLASMAINTG in true) sleep 0;; *) if $ask;then - echo -e "${COLOR_YELLOW}[$0]: NOTE: The size of \"plasma-browser-integration\" is about 600 MiB.${COLOR_RESET}" - echo -e "${COLOR_YELLOW}It is needed if you want playtime of media in Firefox to be shown on the music controls widget.${COLOR_RESET}" - echo -e "${COLOR_YELLOW}Install it? [y/N]${COLOR_RESET}" + echo -e "${STY_YELLOW}[$0]: NOTE: The size of \"plasma-browser-integration\" is about 600 MiB.${STY_RESET}" + echo -e "${STY_YELLOW}It is needed if you want playtime of media in Firefox to be shown on the music controls widget.${STY_RESET}" + echo -e "${STY_YELLOW}Install it? [y/N]${STY_RESET}" read -p "====> " p else p=y diff --git a/scriptdata/install-deps.sh b/scriptdata/install-deps.sh index 5351686a3..a100d7885 100644 --- a/scriptdata/install-deps.sh +++ b/scriptdata/install-deps.sh @@ -9,13 +9,13 @@ export MACHINE_ARCH=$(uname -m) case $MACHINE_ARCH in "x86_64") sleep 0;; *) - printf "${COLOR_YELLOW}" + printf "${STY_YELLOW}" printf "===WARNING===\n" printf "Detected machine architecture: ${MACHINE_ARCH}\n" printf "This script only supports x86_64.\n" printf "It is very likely to fail when installing dependencies on your machine.\n" printf "\n" - printf "${COLOR_RESET}" + printf "${STY_RESET}" ;; esac @@ -34,64 +34,68 @@ export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolo if [[ "$INSTALL_VIA_NIX" == "true" ]]; then - printf "${COLOR_YELLOW}" + printf "${STY_YELLOW}" printf "===WARNING===\n" printf "Nix will be used to install dependencies.\n" printf "The process is still WIP.\n" - printf "Only continue at your own risk.\n" + printf "Proceed only at your own risk.\n" printf "\n" - printf "${COLOR_RESET}" + printf "${STY_RESET}" source ./scriptdata/install-deps-nix.sh elif [[ "$OS_DISTRO_ID" =~ ^(arch|endeavouros)$ ]]; then - printf "${COLOR_GREEN}" + printf "${STY_GREEN}" printf "===INFO===\n" printf "Detected distro ID: ${OS_DISTRO_ID}\n" printf "./scriptdata/install-deps-arch.sh will be used.\n" printf "\n" - printf "${COLOR_RESET}" + printf "${STY_RESET}" source ./scriptdata/install-deps-arch.sh elif [[ -f "./scriptdata/install-deps-${OS_DISTRO_ID}.sh" ]]; then - printf "${COLOR_PURPLE}" + printf "${STY_PURPLE}" printf "===NOTICE===\n" printf "Detected distro ID: ${OS_DISTRO_ID}\n" printf "./scriptdata/install-deps-${OS_DISTRO_ID}.sh detected and will be used.\n" + printf "This file is provided by the community.\n" printf "It is not officially supported by github:end-4/dots-hyprland .\n" - printf "Use it only at your own risk.\n" + printf "${STY_BG_PURPLE}" + printf "If you find out any problems about it, PR is welcomed if you are able to address it. Or, create a discussion about it, but please do not submit issue, because the developers do not use this distro, therefore they cannot help.${STY_RESET}\n" + printf "${STY_PURPLE}" + printf "Proceed only at your own risk.\n" printf "\n" - printf "${COLOR_RESET}" + printf "${STY_RESET}" source ./scriptdata/install-deps-${OS_DISTRO_ID}.sh elif [[ "$OS_DISTRO_ID_LIKE" == "arch" ]]; then - printf "${COLOR_YELLOW}" + printf "${STY_YELLOW}" printf "===WARNING===\n" printf "Detected distro ID: ${OS_DISTRO_ID}\n" printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" printf "./scriptdata/install-deps-arch.sh will be used.\n" printf "Ideally, it should also work for your distro.\n" printf "Still, there is a chance that it not works as expected or even fails.\n" - printf "Use it only at your own risk.\n" + printf "Proceed only at your own risk.\n" printf "\n" - printf "${COLOR_RESET}" + printf "${STY_RESET}" source ./scriptdata/install-deps-arch.sh else - printf "${COLOR_RED}" + printf "${STY_RED}" printf "===URGENT===\n" printf "Detected distro ID: ${OS_DISTRO_ID}\n" printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" - printf "No suitable dependency installation script found.\n" + printf "./scriptdata/install-deps-${OS_DISTRO_ID}.sh not found.\n" printf "./scriptdata/install-deps-fallback.sh will be used.\n" printf "It may disrupt your system and will likely fail without your manual intervention.\n" - printf "Only continue at your own risk.\n" - printf "${COLOR_RESET}" - printf "${BG_COLOR_RED}" - printf "To tell you the truth, it is completely not worky at this time. The prompt here is only for testing and WIP. PLEASE JUST QUIT IMMEDIATELY.${COLOR_RESET}\n" + printf "Proceed only at your own risk.\n" + printf "${STY_RESET}" + printf "${STY_BG_RED}" + printf "To tell you the truth, it is completely not worky at this time. The prompt here is only for testing and WIP. PLEASE JUST QUIT IMMEDIATELY.${STY_RESET}\n" read -p "Still continue? [y/N] ====> " p case $p in [yY]) sleep 0 ;; diff --git a/scriptdata/install-files.sh b/scriptdata/install-files.sh index 845f45c4b..7d39f2b4d 100644 --- a/scriptdata/install-files.sh +++ b/scriptdata/install-files.sh @@ -13,14 +13,14 @@ function backup_configs(){ } function ask_backup_configs(){ - printf "${COLOR_RED}" + printf "${STY_RED}" printf "Would you like to create a backup for \"$XDG_CONFIG_HOME\" and \"$HOME/.local/\" folders?\n[y/N]: " read -p " " backup_confirm case $backup_confirm in [yY][eE][sS]|[yY]) backup_configs ;; *) echo "Skipping backup..." ;; esac - printf "${COLOR_RESET}" + printf "${STY_RESET}" } ##################################################################################### @@ -65,40 +65,40 @@ case $SKIP_HYPRLAND in v rsync -av --delete --exclude '/custom' --exclude '/hyprlock.conf' --exclude '/hypridle.conf' --exclude '/hyprland.conf' .config/hypr/ "$XDG_CONFIG_HOME"/hypr/ t="$XDG_CONFIG_HOME/hypr/hyprland.conf" if [ -f $t ];then - echo -e "${COLOR_BLUE}[$0]: \"$t\" already exists.${COLOR_RESET}" + echo -e "${STY_BLUE}[$0]: \"$t\" already exists.${STY_RESET}" v mv $t $t.old v cp -f .config/hypr/hyprland.conf $t existed_hypr_conf_firstrun=y else - echo -e "${COLOR_YELLOW}[$0]: \"$t\" does not exist yet.${COLOR_RESET}" + echo -e "${STY_YELLOW}[$0]: \"$t\" does not exist yet.${STY_RESET}" v cp .config/hypr/hyprland.conf $t existed_hypr_conf=n fi t="$XDG_CONFIG_HOME/hypr/hypridle.conf" if [ -f $t ];then - echo -e "${COLOR_BLUE}[$0]: \"$t\" already exists.${COLOR_RESET}" + echo -e "${STY_BLUE}[$0]: \"$t\" already exists.${STY_RESET}" v cp -f .config/hypr/hypridle.conf $t.new existed_hypridle_conf=y else - echo -e "${COLOR_YELLOW}[$0]: \"$t\" does not exist yet.${COLOR_RESET}" + echo -e "${STY_YELLOW}[$0]: \"$t\" does not exist yet.${STY_RESET}" v cp .config/hypr/hypridle.conf $t existed_hypridle_conf=n fi t="$XDG_CONFIG_HOME/hypr/hyprlock.conf" if [ -f $t ];then - echo -e "${COLOR_BLUE}[$0]: \"$t\" already exists.${COLOR_RESET}" + echo -e "${STY_BLUE}[$0]: \"$t\" already exists.${STY_RESET}" v cp -f .config/hypr/hyprlock.conf $t.new existed_hyprlock_conf=y else - echo -e "${COLOR_YELLOW}[$0]: \"$t\" does not exist yet.${COLOR_RESET}" + echo -e "${STY_YELLOW}[$0]: \"$t\" does not exist yet.${STY_RESET}" v cp .config/hypr/hyprlock.conf $t existed_hyprlock_conf=n fi t="$XDG_CONFIG_HOME/hypr/custom" if [ -d $t ];then - echo -e "${COLOR_BLUE}[$0]: \"$t\" already exists, will not do anything.${COLOR_RESET}" + echo -e "${STY_BLUE}[$0]: \"$t\" already exists, will not do anything.${STY_RESET}" else - echo -e "${COLOR_YELLOW}[$0]: \"$t\" does not exist yet.${COLOR_RESET}" + echo -e "${STY_YELLOW}[$0]: \"$t\" does not exist yet.${STY_RESET}" v rsync -av --delete .config/hypr/custom/ $t/ fi ;; @@ -138,39 +138,39 @@ done printf "\n" printf "\n" printf "\n" -printf "${COLOR_CYAN}[$0]: Finished${COLOR_RESET}\n" +printf "${STY_CYAN}[$0]: Finished${STY_RESET}\n" printf "\n" -printf "${COLOR_CYAN}When starting Hyprland from your display manager (login screen) ${COLOR_RED} DO NOT SELECT UWSM ${COLOR_RESET}\n" +printf "${STY_CYAN}When starting Hyprland from your display manager (login screen) ${STY_RED} DO NOT SELECT UWSM ${STY_RESET}\n" printf "\n" -printf "${COLOR_CYAN}If you are already running Hyprland,${COLOR_RESET}\n" -printf "${COLOR_CYAN}Press ${BG_COLOR_CYAN} Ctrl+Super+T ${BG_COLOR_CYAN} to select a wallpaper${COLOR_RESET}\n" -printf "${COLOR_CYAN}Press ${BG_COLOR_CYAN} Super+/ ${COLOR_CYAN} for a list of keybinds${COLOR_RESET}\n" +printf "${STY_CYAN}If you are already running Hyprland,${STY_RESET}\n" +printf "${STY_CYAN}Press ${STY_BG_CYAN} Ctrl+Super+T ${STY_BG_CYAN} to select a wallpaper${STY_RESET}\n" +printf "${STY_CYAN}Press ${STY_BG_CYAN} Super+/ ${STY_CYAN} for a list of keybinds${STY_RESET}\n" printf "\n" -printf "${COLOR_CYAN}For suggestions/hints after installation:${COLOR_RESET}\n" -printf "${COLOR_CYAN}${STYLE_UNDERLINE} https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/01setup/#post-installation ${COLOR_RESET}\n" +printf "${STY_CYAN}For suggestions/hints after installation:${STY_RESET}\n" +printf "${STY_CYAN}${STY_UNDERLINE} https://end-4.github.io/dots-hyprland-wiki/en/ii-qs/01setup/#post-installation ${STY_RESET}\n" printf "\n" case $existed_hypr_conf_firstrun in - y) printf "\n${COLOR_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before. As it seems it is your first run, we replaced it with a new one. ${COLOR_RESET}\n" - printf "${COLOR_YELLOW}As it seems it is your first run, we replaced it with a new one. The old one has been renamed to \"$XDG_CONFIG_HOME/hypr/hyprland.conf.old\".${COLOR_RESET}\n" + y) printf "\n${STY_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before. As it seems it is your first run, we replaced it with a new one. ${STY_RESET}\n" + printf "${STY_YELLOW}As it seems it is your first run, we replaced it with a new one. The old one has been renamed to \"$XDG_CONFIG_HOME/hypr/hyprland.conf.old\".${STY_RESET}\n" ;;esac case $existed_hypr_conf in - y) printf "\n${COLOR_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before and we didn't overwrite it. ${COLOR_RESET}\n" - printf "${COLOR_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hyprland.conf.new\" as a reference for a proper format.${COLOR_RESET}\n" + y) printf "\n${STY_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprland.conf\" already existed before and we didn't overwrite it. ${STY_RESET}\n" + printf "${STY_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hyprland.conf.new\" as a reference for a proper format.${STY_RESET}\n" ;;esac case $existed_hypridle_conf in - y) printf "\n${COLOR_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hypridle.conf\" already existed before and we didn't overwrite it. ${COLOR_RESET}\n" - printf "${COLOR_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hypridle.conf.new\" as a reference for a proper format.${COLOR_RESET}\n" + y) printf "\n${STY_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hypridle.conf\" already existed before and we didn't overwrite it. ${STY_RESET}\n" + printf "${STY_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hypridle.conf.new\" as a reference for a proper format.${STY_RESET}\n" ;;esac case $existed_hyprlock_conf in - y) printf "\n${COLOR_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprlock.conf\" already existed before and we didn't overwrite it. ${COLOR_RESET}\n" - printf "${COLOR_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hyprlock.conf.new\" as a reference for a proper format.${COLOR_RESET}\n" + y) printf "\n${STY_YELLOW}[$0]: Warning: \"$XDG_CONFIG_HOME/hypr/hyprlock.conf\" already existed before and we didn't overwrite it. ${STY_RESET}\n" + printf "${STY_YELLOW}Please use \"$XDG_CONFIG_HOME/hypr/hyprlock.conf.new\" as a reference for a proper format.${STY_RESET}\n" ;;esac if [[ -z "${ILLOGICAL_IMPULSE_VIRTUAL_ENV}" ]]; then - printf "\n${COLOR_RED}[$0]: \!! Important \!! : Please ensure environment variable ${COLOR_RESET} \$ILLOGICAL_IMPULSE_VIRTUAL_ENV ${COLOR_RED} is set to proper value (by default \"~/.local/state/quickshell/.venv\"), or Quickshell config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.${COLOR_RESET}\n" + printf "\n${STY_RED}[$0]: \!! Important \!! : Please ensure environment variable ${STY_RESET} \$ILLOGICAL_IMPULSE_VIRTUAL_ENV ${STY_RED} is set to proper value (by default \"~/.local/state/quickshell/.venv\"), or Quickshell config will not work. We have already provided this configuration in ~/.config/hypr/hyprland/env.conf, but you need to ensure it is included in hyprland.conf, and also a restart is needed for applying it.${STY_RESET}\n" fi if [[ ! -z "${warn_files[@]}" ]]; then - printf "\n${COLOR_RED}[$0]: \!! Important \!! : Please delete ${COLOR_RESET} ${warn_files[*]} ${COLOR_RED} manually as soon as possible, since we\'re now using AUR package or local PKGBUILD to install them for Arch(based) Linux distros, and they'll take precedence over our installation, or at least take up more space.${COLOR_RESET}\n" + printf "\n${STY_RED}[$0]: \!! Important \!! : Please delete ${STY_RESET} ${warn_files[*]} ${STY_RED} manually as soon as possible, since we\'re now using AUR package or local PKGBUILD to install them for Arch(based) Linux distros, and they'll take precedence over our installation, or at least take up more space.${STY_RESET}\n" fi diff --git a/scriptdata/install-greeting.sh b/scriptdata/install-greeting.sh index 3da9615c1..8fe80fda8 100644 --- a/scriptdata/install-greeting.sh +++ b/scriptdata/install-greeting.sh @@ -3,7 +3,7 @@ ##################################################################################### -printf "${COLOR_BLUE}[$0]: Hi there! Before we start:\n" +printf "${STY_BLUE}[$0]: Hi there! Before we start:\n" printf '\n' printf '[NEW] illogical-impulse is now powered by Quickshell. If you were using the old version with AGS and would like to keep it, do not run this script.\n' printf ' The AGS version, although uses less memory, has much worse performance (it uses Gtk3). \n' @@ -12,12 +12,12 @@ printf ' If you would like the AGS version anyway, run the script in its br printf '\n' printf 'This script does not handle system-level/hardware stuff like Nvidia drivers.\n' printf "\n" -printf "${COLOR_RESET}" +printf "${STY_RESET}" case $ask in false) sleep 0 ;; *) - printf "${COLOR_RED}" + printf "${STY_RED}" printf '\n' printf 'Do you want to confirm every time before a command executes?\n' printf ' y = Yes, ask me before executing each of them. (DEFAULT)\n' @@ -29,6 +29,6 @@ case $ask in a) exit 1 ;; *) ask=true ;; esac - printf "${COLOR_RESET}" + printf "${STY_RESET}" ;; esac diff --git a/uninstall.sh b/uninstall.sh index a7528de86..d76104166 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -5,8 +5,8 @@ source ./scriptdata/functions.sh prevent_sudo_or_root function v() { - echo -e "[$0]: ${COLOR_GREEN}Now executing:${COLOR_RESET}" - echo -e "${COLOR_GREEN}$@${COLOR_RESET}" + echo -e "[$0]: ${STY_GREEN}Now executing:${STY_RESET}" + echo -e "${STY_GREEN}$@${STY_RESET}" "$@" } @@ -21,7 +21,7 @@ set -e ############################################################################################################################## # Undo Step 3: Removing copied config and local folders -printf "${COLOR_CYAN}Removing copied config and local folders...\n${COLOR_RESET}" +printf "${STY_CYAN}Removing copied config and local folders...\n${STY_RESET}" for i in ags fish fontconfig foot fuzzel hypr mpv wlogout "starship.toml" rubyshot do v rm -rf "$XDG_CONFIG_HOME/$i" @@ -43,7 +43,7 @@ v sudo rm -rf "$XDG_STATE_HOME/ags" ############################################################################################################################## # Undo Step 1: Remove added user from video, i2c, and input groups and remove yay packages -printf "${COLOR_CYAN}Removing user from video, i2c, and input groups and removing packages...\n${COLOR_RESET}" +printf "${STY_CYAN}Removing user from video, i2c, and input groups and removing packages...\n${STY_RESET}" user=$(whoami) v sudo gpasswd -d "$user" video v sudo gpasswd -d "$user" i2c @@ -57,4 +57,4 @@ Ctrl+C to exit, or press Enter to proceed" # Removing installed yay packages and dependencies v yay -Rns illogical-impulse-{agsv1,audio,backlight,basic,bibata-modern-classic-bin,fonts-themes,gnome,gtk,hyprland,microtex-git,oneui4-icons-git,portal,python,screencapture,widgets} plasma-browser-integration -printf "${COLOR_CYAN}Uninstall Complete.\n${COLOR_RESET}" +printf "${STY_CYAN}Uninstall Complete.\n${STY_RESET}" diff --git a/update.sh b/update.sh index 875a841ad..8fb7a299a 100755 --- a/update.sh +++ b/update.sh @@ -14,7 +14,7 @@ set -uo pipefail FORCE_CHECK=false CHECK_PACKAGES=false REPO_DIR="$(cd "$(dirname $0)" &>/dev/null && pwd)" -ARCH_PACKAGES_DIR="${REPO_DIR}/arch-packages" +ARCH_PACKAGES_DIR="${REPO_DIR}/dist-arch" UPDATE_IGNORE_FILE="${REPO_DIR}/.updateignore" HOME_UPDATE_IGNORE_FILE="${HOME}/.updateignore" @@ -333,7 +333,7 @@ list_packages() { local changed_packages=() if [[ ! -d "$ARCH_PACKAGES_DIR" ]]; then - log_warning "No arch-packages directory found" + log_warning "No dist-arch directory found" return 1 fi @@ -349,7 +349,7 @@ list_packages() { done if [[ ${#available_packages[@]} -eq 0 ]]; then - log_info "No packages found in arch-packages directory" + log_info "No packages found in dist-arch directory" return 1 fi @@ -635,7 +635,7 @@ if [[ "$CHECK_PACKAGES" == true ]]; then log_header "Package Management" if [[ ! -d "$ARCH_PACKAGES_DIR" ]]; then - log_warning "No arch-packages directory found. Skipping package management." + log_warning "No dist-arch directory found. Skipping package management." else # Check if any PKGBUILDs have changed changed_pkgbuilds=() From 3a888f9be4b50f78d0544160698c3a44a484e3fd Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 07:13:51 +0800 Subject: [PATCH 14/18] Add pause(); distro specific also for setups --- scriptdata/environment-variables.sh | 6 ++ scriptdata/functions.sh | 3 + scriptdata/install-deps.sh | 14 ++-- scriptdata/install-files.sh | 1 + scriptdata/install-greeting.sh | 41 +++++++----- scriptdata/install-setups-arch.sh | 15 +++++ scriptdata/install-setups-fallback.sh | 15 +++++ scriptdata/install-setups-nix.sh | 15 +++++ scriptdata/install-setups.sh | 94 +++++++++++++++++++++++---- 9 files changed, 170 insertions(+), 34 deletions(-) create mode 100644 scriptdata/install-setups-arch.sh create mode 100644 scriptdata/install-setups-fallback.sh create mode 100644 scriptdata/install-setups-nix.sh diff --git a/scriptdata/environment-variables.sh b/scriptdata/environment-variables.sh index 0da81f112..d5eb8db68 100644 --- a/scriptdata/environment-variables.sh +++ b/scriptdata/environment-variables.sh @@ -7,6 +7,7 @@ XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} BACKUP_DIR=${BACKUP_DIR:-$HOME/backup} +# Note that all color styles contains a STY_RESET before it. STY_RED='\e[00m\e[31m' STY_GREEN='\e[00m\e[32m' STY_YELLOW='\e[00m\e[33m' @@ -21,5 +22,10 @@ STY_BG_BLUE='\e[30m\e[44m' STY_BG_PURPLE='\e[30m\e[45m' STY_BG_CYAN='\e[30m\e[46m' +STY_BOLD='\e[1m' +STY_FAINT='\e[2m' +STY_SLANT='\e[3m' STY_UNDERLINE='\e[4m' +STY_BLINK='\e[5m' +STY_INVERT='\e[7m' STY_RESET='\e[00m' diff --git a/scriptdata/functions.sh b/scriptdata/functions.sh index 19410b5eb..531df3ef3 100644 --- a/scriptdata/functions.sh +++ b/scriptdata/functions.sh @@ -63,6 +63,9 @@ function showfun(){ type -a $1 printf "${STY_RESET}" } +function pause(){ + if [ ! "$ask" == "false" ];then printf "${STY_FAINT}${STY_SLANT}";read -p "(Ctrl-C to abort, others to proceed)" p;printf "${STY_RESET}";fi +} function remove_bashcomments_emptylines(){ mkdir -p $(dirname $2) cat $1 | sed -e '/^[[:blank:]]*#/d;s/#.*//' -e '/^[[:space:]]*$/d' > $2 diff --git a/scriptdata/install-deps.sh b/scriptdata/install-deps.sh index a100d7885..5861ad199 100644 --- a/scriptdata/install-deps.sh +++ b/scriptdata/install-deps.sh @@ -41,6 +41,7 @@ if [[ "$INSTALL_VIA_NIX" == "true" ]]; then printf "Proceed only at your own risk.\n" printf "\n" printf "${STY_RESET}" + pause source ./scriptdata/install-deps-nix.sh elif [[ "$OS_DISTRO_ID" =~ ^(arch|endeavouros)$ ]]; then @@ -51,6 +52,7 @@ elif [[ "$OS_DISTRO_ID" =~ ^(arch|endeavouros)$ ]]; then printf "./scriptdata/install-deps-arch.sh will be used.\n" printf "\n" printf "${STY_RESET}" + pause source ./scriptdata/install-deps-arch.sh elif [[ -f "./scriptdata/install-deps-${OS_DISTRO_ID}.sh" ]]; then @@ -67,6 +69,7 @@ elif [[ -f "./scriptdata/install-deps-${OS_DISTRO_ID}.sh" ]]; then printf "Proceed only at your own risk.\n" printf "\n" printf "${STY_RESET}" + pause source ./scriptdata/install-deps-${OS_DISTRO_ID}.sh elif [[ "$OS_DISTRO_ID_LIKE" == "arch" ]]; then @@ -81,12 +84,13 @@ elif [[ "$OS_DISTRO_ID_LIKE" == "arch" ]]; then printf "Proceed only at your own risk.\n" printf "\n" printf "${STY_RESET}" + pause source ./scriptdata/install-deps-arch.sh else printf "${STY_RED}" - printf "===URGENT===\n" + printf "${STY_BOLD}===URGENT===${STY_RED}\n" printf "Detected distro ID: ${OS_DISTRO_ID}\n" printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" printf "./scriptdata/install-deps-${OS_DISTRO_ID}.sh not found.\n" @@ -94,13 +98,7 @@ else printf "It may disrupt your system and will likely fail without your manual intervention.\n" printf "Proceed only at your own risk.\n" printf "${STY_RESET}" - printf "${STY_BG_RED}" - printf "To tell you the truth, it is completely not worky at this time. The prompt here is only for testing and WIP. PLEASE JUST QUIT IMMEDIATELY.${STY_RESET}\n" - read -p "Still continue? [y/N] ====> " p - case $p in - [yY]) sleep 0 ;; - *) exit 1 ;; - esac + pause source ./scriptdata/install-deps-fallback.sh fi diff --git a/scriptdata/install-files.sh b/scriptdata/install-files.sh index 7d39f2b4d..8a4ca9ba7 100644 --- a/scriptdata/install-files.sh +++ b/scriptdata/install-files.sh @@ -135,6 +135,7 @@ for i in ${warn_files_tests[@]}; do done ##################################################################################### +# TODO: output the logs below to a temp file and cat that file, also show the path of the file so users will be able to read it again. printf "\n" printf "\n" printf "\n" diff --git a/scriptdata/install-greeting.sh b/scriptdata/install-greeting.sh index 8fe80fda8..85a1633bb 100644 --- a/scriptdata/install-greeting.sh +++ b/scriptdata/install-greeting.sh @@ -3,27 +3,38 @@ ##################################################################################### -printf "${STY_BLUE}[$0]: Hi there! Before we start:\n" -printf '\n' -printf '[NEW] illogical-impulse is now powered by Quickshell. If you were using the old version with AGS and would like to keep it, do not run this script.\n' -printf ' The AGS version, although uses less memory, has much worse performance (it uses Gtk3). \n' -printf ' If you aren'\''t running on ewaste, the Quickshell version is recommended. \n' -printf ' If you would like the AGS version anyway, run the script in its branch instead: git checkout ii-ags && ./install.sh\n' -printf '\n' -printf 'This script does not handle system-level/hardware stuff like Nvidia drivers.\n' +printf "${STY_CYAN}[$0]: Hi there! Before we start:${STY_RESET}\n" printf "\n" +printf "${STY_PURPLE}${STY_BOLD}[NEW] illogical-impulse is now powered by Quickshell.${STY_PURPLE}\n" +printf '# If you were using the old version with AGS and would like to keep it, do not run this script.\n' +printf '# The AGS version, although uses less memory, has much worse performance (it uses Gtk3). \n' +printf '# If you aren'\''t running on ewaste, the Quickshell version is recommended. \n' +printf "# If you would like the AGS version anyway, run the script in its branch instead:\n ${STY_INVERT} git checkout ii-ags && ./install.sh ${STY_RESET}\n" +printf "\n" +pause +printf "${STY_CYAN}${STY_BOLD}Quick overview about what this script does:${STY_CYAN}\n" +printf " 1. Install dependencies.\n" +printf " 2. Setup permissions/services etc.\n" +printf " 3. Copying config files.${STY_RESET}\n" +pause +printf "${STY_CYAN}${STY_BOLD}Tips:${STY_CYAN}\n" +printf " a) It has been designed to be idempotent which means you can run it multiple times.\n" +printf " b) Use ${STY_INVERT} --help ${STY_CYAN} for more options.${STY_RESET}\n" +printf "${STY_YELLOW}${STY_BOLD}Note: ${STY_YELLOW}" +printf "It does not handle system-level/hardware stuff like Nvidia drivers.\n" printf "${STY_RESET}" +printf "\n" +pause case $ask in false) sleep 0 ;; *) - printf "${STY_RED}" - printf '\n' - printf 'Do you want to confirm every time before a command executes?\n' - printf ' y = Yes, ask me before executing each of them. (DEFAULT)\n' - printf ' n = No, I know everything this script will do, just execute them automatically.\n' - printf ' a = Abort.\n' - read -p "====> " p + printf "${STY_BLUE}" + printf "${STY_BOLD}Do you want to confirm every time before a command executes?${STY_BLUE}\n" + printf " y = Yes, ask me before executing each of them. (DEFAULT)\n" + printf " n = No, I know everything this script will do, just execute them automatically.\n" + printf " a = Abort.\n" + read -p "===> [Y/n/a]: " p case $p in n) ask=false ;; a) exit 1 ;; diff --git a/scriptdata/install-setups-arch.sh b/scriptdata/install-setups-arch.sh new file mode 100644 index 000000000..923ac2bc5 --- /dev/null +++ b/scriptdata/install-setups-arch.sh @@ -0,0 +1,15 @@ +# This script is meant to be sourced. +# It's not for directly running. + +##################################################################################### +# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies. +showfun install-python-packages +v install-python-packages + +v sudo usermod -aG video,i2c,input "$(whoami)" +v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf" +v systemctl --user enable ydotool --now +v sudo systemctl enable bluetooth --now +v gsettings set org.gnome.desktop.interface font-name 'Rubik 11' +v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' +v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly diff --git a/scriptdata/install-setups-fallback.sh b/scriptdata/install-setups-fallback.sh new file mode 100644 index 000000000..923ac2bc5 --- /dev/null +++ b/scriptdata/install-setups-fallback.sh @@ -0,0 +1,15 @@ +# This script is meant to be sourced. +# It's not for directly running. + +##################################################################################### +# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies. +showfun install-python-packages +v install-python-packages + +v sudo usermod -aG video,i2c,input "$(whoami)" +v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf" +v systemctl --user enable ydotool --now +v sudo systemctl enable bluetooth --now +v gsettings set org.gnome.desktop.interface font-name 'Rubik 11' +v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' +v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly diff --git a/scriptdata/install-setups-nix.sh b/scriptdata/install-setups-nix.sh new file mode 100644 index 000000000..923ac2bc5 --- /dev/null +++ b/scriptdata/install-setups-nix.sh @@ -0,0 +1,15 @@ +# This script is meant to be sourced. +# It's not for directly running. + +##################################################################################### +# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies. +showfun install-python-packages +v install-python-packages + +v sudo usermod -aG video,i2c,input "$(whoami)" +v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf" +v systemctl --user enable ydotool --now +v sudo systemctl enable bluetooth --now +v gsettings set org.gnome.desktop.interface font-name 'Rubik 11' +v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' +v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly diff --git a/scriptdata/install-setups.sh b/scriptdata/install-setups.sh index 923ac2bc5..ebd3d97e3 100644 --- a/scriptdata/install-setups.sh +++ b/scriptdata/install-setups.sh @@ -1,15 +1,87 @@ # This script is meant to be sourced. # It's not for directly running. -##################################################################################### -# These python packages are installed using uv into the venv (virtual environment). Once the folder of the venv gets deleted, they are all gone cleanly. So it's considered as setups, not dependencies. -showfun install-python-packages -v install-python-packages +#################### +# Detect distro +# Helpful link(s): +# http://stackoverflow.com/questions/29581754 +# https://github.com/which-distro/os-release +export OS_RELEASE_FILE=${OS_RELEASE_FILE:-/etc/os-release} +test -f ${OS_RELEASE_FILE} || \ + ( echo "${OS_RELEASE_FILE} does not exist. Aborting..." ; exit 1 ; ) +export OS_DISTRO_ID=$(awk -F'=' '/^ID=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) +export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolower($2) }' ${OS_RELEASE_FILE} 2> /dev/null) -v sudo usermod -aG video,i2c,input "$(whoami)" -v bash -c "echo i2c-dev | sudo tee /etc/modules-load.d/i2c-dev.conf" -v systemctl --user enable ydotool --now -v sudo systemctl enable bluetooth --now -v gsettings set org.gnome.desktop.interface font-name 'Rubik 11' -v gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' -v kwriteconfig6 --file kdeglobals --group KDE --key widgetStyle Darkly + + +if [[ "$INSTALL_VIA_NIX" == "true" ]]; then + + printf "${STY_YELLOW}" + printf "===WARNING===\n" + printf "Nix will be used to do setups.\n" + printf "The process is still WIP.\n" + printf "Proceed only at your own risk.\n" + printf "\n" + printf "${STY_RESET}" + pause + source ./scriptdata/install-setups-nix.sh + +elif [[ "$OS_DISTRO_ID" == "arch" ]]; then + + printf "${STY_GREEN}" + printf "===INFO===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "./scriptdata/install-setups-arch.sh will be used.\n" + printf "\n" + printf "${STY_RESET}" + pause + source ./scriptdata/install-setups-arch.sh + +elif [[ -f "./scriptdata/install-setups-${OS_DISTRO_ID}.sh" ]]; then + + printf "${STY_PURPLE}" + printf "===NOTICE===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "./scriptdata/install-setups-${OS_DISTRO_ID}.sh detected and will be used.\n" + printf "This file is provided by the community.\n" + printf "It is not officially supported by github:end-4/dots-hyprland .\n" + printf "${STY_BG_PURPLE}" + printf "If you find out any problems about it, PR is welcomed if you are able to address it. Or, create a discussion about it, but please do not submit issue, because the developers do not use this distro, therefore they cannot help.${STY_RESET}\n" + printf "${STY_PURPLE}" + printf "Proceed only at your own risk.\n" + printf "\n" + printf "${STY_RESET}" + pause + source ./scriptdata/install-setups-${OS_DISTRO_ID}.sh + +elif [[ "$OS_DISTRO_ID_LIKE" == "arch" ]]; then + + printf "${STY_YELLOW}" + printf "===WARNING===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" + printf "./scriptdata/install-setups-arch.sh will be used.\n" + printf "Ideally, it should also work for your distro.\n" + printf "Still, there is a chance that it not works as expected or even fails.\n" + printf "Proceed only at your own risk.\n" + printf "\n" + printf "${STY_RESET}" + pause + source ./scriptdata/install-setups-arch.sh + +else + + printf "${STY_RED}" + printf "===WARNING===\n" + printf "Detected distro ID: ${OS_DISTRO_ID}\n" + printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" + printf "./scriptdata/install-setups-${OS_DISTRO_ID}.sh not found.\n" + printf "./scriptdata/install-setups-fallback.sh will be used.\n" + printf "It might fail or disrupt your system.\n" + printf "Proceed only at your own risk.\n" + printf "\n" + printf "${STY_RESET}" + pause + source ./scriptdata/install-setups-fallback.sh + +fi From 6757dc2ca159e573f2f1e18f5164a68f1243dbb8 Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 07:20:25 +0800 Subject: [PATCH 15/18] Fix $2101 --- scriptdata/install-deps-arch.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/scriptdata/install-deps-arch.sh b/scriptdata/install-deps-arch.sh index ed906efef..7e02f05a4 100644 --- a/scriptdata/install-deps-arch.sh +++ b/scriptdata/install-deps-arch.sh @@ -41,9 +41,6 @@ case $SKIP_SYSUPDATE in *) v sudo pacman -Syu;; esac -remove_bashcomments_emptylines ${DEPLISTFILE} ./cache/dependencies_stripped.conf -readarray -t pkglist < ./cache/dependencies_stripped.conf - # Use yay. Because paru does not support cleanbuild. # Also see https://wiki.hyprland.org/FAQ/#how-do-i-update if ! command -v yay >/dev/null 2>&1;then @@ -52,17 +49,6 @@ if ! command -v yay >/dev/null 2>&1;then v install-yay fi -# Install extra packages from dependencies.conf as declared by the user -if (( ${#pkglist[@]} != 0 )); then - if $ask; then - # execute per element of the array $pkglist - for i in "${pkglist[@]}";do v yay -S --needed $i;done - else - # execute for all elements of the array $pkglist in one line - v yay -S --needed --noconfirm ${pkglist[*]} - fi -fi - showfun handle-deprecated-dependencies v handle-deprecated-dependencies From 93634985e81fb3efdc3c4abb1f2a85f719b893e6 Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 07:24:02 +0800 Subject: [PATCH 16/18] Fix $2100 --- scriptdata/install-deps.sh | 2 +- scriptdata/install-setups.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scriptdata/install-deps.sh b/scriptdata/install-deps.sh index 5861ad199..258c75270 100644 --- a/scriptdata/install-deps.sh +++ b/scriptdata/install-deps.sh @@ -72,7 +72,7 @@ elif [[ -f "./scriptdata/install-deps-${OS_DISTRO_ID}.sh" ]]; then pause source ./scriptdata/install-deps-${OS_DISTRO_ID}.sh -elif [[ "$OS_DISTRO_ID_LIKE" == "arch" ]]; then +elif [[ "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then printf "${STY_YELLOW}" printf "===WARNING===\n" diff --git a/scriptdata/install-setups.sh b/scriptdata/install-setups.sh index ebd3d97e3..4c513399b 100644 --- a/scriptdata/install-setups.sh +++ b/scriptdata/install-setups.sh @@ -54,7 +54,7 @@ elif [[ -f "./scriptdata/install-setups-${OS_DISTRO_ID}.sh" ]]; then pause source ./scriptdata/install-setups-${OS_DISTRO_ID}.sh -elif [[ "$OS_DISTRO_ID_LIKE" == "arch" ]]; then +elif [[ "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then printf "${STY_YELLOW}" printf "===WARNING===\n" From 194b21c41e8d396aa0409d76b03ef04223eff365 Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 07:26:59 +0800 Subject: [PATCH 17/18] Improve message. --- install.sh | 4 ++-- scriptdata/options.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 4acf78f7e..32f924cd2 100755 --- a/install.sh +++ b/install.sh @@ -19,11 +19,11 @@ if [[ "${SKIP_ALLDEPS}" != true ]]; then fi ##################################################################################### if [[ "${SKIP_ALLSETUPS}" != true ]]; then - printf "${STY_CYAN}[$0]: 2. Setup for user groups/services etc\n${STY_RESET}" + printf "${STY_CYAN}[$0]: 2. Setup for permissions/services etc\n${STY_RESET}" source ./scriptdata/install-setups.sh fi ##################################################################################### if [[ "${SKIP_ALLFILES}" != true ]]; then - printf "${STY_CYAN}[$0]: 3. Copying + Configuring\n${STY_RESET}" + printf "${STY_CYAN}[$0]: 3. Copying config files\n${STY_RESET}" source ./scriptdata/install-files.sh fi diff --git a/scriptdata/options.sh b/scriptdata/options.sh index 715b542c6..36c5a804c 100644 --- a/scriptdata/options.sh +++ b/scriptdata/options.sh @@ -13,7 +13,7 @@ If no option is specified, run default install process. -f, --force (Dangerous) Force mode without any confirm -c, --clean Clean the build cache first --skip-alldeps Skip the whole process installing dependency - --skip-allsetups Skip the whole process setting up user groups/services etc + --skip-allsetups Skip the whole process setting up permissions/services etc --skip-allfiles Skip the whole process copying configuration files -s, --skip-sysupdate Skip system package upgrade e.g. \"sudo pacman -Syu\" --skip-hyprland Skip installing the config for Hyprland From 0ee141493f5265471fdee3aafb2b8202bd0b6c86 Mon Sep 17 00:00:00 2001 From: clsty Date: Thu, 2 Oct 2025 07:39:15 +0800 Subject: [PATCH 18/18] Improve message. --- scriptdata/install-deps.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scriptdata/install-deps.sh b/scriptdata/install-deps.sh index 258c75270..379e524fb 100644 --- a/scriptdata/install-deps.sh +++ b/scriptdata/install-deps.sh @@ -95,7 +95,8 @@ else printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n" printf "./scriptdata/install-deps-${OS_DISTRO_ID}.sh not found.\n" printf "./scriptdata/install-deps-fallback.sh will be used.\n" - printf "It may disrupt your system and will likely fail without your manual intervention.\n" + printf "1. It may disrupt your system and will likely fail without your manual intervention.\n" + printf "2. It's WIP and only contains small number of dependencies far from enough.\n" printf "Proceed only at your own risk.\n" printf "${STY_RESET}" pause