diff options
| author | JaKooLit <jimmielovejay@gmail.com> | 2024-04-28 13:37:55 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay@gmail.com> | 2024-04-28 13:37:55 +0900 |
| commit | 78256357235605fe99dad0d26af827d4357e02d2 (patch) | |
| tree | bf83c1e7cc1a1bb32583d4e50628f1a0033b9de1 | |
| parent | 515ef3a3b4a7afcb521e939aa4fa9d74582caacd (diff) | |
updated copy.sh to work with simple sddm 2 theme as well
| -rwxr-xr-x | copy.sh | 30 |
1 files changed, 21 insertions, 9 deletions
@@ -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." |
