Browse Source

Update copy.sh

changed somethings and added for hyprlock
pull/210/head
Ja.KooLit 2 years ago committed by GitHub
parent
commit
2ad64d2efb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 54
      copy.sh

54
copy.sh

@ -113,35 +113,35 @@ done
printf "\n" printf "\n"
# Ask whether 12 or 24hr clock is preffered # Ask whether to change to 12hr format
while true; do while true; do
echo "$ORANGE Do you prefer a 12hr or 24hr clock?" # Ask whether to change to 12hr format
echo "$YELLOW 1. 12hr clock (AM/PM)" echo -e "$ORANGE By default, configs are in 24H format."
echo "$YELLOW 2. 24hr clock" read -p "$CAT Do you want to change to 12H format (AM/PM)? (y/n): " answer
read -p "$CAT Enter the number of your choice: " choice
# Convert the answer to lowercase for comparison
case $choice in answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]')
1)
clockformat="12" # Check if the answer is valid
break if [[ "$answer" == "y" ]]; then
;; # Modify waybar config if 12hr is selected
2) # waybar
clockformat="24" sed -i 's/^ \/\/"format": " {:%I:%M %p}"/ "format": " {:%I:%M %p}"/' ./config/waybar/modules
break 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
echo "Invalid choice. Please enter 1 for 12hr clock or 2 for 24hr" 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
;;
esac break
done elif [[ "$answer" == "n" ]]; then
echo "You chose not to change to 12H format."
# Provide feedback for chosen clock format break
echo "You Chose a $clockformat hour clock" 2>&1 | tee -a "$LOG" else
echo "Invalid choice. Please enter y for yes or n for no."
fi
done
# modify waybar config if 12hr is selected printf "\n"
if [ "$clockformat" == "12" ]; then
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
# Action to do for better rofi appearance # Action to do for better rofi appearance
while true; do while true; do

Loading…
Cancel
Save