From 153721005b6d18629b3b9cc795f279f7cea9c572 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 9 Jun 2025 08:31:10 +0900 Subject: [PATCH] updated for new SDDM theme --- CHANGELOGS.md | 3 ++ README.md | 2 +- install-scripts/sddm_theme.sh | 63 ++++++++++++++++------------------- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 95cedc5..fbd8139 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,5 +1,8 @@ ## CHANGELOGS +## 08 June 2025 +- updated SDDM theme. + ## 20 March 2025 - added findutils as dependencies diff --git a/README.md b/README.md index 5009867..172d3d1 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ sudo apt install --no-install-recommends -y sddm - [LINK](https://www.simplified.guide/ubuntu/switch-to-gdm) for some guide #### 💫 SDDM and GTK Themes offered -- If you opted to install SDDM theme, here's the [`LINK`](https://codeberg.org/JaKooLit/sddm-sequoia) which is a fork of [`LINK`](https://codeberg.org/minMelody/sddm-sequoia) +- If you opted to install SDDM theme, here's the [`LINK`](https://github.com/JaKooLit/simple-sddm-2) which is a modified fork of [`LINK`](https://github.com/Keyitdev/sddm-astronaut-theme) - If you opted to install GTK Themes, Icons, here's the [`LINK`](https://github.com/JaKooLit/GTK-themes-icons). This also includes Bibata Modern Ice cursor. #### 🔔 NOTICE TO NVIDIA OWNERS ### diff --git a/install-scripts/sddm_theme.sh b/install-scripts/sddm_theme.sh index 23c41b5..4f85513 100755 --- a/install-scripts/sddm_theme.sh +++ b/install-scripts/sddm_theme.sh @@ -2,8 +2,8 @@ # 💫 https://github.com/JaKooLit 💫 # # SDDM themes # -source_theme="https://codeberg.org/JaKooLit/sddm-sequoia" -theme_name="sequoia_2" +source_theme="https://github.com/JaKooLit/simple-sddm-2.git" +theme_name="simple_sddm_2" ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -18,6 +18,7 @@ if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then exit 1 fi + # Set the name of the log file to include the current date and time LOG="Install-Logs/install-$(date +%d-%H%M%S)_sddm_theme.log" @@ -51,51 +52,43 @@ if git clone --depth=1 "$source_theme" "$theme_name"; then # Move cloned theme to the themes directory sudo mv "$theme_name" "/usr/share/sddm/themes/$theme_name" 2>&1 | tee -a "$LOG" + # setting up SDDM theme - sddm_conf_dir="/etc/sddm.conf.d" + sddm_conf="/etc/sddm.conf" BACKUP_SUFFIX=".bak" - + echo -e "${NOTE} Setting up the login screen." | tee -a "$LOG" - if [ -d "$sddm_conf_dir" ]; then - echo "Backing up files in $sddm_conf_dir" | tee -a "$LOG" - for file in "$sddm_conf_dir"/*; do - if [ -f "$file" ]; then - if [[ "$file" == *$BACKUP_SUFFIX ]]; then - echo "Skipping backup file: $file" | tee -a "$LOG" - continue - fi - # Backup each original file - sudo cp "$file" "$file$BACKUP_SUFFIX" 2>&1 | tee -a "$LOG" - echo "Backup created for $file" | tee -a "$LOG" - - # Edit existing "Current=" - if grep -q '^[[:space:]]*Current=' "$file"; then - sudo sed -i "s/^[[:space:]]*Current=.*/Current=$theme_name/" "$file" 2>&1 | tee -a "$LOG" - echo "Updated theme in $file" | tee -a "$LOG" - fi - fi - done + # Backup the sddm.conf file if it exists + if [ -f "$sddm_conf" ]; then + echo "Backing up $sddm_conf" | tee -a "$LOG" + sudo cp "$sddm_conf" "$sddm_conf$BACKUP_SUFFIX" 2>&1 | tee -a "$LOG" else - echo "$CAT - $sddm_conf_dir not found, creating..." | tee -a "$LOG" - sudo mkdir -p "$sddm_conf_dir" 2>&1 | tee -a "$LOG" + echo "$sddm_conf does not exist, creating a new one." | tee -a "$LOG" + sudo touch "$sddm_conf" 2>&1 | tee -a "$LOG" fi - if [ ! -f "$sddm_conf_dir/theme.conf.user" ]; then - echo -e "[Theme]\nCurrent = $theme_name" | sudo tee "$sddm_conf_dir/theme.conf.user" > /dev/null + # Check if the [Theme] section exists + if grep -q '^\[Theme\]' "$sddm_conf"; then + # Update the Current= line under [Theme] + sudo sed -i "/^\[Theme\]/,/^\[/{s/^\s*Current=.*/Current=$theme_name/}" "$sddm_conf" 2>&1 | tee -a "$LOG" - if [ -f "$sddm_conf_dir/theme.conf.user" ]; then - echo "Created and configured $sddm_conf_dir/theme.conf.user with theme $theme_name" | tee -a "$LOG" + # If no Current= line was found and replaced, append it after the [Theme] section + if ! grep -q '^\s*Current=' "$sddm_conf"; then + sudo sed -i "/^\[Theme\]/a Current=$theme_name" "$sddm_conf" 2>&1 | tee -a "$LOG" + echo "Appended Current=$theme_name under [Theme] in $sddm_conf" | tee -a "$LOG" else - echo "Failed to create $sddm_conf_dir/theme.conf.user" | tee -a "$LOG" + echo "Updated Current=$theme_name in $sddm_conf" | tee -a "$LOG" fi else - echo "$sddm_conf_dir/theme.conf.user already exists, skipping creation." | tee -a "$LOG" + # Append the [Theme] section at the end if it doesn't exist + echo -e "\n[Theme]\nCurrent=$theme_name" | sudo tee -a "$sddm_conf" > /dev/null + echo "Added [Theme] section with Current=$theme_name in $sddm_conf" | tee -a "$LOG" fi # Replace current background from assets - sudo cp -r assets/sddm.png "/usr/share/sddm/themes/$theme_name/backgrounds/default" 2>&1 | tee -a "$LOG" - sudo sed -i 's|^wallpaper=".*"|wallpaper="backgrounds/default"|' "/usr/share/sddm/themes/$theme_name/theme.conf" 2>&1 | tee -a "$LOG" + sudo cp -r assets/sddm.png "/usr/share/sddm/themes/$theme_name/Backgrounds/default" 2>&1 | tee -a "$LOG" + sudo sed -i 's|^wallpaper=".*"|wallpaper="Backgrounds/default"|' "/usr/share/sddm/themes/$theme_name/theme.conf" 2>&1 | tee -a "$LOG" printf "\n%.0s" {1..1} printf "${NOTE} copying ${YELLOW}JetBrains Mono Nerd Font${RESET} to ${YELLOW}/usr/local/share/fonts${RESET} .......\n" @@ -110,7 +103,8 @@ if git clone --depth=1 "$source_theme" "$theme_name"; then echo "Failed to copy fonts." fi - fc-cache -fv 2>&1 | tee -a "$LOG" + # Update font cache and log the output + fc-cache -v -f 2>&1 | tee -a "$LOG" printf "\n%.0s" {1..1} @@ -121,5 +115,4 @@ else echo "${ERROR} - Failed to clone the sddm theme repository. Please check your internet connection." | tee -a "$LOG" >&2 fi - printf "\n%.0s" {1..2} \ No newline at end of file