From b6f81adc5d6d2f172bd0977cef0e59e598f0402c Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Fri, 3 May 2024 09:20:03 +0200 Subject: [PATCH] Updates --- .install/diagnosis.sh | 28 +++++++++++++++++++++++ .install/includes/library.sh | 22 ++++++++++++++++++ .install/packages/general-packages.sh | 1 - install.sh | 1 + scripts/diagnosis.sh | 33 +++++++++++++-------------- 5 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 .install/diagnosis.sh diff --git a/.install/diagnosis.sh b/.install/diagnosis.sh new file mode 100644 index 0000000..ff2791c --- /dev/null +++ b/.install/diagnosis.sh @@ -0,0 +1,28 @@ +echo -e "${GREEN}" +figlet "System check" +echo -e "${NONE}" + +echo "The system check will test that essential packages and " +echo "execution commands are available now on your system." + +if gum confirm "Do you want to run a short system check?" ;then + + _folderExists "$HOME/dotfiles" "Please repeat the installation." + _commandExists "rofi" "rofi-wayland" + _commandExists "dunst" "dunst" + _commandExists "waybar" "waybar" + _commandExists "hyprpaper" "hyprpaper" + _commandExists "hyprlock" "hyprpaper" + _commandExists "hypridle" "hyprpaper" + _commandExists "wal" "python-pywal" + _commandExists "gum" "gum" + _commandExists "wlogout" "wlogout" + _commandExists "eww" "eww" + _commandExists "magick" "imagemagick" + +elif [ $? -eq 130 ]; then + exit 130 +else + echo ":: System check skipped" +fi +echo "" \ No newline at end of file diff --git a/.install/includes/library.sh b/.install/includes/library.sh index 2d0e938..660807a 100755 --- a/.install/includes/library.sh +++ b/.install/includes/library.sh @@ -272,4 +272,26 @@ _replaceLineInFile() { echo "ERROR: Target file not found." sleep 2 fi +} + +# ------------------------------------------------------ +# System check +# ------------------------------------------------------ + +_commandExists() { + package="$1"; + if ! type $package > /dev/null 2>&1; then + echo ":: ERROR: $package doesn't exists. Please install it with yay -S $2" + else + echo ":: OK: $package command found." + fi +} + +_folderExists() { + folder="$1"; + if [ ! -d $folder ]; then + echo ":: ERROR: $folder doesn't exists. $2" + else + echo ":: OK: $folder found." + fi } \ No newline at end of file diff --git a/.install/packages/general-packages.sh b/.install/packages/general-packages.sh index 285b2d9..de23501 100644 --- a/.install/packages/general-packages.sh +++ b/.install/packages/general-packages.sh @@ -11,7 +11,6 @@ packagesPacman=( "dunst" "starship" "mpv" - "freerdp" "thunar" "mousepad" "noto-fonts" diff --git a/install.sh b/install.sh index d1666fa..6ab23e3 100755 --- a/install.sh +++ b/install.sh @@ -80,5 +80,6 @@ source .install/apps.sh source .install/gtk.sh source .install/bashrc.sh source .install/cleanup.sh +source .install/diagnosis.sh source .install/reboot.sh sleep 3 diff --git a/scripts/diagnosis.sh b/scripts/diagnosis.sh index 3407a9c..d9b33c8 100755 --- a/scripts/diagnosis.sh +++ b/scripts/diagnosis.sh @@ -9,8 +9,8 @@ echo _commandExists() { package="$1"; - if ! type $package > /dev/null; then - echo ":: ERROR: $package doesn't exists. Please install it." + if ! type $package > /dev/null 2>&1; then + echo ":: ERROR: $package doesn't exists. Please install it with yay -S $2" else echo ":: OK: $package found." fi @@ -25,21 +25,20 @@ _folderExists() { fi } -_commandExists "rofi" -_commandExists "dunst" -_commandExists "waybar" -_commandExists "hyprpaper" -_commandExists "hyprlock" -_commandExists "hypridle" -_commandExists "wal" -_commandExists "gum" -_commandExists "wlogout" -_commandExists "wal" -_commandExists "swww" -_commandExists "eww" -_commandExists "magick" -_commandExists "figlet" +_commandExists "rofi" "rofi-wayland" +_commandExists "dunst" "dunst" +_commandExists "waybar" "waybar" +_commandExists "hyprpaper" "hyprpaper" +_commandExists "hyprlock" "hyprpaper" +_commandExists "hypridle" "hyprpaper" +_commandExists "wal" "python-pywal" +_commandExists "gum" "gum" +_commandExists "wlogout" "wlogout" +_commandExists "swww" "swww" +_commandExists "eww" "eww" +_commandExists "magick2" "imagemagick" +_commandExists "figlet2" "figlet" echo -echo "Press return to close the window" +echo "Press return to exit" read \ No newline at end of file