Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed unable to change time during installation if user choose 12H format #444

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
20 changes: 10 additions & 10 deletions copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,23 +248,23 @@ while true; do
if [[ "$answer" == "y" ]]; then
# Modify waybar config if 12hr is selected
# Clock 1
sed -i 's#^ \/\/"format": " {:%I:%M %p}", // AM PM format# "format": " {:%I:%M %p}", // AM PM format#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": " {:%H:%M:%S}", // 24H# \/\/"format": " {:%H:%M:%S}", // 24H#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ \/\/"format": " {:%I:%M %p}", // AM PM format# "format": " {:%I:%M %p}", // AM PM format#' config/waybar/Modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": " {:%H:%M:%S}", // 24H# \/\/"format": " {:%H:%M:%S}", // 24H#' config/waybar/Modules 2>&1 | tee -a "$LOG"

# Clock 2
sed -i 's#^ "format": " {:%H:%M}", // 24H# \/\/"format": " {:%H:%M}", // 24H#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": " {:%H:%M}", // 24H# \/\/"format": " {:%H:%M}", // 24H#' config/waybar/Modules 2>&1 | tee -a "$LOG"

# Clock 3
sed -i 's#^ \/\/"format": "{:%I:%M %p - %d/%b}", //for AM/PM# "format": "{:%I:%M %p - %d/%b}", //for AM/PM#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": "{:%H:%M - %d/%b}", // 24H# \/\/"format": "{:%H:%M - %d/%b}", // 24H#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ \/\/"format": "{:%I:%M %p - %d/%b}", //for AM/PM# "format": "{:%I:%M %p - %d/%b}", //for AM/PM#' config/waybar/Modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": "{:%H:%M - %d/%b}", // 24H# \/\/"format": "{:%H:%M - %d/%b}", // 24H#' config/waybar/Modules 2>&1 | tee -a "$LOG"

# Clock 4
sed -i 's#^ \/\/"format": "{:%B | %a %d, %Y | %I:%M %p}", // AM PM format# "format": "{:%B | %a %d, %Y | %I:%M %p}", // AM PM format#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": "{:%B | %a %d, %Y | %H:%M}", // 24H# \/\/"format": "{:%B | %a %d, %Y | %H:%M}", // 24H#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ \/\/"format": "{:%B | %a %d, %Y | %I:%M %p}", // AM PM format# "format": "{:%B | %a %d, %Y | %I:%M %p}", // AM PM format#' config/waybar/Modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": "{:%B | %a %d, %Y | %H:%M}", // 24H# \/\/"format": "{:%B | %a %d, %Y | %H:%M}", // 24H#' config/waybar/Modules 2>&1 | tee -a "$LOG"

# Clock 5
sed -i 's#^ \/\/"format": "{:%A, %I:%M %P}", // AM PM format# "format": "{:%A, %I:%M %P}", // AM PM format#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": "{:%a %d | %H:%M}", // 24H# \/\/"format": "{:%a %d | %H:%M}", // 24H#' config/waybar/modules 2>&1 | tee -a "$LOG"
sed -i 's#^ \/\/"format": "{:%A, %I:%M %P}", // AM PM format# "format": "{:%A, %I:%M %P}", // AM PM format#' config/waybar/Modules 2>&1 | tee -a "$LOG"
sed -i 's#^ "format": "{:%a %d | %H:%M}", // 24H# \/\/"format": "{:%a %d | %H:%M}", // 24H#' config/waybar/Modules 2>&1 | tee -a "$LOG"

# for hyprlock
sed -i 's/^ text = cmd\[update:1000\] echo "\$(date +"%H")"/# &/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG"
Expand Down Expand Up @@ -437,7 +437,7 @@ chmod +x ~/.config/hypr/UserScripts/* 2>&1 | tee -a "$LOG"
chmod +x ~/.config/hypr/initial-boot.sh 2>&1 | tee -a "$LOG"
printf "\n"

# Detect machine type and set Waybar configurations accordingly
# Detect machine type and set waybar configurations accordingly
if hostnamectl | grep -q 'Chassis: desktop'; then
# Configurations for a desktop
ln -sf "$waybar_config" "$HOME/.config/waybar/config" 2>&1 | tee -a "$LOG"
Expand Down