working on copy script
This commit is contained in:
parent
461fd31713
commit
868d9f621e
116
copy.sh
116
copy.sh
|
@ -306,3 +306,119 @@ while true; do
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Use the selected resolution in your existing script
|
||||||
|
echo "${OK} you have chosen $resolution resolution." 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# Add your commands based on the resolution choice
|
||||||
|
if [ "$resolution" == "< 1440p" ]; then
|
||||||
|
#cp -r config/rofi/resolution/1080p/* config/rofi/ 10-Feb-2025
|
||||||
|
sed -i 's/font_size 16.0/font_size 12.0/' config/kitty/kitty.conf
|
||||||
|
|
||||||
|
# hyprlock matters
|
||||||
|
mv config/hypr/hyprlock.conf config/hypr/hyprlock-2k.conf &&
|
||||||
|
mv config/hypr/hyprlock-1080p.conf config/hypr/hyprlock.conf
|
||||||
|
|
||||||
|
# rofi fonts reduction
|
||||||
|
themes_dir="config/rofi/themes"
|
||||||
|
config_file="config/rofi/config.rasi"
|
||||||
|
|
||||||
|
# Change rofi font size
|
||||||
|
find "$themes_dir" -type f | while read -r file; do
|
||||||
|
if grep -Pzoq 'element-text {\n font: "JetBrainsMono Nerd Font SemiBold 12";\n}' "$file"; then
|
||||||
|
sed -i 's/font: "JetBrainsMono Nerd Font SemiBold 12"/font: "JetBrainsMono Nerd Font SemiBold 10"/' "$file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Change rofi font size in ~/.config/rofi/config.rasi
|
||||||
|
if [ -f "$config_file" ]; then
|
||||||
|
if grep -Pzoq 'configuration {\n font: "JetBrainsMono Nerd Font SemiBold 13";\n}' "$config_file"; then
|
||||||
|
sed -i 's/font: "JetBrainsMono Nerd Font SemiBold 13"/font: "JetBrainsMono Nerd Font SemiBold 12"/' "$config_file"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "\n%.0s" {1..1}
|
||||||
|
|
||||||
|
# Ask whether to change to 12hr format
|
||||||
|
while true; do
|
||||||
|
echo -e "${NOTE} ${SKY_BLUE} by default, hyprland-dotfiles is configured in 24H clock format."
|
||||||
|
read -p "$CAT do you want to change to 12H format or AM/PM format? (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 clock modules if 12hr is selected
|
||||||
|
# Clock 1
|
||||||
|
sed -i 's#^\(\s*\)//\("format": " {:%I:%M %p}",\) #\1\2 #g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
sed -i 's#^\(\s*\)\("format": " {:%H:%M:%S}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# Clock 2
|
||||||
|
sed -i 's#^\(\s*\)\("format": " {:%H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# Clock 3
|
||||||
|
sed -i 's#^\(\s*\)//\("format": "{:%I:%M %p - %d/%b}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
sed -i 's#^\(\s*\)\("format": "{:%H:%M - %d/%b}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# Clock 4
|
||||||
|
sed -i 's#^\(\s*\)//\("format": "{:%B | %a %d, %Y | %I:%M %p}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
sed -i 's#^\(\s*\)\("format": "{:%B | %a %d, %Y | %H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# Clock 5
|
||||||
|
sed -i 's#^\(\s*\)//\("format": "{:%A, %I:%M %P}",\) #\1\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
sed -i 's#^\(\s*\)\("format": "{:%a %d | %H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# for hyprlock
|
||||||
|
sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%H")"/# &/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG"
|
||||||
|
sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%S")"/# &/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG"
|
||||||
|
sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
echo "${OK} 12H format set on waybar clocks successfully." 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# Function to apply 12H format to SDDM themes
|
||||||
|
apply_sddm_12h_format() {
|
||||||
|
local sddm_directory=$1
|
||||||
|
|
||||||
|
# Check if the directory exists
|
||||||
|
if [ -d "$sddm_directory" ]; then
|
||||||
|
echo "editing ${SKY_BLUE}$sddm_directory${RESET} to 12H format" 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
sudo sed -i 's|^## HourFormat="hh:mm AP"|HourFormat="hh:mm AP"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$LOG" || true
|
||||||
|
sudo sed -i 's|^HourFormat="HH:mm"|## HourFormat="HH:mm"|' "$sddm_directory/theme.conf" 2>&1 | tee -a "$LOG" || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Applying to different SDDM themes
|
||||||
|
apply_sddm_12h_format "/usr/share/sddm/themes/simple-sddm"
|
||||||
|
apply_sddm_12h_format "/usr/share/sddm/themes/simple-sddm-2"
|
||||||
|
|
||||||
|
# For SDDM (sequoia_2)
|
||||||
|
sddm_directory_3="/usr/share/sddm/themes/sequoia_2"
|
||||||
|
if [ -d "$sddm_directory_3" ]; then
|
||||||
|
echo "${YELLOW}sddm sequoia_2${RESET} theme exists. editing to 12H format" 2>&1 | tee -a "$LOG"
|
||||||
|
|
||||||
|
# Comment out the existing clockFormat="HH:mm" line
|
||||||
|
sudo sed -i 's|^clockFormat="HH:mm"|## clockFormat="HH:mm"|' "$sddm_directory_3/theme.conf" 2>&1 | tee -a "$LOG" || true
|
||||||
|
|
||||||
|
# Insert the new clockFormat="hh:mm AP" line if it's not already present
|
||||||
|
if ! grep -q 'clockFormat="hh:mm AP"' "$sddm_directory_3/theme.conf"; then
|
||||||
|
sudo sed -i '/^clockFormat=/a clockFormat="hh:mm AP"' "$sddm_directory_3/theme.conf" 2>&1 | tee -a "$LOG" || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${OK} 12H format set to SDDM successfully." 2>&1 | tee -a "$LOG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
break
|
||||||
|
|
||||||
|
elif [[ "$answer" == "n" ]]; then
|
||||||
|
echo "${NOTE} you chose not to change to 12H format." 2>&1 | tee -a "$LOG"
|
||||||
|
break # Exit the loop if the user chooses "n"
|
||||||
|
else
|
||||||
|
echo "${ERROR} invalid choice. please enter y for yes or n for no."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
printf "\n%.0s" {1..1}
|
Loading…
Reference in New Issue