diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2024-04-24 14:50:36 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-24 14:50:36 +0900 |
| commit | 9ba5fdcfa59e5d63150171afc3105c801c1e3621 (patch) | |
| tree | 15a295c8a6b8d725f15f3b202adf73d421e8b926 | |
| parent | a070eba1c18e8b064b230f1ad95886f557fec50c (diff) | |
| parent | 2ad64d2efb37bdbb38e8e5b9885978eddc74cf04 (diff) | |
Merge pull request #210 from dhelgerson/development
added user option for 12hr clock
| -rwxr-xr-x | copy.sh | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -113,6 +113,36 @@ done printf "\n" +# Ask whether to change to 12hr format +while true; do + # Ask whether to change to 12hr format + echo -e "$ORANGE By default, configs are in 24H format." + read -p "$CAT Do you want to change to 12H format (AM/PM)? (y/n): " answer + + # Convert the answer to lowercase for comparison + answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]') + + # Check if the answer is valid + if [[ "$answer" == "y" ]]; then + # Modify waybar config if 12hr is selected + # waybar + 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 + # 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 +"%H:%M:%S") </big></b>" # 24H| # text = cmd[update:1000] echo "<b><big> $(date +"%H:%M:%S") <\/big><\/b>" # 24H|' ./config/hypr/hyprlock.conf + + break + elif [[ "$answer" == "n" ]]; then + echo "You chose not to change to 12H format." + break + else + echo "Invalid choice. Please enter y for yes or n for no." + fi +done + +printf "\n" + # Action to do for better rofi appearance while true; do echo "$ORANGE Select monitor resolution for better Rofi appearance:" |
