diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-02-07 21:31:36 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-07 21:31:36 +0900 |
| commit | 6fac05d59aa95d0a3d0009734e26459c57ae2536 (patch) | |
| tree | 66fbf0d98651b018827a55f0f4b24e7686524d01 /copy.sh | |
| parent | f6bbfa68a174f0d01fbf8b4ae2a6785e43adba2c (diff) | |
| parent | db04cff10648f94214a39d3303d5c2eeab6603d8 (diff) | |
Merge pull request #546 from JaKooLit/development
Development to main
Diffstat (limited to 'copy.sh')
| -rwxr-xr-x | copy.sh | 234 |
1 files changed, 146 insertions, 88 deletions
@@ -2,23 +2,11 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # clear -wallpaper=$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified +wallpaper=$HOME/.config/hypr/wallpaper_effects/.wallpaper_current waybar_style="$HOME/.config/waybar/style/[Extra] Modern-Combined - Transparent.css" waybar_config="$HOME/.config/waybar/configs/[TOP] Default_v5" waybar_config_laptop="$HOME/.config/waybar/configs/[TOP] Default Laptop_v5" -# Check if running as root. If root, script will exit -if [[ $EUID -eq 0 ]]; then - echo "This script should not be executed as root! Exiting......." - exit 1 -fi - -printf "\n%.0s" {1..2} -echo ' ╦╔═┌─┐┌─┐╦ ╦ ╦┬ ┬┌─┐┬─┐┬ ┌─┐┌┐┌┌┬┐ ╔╦╗┌─┐┌┬┐┌─┐ ' -echo ' ╠╩╗│ ││ │║ ╠═╣└┬┘├─┘├┬┘│ ├─┤│││ ││───║║│ │ │ └─┐ ' -echo ' ╩ ╩└─┘└─┘╩═╝ ╩ ╩ ┴ ┴ ┴└─┴─┘┴ ┴┘└┘─┴┘ ═╩╝└─┘ ┴ └─┘ ' -printf "\n%.0s" {1..2} - # Set some colors for output messages OK="$(tput setaf 2)[OK]$(tput sgr0)" ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)" @@ -26,12 +14,31 @@ NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)" INFO="$(tput setaf 4)[INFO]$(tput sgr0)" WARN="$(tput setaf 1)[WARN]$(tput sgr0)" CAT="$(tput setaf 6)[ACTION]$(tput sgr0)" -MAGENTA=$(tput setaf 5) -WARNING=$(tput setaf 1) -YELLOW=$(tput setaf 3) -BLUE=$(tput setaf 4) -RESET=$(tput sgr0) +MAGENTA="$(tput setaf 5)" +ORANGE="$(tput setaf 214)" +WARNING="$(tput setaf 1)" +YELLOW="$(tput setaf 3)" +GREEN="$(tput setaf 2)" +BLUE="$(tput setaf 4)" +SKY_BLUE="$(tput setaf 6)" +RESET="$(tput sgr0)" + +# Check if running as root. If root, script will exit +if [[ $EUID -eq 0 ]]; then + echo "${ERROR} This script should ${WARNING}NOT${RESET} be executed as root!! Exiting......." + printf "\n%.0s" {1..2} + exit 1 +fi + +printf "\n%.0s" {1..2} +echo -e "\e[35m + ╦╔═┌─┐┌─┐╦ ╔╦╗┌─┐┌┬┐┌─┐ + ╠╩╗│ ││ │║ ║║│ │ │ └─┐ 2025 + ╩ ╩└─┘└─┘╩═╝ ═╩╝└─┘ ┴ └─┘ +\e[0m" +printf "\n%.0s" {1..1} + # Create Directory for Copy Logs if [ ! -d Copy-Logs ]; then mkdir Copy-Logs @@ -62,7 +69,7 @@ fi # uncommenting WLR_RENDERER_ALLOW_SOFTWARE,1 if running in a VM is detected if hostnamectl | grep -q 'Chassis: vm'; then - echo "${INFO} System is running in a virtual machine." 2>&1 | tee -a "$LOG" || true + echo "${INFO} System is running in a virtual machine. Setting up proper env's and configs" 2>&1 | tee -a "$LOG" || true # enabling proper ENV's for Virtual Environment which should help sed -i 's/^\([[:space:]]*no_hardware_cursors[[:space:]]*=[[:space:]]*\)2/\1true/' config/hypr/UserConfigs/UserSettings.conf sed -i '/env = WLR_RENDERER_ALLOW_SOFTWARE,1/s/^#//' config/hypr/UserConfigs/ENVariables.conf @@ -72,7 +79,7 @@ fi # Proper Polkit for NixOS if hostnamectl | grep -q 'Operating System: NixOS'; then - echo "${INFO} NixOS Distro Detected. Setting up properly." 2>&1 | tee -a "$LOG" || true + echo "${INFO} NixOS Distro Detected. Setting up proper env's and configs." 2>&1 | tee -a "$LOG" || true sed -i -E '/^#?exec-once = \$scriptsDir\/Polkit-NixOS\.sh/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf sed -i '/^exec-once = \$scriptsDir\/Polkit\.sh$/ s/^#*/#/' config/hypr/UserConfigs/Startup_Apps.conf fi @@ -192,7 +199,7 @@ ${MAGENTA} NOTE:${RESET} esac done -printf "\n" +printf "\n%.0s" {1..1} # Check if asusctl is installed and add rog-control-center on Startup if command -v asusctl >/dev/null 2>&1; then @@ -204,12 +211,14 @@ if command -v blueman-applet >/dev/null 2>&1; then sed -i '/exec-once = blueman-applet &/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf fi -# Check if ags is installed and add ags on Startup +# Check if ags is installed edit ags behaviour on configs if command -v ags >/dev/null 2>&1; then - sed -i '/exec-once = ags &/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf + sed -i '/#exec-once = ags &/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf + sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh + sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/Refresh.sh fi -printf "\n" +printf "\n%.0s" {1..1} # Checking if neovim or vim is installed and offer user if they want to make as default editor # Function to modify the ENVariables.conf file @@ -290,74 +299,88 @@ printf "\n" # Ask whether to change to 12hr format while true; do - echo -e "$MAGENTA By default, KooL's Dots are configured in 24H clock format." - read -p "$CAT Do you want to change to 12H format or AM/PM format? (y/n): " answer + echo -e "$MAGENTA By default, KooL's Dots are 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:]') + # 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" + # 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" + # 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 succesfully." 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 succesfully." 2>&1 | tee -a "$LOG" - # 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" 2>&1 | tee -a "$LOG" + # Function to apply 12H format to SDDM themes + apply_sddm_12h_format() { + local sddm_directory=$1 - 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 + # 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" - echo "${OK} 12H format set to SDDM theme successfully." 2>&1 | tee -a "$LOG" - fi + 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 + } - # 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" + # 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" - 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 + # 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" - echo "${OK} 12H format set to SDDM theme successfully." 2>&1 | tee -a "$LOG" - fi + # 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 - else - echo "${ERROR} Invalid choice. Please enter y for yes or n for no." - fi + + + 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" # Check if the user wants to disable Rainbow borders @@ -392,7 +415,7 @@ if [ ! -d "$HOME/.config" ]; then exit 1 fi -printf "${INFO} - copying dotfiles ${BLUE}first${RESET} part\n" +printf "${INFO} - copying dotfiles ${SKY_BLUE}first${RESET} part\n" # Config directories which will ask the user whether to replace or not DIRS=" ags @@ -454,7 +477,7 @@ done printf "\n%.0s" {1..1} -printf "${INFO} - Copying dotfiles ${BLUE}second${RESET} part\n" +printf "${INFO} - Copying dotfiles ${SKY_BLUE}second${RESET} part\n" # Check if the config directory exists if [ ! -d "config" ]; then @@ -592,11 +615,15 @@ if [ -d "$BACKUP_DIR_PATH" ]; then done fi -printf "\n%.0s" {1..2} +printf "\n%.0s" {1..} -# Wallpapers +# wallpaper stuff mkdir -p ~/Pictures/wallpapers -cp -r wallpapers ~/Pictures/ && { echo "${OK} some wallpapers compied!"; } || { echo "${ERROR} Failed to copy some wallpapers."; exit 1; } 2>&1 | tee -a "$LOG" +if cp -r wallpapers ~/Pictures/; then + echo "${OK} Some ${MAGENTA}wallpapers${RESET} copied successfully!" | tee -a "$LOG" +else + echo "${ERROR} Failed to copy some ${YELLOW}wallpapers${RESET}" | tee -a "$LOG" +fi # Set some files as executable chmod +x ~/.config/hypr/scripts/* 2>&1 | tee -a "$LOG" @@ -627,6 +654,35 @@ else "$HOME/.config/waybar/configs/[TOP] Default_v5" 2>&1 | tee -a "$LOG" || true fi +printf "\n%.0s" {1..2} + +# for SDDM (sequoia_2) +sddm_sequioa="/usr/share/sddm/themes/sequoia_2" +if [ -d "$sddm_sequioa" ]; then + while true; do + read -rp "${CAT} SDDM sequoia_2 theme detected! Apply current wallpaper as SDDM background? (y/n): " SDDM_WALL + + # Remove any leading/trailing whitespace or newlines from input + SDDM_WALL=$(echo "$SDDM_WALL" | tr -d '\n' | tr -d ' ') + + case $SDDM_WALL in + [Yy]) + # Copy the wallpaper, ignore errors if the file exists or fails + sudo cp -r "config/hypr/wallpaper_effects/.wallpaper_current" "/usr/share/sddm/themes/sequoia_2/backgrounds/default" || true + echo "${NOTE} Current wallpaper applied as default SDDM background" 2>&1 | tee -a "$LOG" + break + ;; + [Nn]) + echo "${NOTE} You chose not to apply the current wallpaper to SDDM." 2>&1 | tee -a "$LOG" + break + ;; + *) + echo "Please enter 'y' or 'n' to proceed." + ;; + esac + done +fi + # additional wallpapers printf "\n%.0s" {1..1} echo "${MAGENTA}By default only a few wallpapers are copied${RESET}..." @@ -728,8 +784,10 @@ printf "\n%.0s" {1..2} # initialize wallust to avoid config error on hyprland wallust run -s $wallpaper 2>&1 | tee -a "$LOG" -printf "\n%.0s" {1..4} -printf "${OK} GREAT! KooL's Hyprland-Dots is now Loaded & Ready !!!" -printf "\n%.0s" {1..1} -printf "${MAGENTA} However, it is HIGHLY SUGGESTED to logout and re-login or better reboot to avoid any issues\n\n" -printf "${BLUE} Thank you for using KooL's Hyprland Configuration... ENJOY!!!\n"
\ No newline at end of file +printf "\n%.0s" {1..2} +printf "${OK} GREAT! KooL's Hyprland-Dots is now Loaded & Ready !!! " +printf "\n%.0s" {1..2} +printf "${INFO} However, it is ${MAGENTA}HIGHLY SUGGESTED${RESET} to logout and re-login or better reboot to avoid any issues" +printf "\n%.0s" {1..2} +printf "${SKY_BLUE}Thank you${RESET} for using ${MAGENTA}KooL's Hyprland Configuration${RESET}... ${YELLOW}ENJOY!!!${RESET}" +printf "\n%.0s" {1..3}
\ No newline at end of file |
