aboutsummaryrefslogtreecommitdiffstats
path: root/copy.sh
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2025-02-03 19:57:00 +0900
committerJaKooLit <ejhay.games@gmail.com>2025-02-03 19:57:00 +0900
commit6344db6cc19571df4d356784a05a4f2dea55c5e7 (patch)
tree0d620ac65912f38e999604d6b242c762aff53e6c /copy.sh
parent90fe32a08a1c6a9234916d5fab15c82851b0f0a2 (diff)
updated copy.sh
Diffstat (limited to 'copy.sh')
-rwxr-xr-xcopy.sh36
1 files changed, 18 insertions, 18 deletions
diff --git a/copy.sh b/copy.sh
index 458cfd79..540f3425 100755
--- a/copy.sh
+++ b/copy.sh
@@ -327,13 +327,19 @@ while true; do
echo "${OK} 12H format set on waybar clocks succesfully." 2>&1 | tee -a "$LOG"
- # Function to apply 12H format to SDDM themes
+ # Function to apply 12H format to SDDM themes
apply_sddm_12h_format() {
- local sddm_directory=$1
- echo "Editing $sddm_directory to 12H format" 2>&1 | tee -a "$LOG"
+ local sddm_directory=$1
- sudo sed -i 's|^## HourFormat="hh:mm AP"|HourFormat="hh:mm AP"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$LOG" || true
- sudo sed -i 's|^HourFormat="HH:mm"|## HourFormat="HH:mm"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$LOG" || true
+ # Check if the directory exists
+ if [ -d "$sddm_directory" ]; then
+ echo "Editing $sddm_directory to 12H format" 2>&1 | tee -a "$LOG"
+
+ sudo sed -i 's|^## HourFormat="hh:mm AP"|HourFormat="hh:mm AP"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$LOG" || true
+ sudo sed -i 's|^HourFormat="HH:mm"|## HourFormat="HH:mm"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$LOG" || true
+ else
+ echo "${ERROR} Directory $sddm_directory does not exist. Skipping..." 2>&1 | tee -a "$LOG"
+ fi
}
# Applying to different SDDM themes
@@ -343,23 +349,17 @@ while true; do
# for SDDM (sequoia_2)
sddm_directory_3="/usr/share/sddm/themes/sequoia_2"
- if [ -d "$sddm_directory_3" ]; then
+ if [ -d "$sddm_directory_3" ]; then
echo "sddm sequoia_2 theme exists. Editing to 12H format" 2>&1 | tee -a "$LOG"
+
sudo sed -i 's|^clockFormat="HH:mm"|## clockFormat="HH:mm"|' "$sddm_directory_3/theme.conf" 2>&1 | tee -a "$LOG" || true
- if ! grep -q 'clockFormat="hh:mm AP"' "$sddm_directory_3/theme.conf"; then
- sudo sed -i '/^clockFormat=/a clockFormat="hh:mm AP"' "$sddm_directory_3/theme.conf" 2>&1 | tee -a "$LOG" || true
- fi
- echo "${OK} 12H format set to SDDM successfully." 2>&1 | tee -a "$LOG"
- fi
- break
- elif [[ "$answer" == "n" ]]; then
- echo "${NOTE} You chose not to change to 12H format." 2>&1 | tee -a "$LOG"
- break
- else
- echo "${ERROR} Invalid choice. Please enter y for yes or n for no."
+ if ! grep -q 'clockFormat="hh:mm AP"' "$sddm_directory_3/theme.conf"; then
+ sudo sed -i '/^clockFormat=/a clockFormat="hh:mm AP"' "$sddm_directory_3/theme.conf" 2>&1 | tee -a "$LOG" || true
+ fi
+
+ echo "${OK} 12H format set to SDDM successfully." 2>&1 | tee -a "$LOG"
fi
- done
printf "\n"
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage