From 16d0cab62c54f12e03143559cd963291553a20c9 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 13 Oct 2023 23:41:57 +0900 Subject: [PATCH] updated install_package module.Corrected nvidia.sh --- README.md | 2 ++ install-scripts/00-dependencies.sh | 4 +++- install-scripts/00-hypr-pkgs.sh | 4 +++- install-scripts/bluetooth.sh | 4 +++- install-scripts/gtk_themes.sh | 4 +++- install-scripts/nvidia.sh | 15 ++++++++++++++- install-scripts/nwg-look.sh | 4 +++- install-scripts/rog.sh | 2 +- install-scripts/sddm.sh | 4 ++-- install-scripts/thunar.sh | 4 +++- install-scripts/xdph.sh | 12 ++++++------ install-scripts/zsh.sh | 4 +++- 12 files changed, 46 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7f6610e..226964b 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,8 @@ sudo ninja -C build install - [X] ~~Use kitty in favor of foot~~ - Dropped the idea of kitty. Kitty is using twice memory compared to foot. ### ❗ some known issues +- Currently SDDM theme that I have set is broken... currently investigating + - reports from members of my discord, states that some users of nvidia are getting stuck on sddm login. credit to @Kenni Fix stated was ``` while in sddm press ctrl+alt+F2 or F3 diff --git a/install-scripts/00-dependencies.sh b/install-scripts/00-dependencies.sh index 5ad8f1b..c80de4a 100755 --- a/install-scripts/00-dependencies.sh +++ b/install-scripts/00-dependencies.sh @@ -121,7 +121,9 @@ install_package() { else # Package not installed echo -e "${NOTE} Installing $1 ..." - if sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG"; then + sudo apt-get install -y "$1" >> "$LOG" 2>&1 + # Check if the package was installed successfully + if dpkg -l | grep -q -w "$1"; then echo -e "\e[1A\e[K${OK} $1 was installed." else # Something is missing, exiting to review the log diff --git a/install-scripts/00-hypr-pkgs.sh b/install-scripts/00-hypr-pkgs.sh index 3577ba7..d7a7cf6 100755 --- a/install-scripts/00-hypr-pkgs.sh +++ b/install-scripts/00-hypr-pkgs.sh @@ -81,7 +81,9 @@ install_package() { else # Package not installed echo -e "${NOTE} Installing $1 ..." - if sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG"; then + sudo apt-get install -y "$1" >> "$LOG" 2>&1 + # Check if the package was installed successfully + if dpkg -l | grep -q -w "$1"; then echo -e "\e[1A\e[K${OK} $1 was installed." else # Something is missing, exiting to review the log diff --git a/install-scripts/bluetooth.sh b/install-scripts/bluetooth.sh index 1676045..585c6c6 100755 --- a/install-scripts/bluetooth.sh +++ b/install-scripts/bluetooth.sh @@ -38,7 +38,9 @@ install_package() { else # Package not installed echo -e "${NOTE} Installing $1 ..." - if sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG"; then + sudo apt-get install -y "$1" >> "$LOG" 2>&1 + # Check if the package was installed successfully + if dpkg -l | grep -q -w "$1"; then echo -e "\e[1A\e[K${OK} $1 was installed." else # Something is missing, exiting to review the log diff --git a/install-scripts/gtk_themes.sh b/install-scripts/gtk_themes.sh index 2308efa..8602edb 100755 --- a/install-scripts/gtk_themes.sh +++ b/install-scripts/gtk_themes.sh @@ -31,7 +31,9 @@ install_package() { else # Package not installed echo -e "${NOTE} Installing $1 ..." - if sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG"; then + sudo apt-get install -y "$1" >> "$LOG" 2>&1 + # Check if the package was installed successfully + if dpkg -l | grep -q -w "$1"; then echo -e "\e[1A\e[K${OK} $1 was installed." else # Something is missing, exiting to review the log diff --git a/install-scripts/nvidia.sh b/install-scripts/nvidia.sh index 9eed1eb..e01cb61 100755 --- a/install-scripts/nvidia.sh +++ b/install-scripts/nvidia.sh @@ -32,6 +32,17 @@ LOG="install-$(date +%d-%H%M%S)_nvidia.log" set -e +## adding the deb source for nvidia driver +# Create a backup of the sources.list file +sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup 2>&1 | tee -a "$LOG" + +# Add the comment and repository entry to sources.list +echo "## for nvidia" | sudo tee -a /etc/apt/sources.list 2>&1 | tee -a "$LOG" +echo "deb http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware" | sudo tee -a /etc/apt/sources.list 2>&1 | tee -a "$LOG" + +# Update the package list +sudo apt update + # Function for installing packages on Debian/Ubuntu install_package() { # Checking if package is already installed @@ -40,7 +51,9 @@ install_package() { else # Package not installed echo -e "${NOTE} Installing $1 ..." - if sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG"; then + sudo apt-get install -y "$1" >> "$LOG" 2>&1 + # Check if the package was installed successfully + if dpkg -l | grep -q -w "$1"; then echo -e "\e[1A\e[K${OK} $1 was installed." else # Something is missing, exiting to review the log diff --git a/install-scripts/nwg-look.sh b/install-scripts/nwg-look.sh index ec523e7..a274ed6 100755 --- a/install-scripts/nwg-look.sh +++ b/install-scripts/nwg-look.sh @@ -37,7 +37,9 @@ install_package() { else # Package not installed echo -e "${NOTE} Installing $1 ..." - if sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG"; then + sudo apt-get install -y "$1" >> "$LOG" 2>&1 + # Check if the package was installed successfully + if dpkg -l | grep -q -w "$1"; then echo -e "\e[1A\e[K${OK} $1 was installed." else # Something is missing, exiting to review the log diff --git a/install-scripts/rog.sh b/install-scripts/rog.sh index ef144da..de3c8fa 100755 --- a/install-scripts/rog.sh +++ b/install-scripts/rog.sh @@ -39,7 +39,7 @@ install_and_log() { printf "${OK} $project_name installed successfully.\n" if [ "$project_name" == "supergfxctl" ]; then # Enable supergfxctl - sudo systemctl enable supergfxd.service --now + sudo systemctl enable --now supergfxd 2>&1 | tee -a "$LOG" fi else echo -e "${ERROR} Installation failed for $project_name." diff --git a/install-scripts/sddm.sh b/install-scripts/sddm.sh index 4bc2e73..813b47c 100755 --- a/install-scripts/sddm.sh +++ b/install-scripts/sddm.sh @@ -32,7 +32,7 @@ set -e # Install SDDM and Tokyo-Night theme for PKG1 in "${login[@]}" ; do - sudo apt install --no-install-recommends -y "$PKG1" 2>&1 | tee -a "$LOG" + sudo apt-get install --no-install-recommends -y "$PKG1" 2>&1 | tee -a "$LOG" if [ $? -ne 0 ]; then echo -e "\e[1A\e[K${ERROR} - $PKG1 install had failed, please check the install.log" exit 1 @@ -41,7 +41,7 @@ done # Check if other login managers are installed and disabling their service before enabling sddm for login_manager in lightdm gdm lxdm lxdm-gtk3; do - if sudo apt list installed "$login_manager" &>> /dev/null; then + if sudo apt-get list installed "$login_manager" &>> /dev/null; then echo "Disabling $login_manager..." sudo systemctl disable "$login_manager" 2>&1 | tee -a "$LOG" fi diff --git a/install-scripts/thunar.sh b/install-scripts/thunar.sh index 39bfcdb..5ef7ac4 100755 --- a/install-scripts/thunar.sh +++ b/install-scripts/thunar.sh @@ -39,7 +39,9 @@ install_package() { else # Package not installed echo -e "${NOTE} Installing $1 ..." - if sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG"; then + sudo apt-get install -y "$1" >> "$LOG" 2>&1 + # Check if the package was installed successfully + if dpkg -l | grep -q -w "$1"; then echo -e "\e[1A\e[K${OK} $1 was installed." else # Something is missing, exiting to review the log diff --git a/install-scripts/xdph.sh b/install-scripts/xdph.sh index 3d145c6..c0df5ec 100755 --- a/install-scripts/xdph.sh +++ b/install-scripts/xdph.sh @@ -48,17 +48,17 @@ printf "\n" # Clean out other portals printf "${NOTE} Clearing any other xdg-desktop-portal implementations...\n" # Check if packages are installed and uninstall if present - if sudo apt list installed xdg-desktop-portal-gnome &>> /dev/null; then + if sudo apt-get list installed xdg-desktop-portal-gnome &>> /dev/null; then echo "Removing xdg-desktop-portal-gnome..." - sudo apt remove -y xdg-desktop-portal-gnome 2>&1 | tee -a "$LOG" + sudo apt-get remove -y xdg-desktop-portal-gnome 2>&1 | tee -a "$LOG" fi - if sudo apt list installed xdg-desktop-portal-wlr &>> /dev/null; then + if sudo apt-get list installed xdg-desktop-portal-wlr &>> /dev/null; then echo "Removing xdg-desktop-portal-wlr..." - sudo apt remove -y xdg-desktop-portal-wlr 2>&1 | tee -a "$LOG" + sudo apt-get remove -y xdg-desktop-portal-wlr 2>&1 | tee -a "$LOG" fi - if sudo apt list installed xdg-desktop-portal-lxqt &>> /dev/null; then + if sudo apt-get list installed xdg-desktop-portal-lxqt &>> /dev/null; then echo "Removing xdg-desktop-portal-lxqt..." - sudo apt remove -y xdg-desktop-portal-lxqt 2>&1 | tee -a "$LOG" + sudo apt-get remove -y xdg-desktop-portal-lxqt 2>&1 | tee -a "$LOG" fi sed -i '17s/#//' config/hypr/configs/Execs.conf diff --git a/install-scripts/zsh.sh b/install-scripts/zsh.sh index e388b15..a80bd07 100755 --- a/install-scripts/zsh.sh +++ b/install-scripts/zsh.sh @@ -32,7 +32,9 @@ install_package() { else # Package not installed echo -e "${NOTE} Installing $1 ..." - if sudo apt-get install -y "$1" 2>&1 | tee -a "$LOG"; then + sudo apt-get install -y "$1" >> "$LOG" 2>&1 + # Check if the package was installed successfully + if dpkg -l | grep -q -w "$1"; then echo -e "\e[1A\e[K${OK} $1 was installed." else # Something is missing, exiting to review the log