aboutsummaryrefslogtreecommitdiffstats
path: root/copy.sh
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2024-04-28 13:46:17 +0900
committerGitHub <noreply@github.com>2024-04-28 13:46:17 +0900
commit8cda78812d9c70d83fff37d19c1d8362e07efb10 (patch)
treeac172f4025ebcd9ba719fdc499914f7f1860da18 /copy.sh
parent2851f4999eb5777d5422870f30e2b0e5f9890793 (diff)
parenta1826d356c750197ad62e511ac2cabb0efc738fd (diff)
Merge pull request #221 from JaKooLit/development
Development
Diffstat (limited to 'copy.sh')
-rwxr-xr-xcopy.sh30
1 files changed, 21 insertions, 9 deletions
diff --git a/copy.sh b/copy.sh
index d3df3874..75958a16 100755
--- a/copy.sh
+++ b/copy.sh
@@ -124,26 +124,38 @@ while true; do
# Check if the answer is valid
if [[ "$answer" == "y" ]]; then
# Modify waybar config if 12hr is selected
- sed -i 's/^ \/\/"format": " {:%I:%M %p}"/ "format": " {:%I:%M %p}"/' ./config/waybar/modules
- sed -i 's/^ "format": " {:%H:%M:%S}"/ \/\/"format": " {:%H:%M:%S}"/' ./config/waybar/modules
+ sed -i 's/^ \/\/"format": " {:%I:%M %p}"/ "format": " {:%I:%M %p}"/' ./config/waybar/modules 2>&1 | tee -a "$LOG" || true
+ sed -i 's/^ "format": " {:%H:%M:%S}"/ \/\/"format": " {:%H:%M:%S}"/' ./config/waybar/modules 2>&1 | tee -a "$LOG" || true
# for hyprlock
- sed -i 's|^# text = cmd\[update:1000\] echo "<b><big> $(date +"%I:%M:%S %p") </big></b>" # AM/PM|text = cmd\[update:1000\] echo "<b><big> $(date +"%I:%M:%S %p") </big></b>" # AM/PM|' ./config/hypr/hyprlock.conf
+ sed -i 's|^# text = cmd\[update:1000\] echo "<b><big> $(date +"%I:%M:%S %p") </big></b>" # AM/PM|text = cmd\[update:1000\] echo "<b><big> $(date +"%I:%M:%S %p") </big></b>" # AM/PM|' ./config/hypr/hyprlock.conf
sed -i 's|^text = cmd\[update:1000\] echo "<b><big> $(date +"%H:%M:%S") </big></b>" # 24H|# text = cmd\[update:1000\] echo "<b><big> $(date +"%H:%M:%S") </big></b>" # 24H|' ./config/hypr/hyprlock.conf
- # for SDDM (custom theme)
+ # for SDDM (simple-sddm)
sddm_folder="/usr/share/sddm/themes/simple-sddm"
if [ -d "$sddm_folder" ]; then
- echo "Simple sddm exists. Editing to 12H format"
+ echo "Simple sddm exists. Editing to 12H format" 2>&1 | tee -a "$LOG"
- sudo sed -i 's|^## HourFormat="hh:mm AP"|HourFormat="hh:mm AP"|' "$sddm_folder/theme.conf"
- sudo sed -i 's|^HourFormat="HH:mm"|## HourFormat="HH:mm"|' "$sddm_folder/theme.conf"
+ sudo sed -i 's|^## HourFormat="hh:mm AP"|HourFormat="hh:mm AP"|' "$sddm_folder/theme.conf" 2>&1 | tee -a "$LOG" || true
+ sudo sed -i 's|^HourFormat="HH:mm"|## HourFormat="HH:mm"|' "$sddm_folder/theme.conf" 2>&1 | tee -a "$LOG" || true
- echo "12H format set to SDDM theme successfully."
+ echo "12H format set to SDDM theme successfully." 2>&1 | tee -a "$LOG"
fi
+
+ # for SDDM (simple-sddm-2)
+ sddm_folder_2="/usr/share/sddm/themes/simple-sddm-2"
+ if [ -d "$sddm_folder_2" ]; then
+ echo "Simple sddm 2 exists. Editing to 12H format" 2>&1 | tee -a "$LOG"
+
+ sudo sed -i 's|^## HourFormat="hh:mm AP"|HourFormat="hh:mm AP"|' "$sddm_folder_2/theme.conf" 2>&1 | tee -a "$LOG" || true
+ sudo sed -i 's|^HourFormat="HH:mm"|## HourFormat="HH:mm"|' "$sddm_folder_2/theme.conf" 2>&1 | tee -a "$LOG" || true
+
+ echo "12H format set to SDDM theme successfully." 2>&1 | tee -a "$LOG"
+ fi
+
break
elif [[ "$answer" == "n" ]]; then
- echo "You chose not to change to 12H format."
+ echo "You chose not to change to 12H format." 2>&1 | tee -a "$LOG"
break
else
echo "Invalid choice. Please enter y for yes or n for no."
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage