diff --git a/system/bin/submodule_update.sh b/system/bin/submodule_update.sh index 84943fa..d037a17 100755 --- a/system/bin/submodule_update.sh +++ b/system/bin/submodule_update.sh @@ -16,7 +16,7 @@ START_DIR=$(pwd) - +print_header "Updating submodules" while IFS= read -r -d '' dir diff --git a/system/bin/utils.sh b/system/bin/utils.sh index 90b891d..2af64db 100755 --- a/system/bin/utils.sh +++ b/system/bin/utils.sh @@ -34,11 +34,9 @@ YELLOW='\033[33m' # Function to display fancy headers # USAGE: print_header TITLE function print_header() { - echo -e "\n${GREEN}########################################" - echo -e "#" - echo -e "# ${1}" - echo -e "#" - echo -e "########################################${RESET}" + echo -e "\n${GREEN}╔══════════════════════════════════════════════════════════════════════════════╗" + echo -e "║ $(printf "%-77s" "${1}")║" + echo -e "╚══════════════════════════════════════════════════════════════════════════════╝${RESET}" } # Function to print a info message with the current time and to send @@ -52,25 +50,26 @@ function print_notify() { # Prints a section title. # USAGE: print_section TITLE function print_section() { - echo -e "${YELLOW}${1}" - echo -e "----------------------------------------${RESET}" + echo -e "${YELLOW}┌──────────────────────────────────────────────────────────────────────────────┐" + echo -e "│ $(printf "%-77s" "${1}")│" + echo -e "└──────────────────────────────────────────────────────────────────────────────┘${RESET}" } function print_log() { - echo -e "- $1" + echo -e "• $1" } # Creates the given directory in the home directory # USAGE: create_directory DIRECTORY function create_directory() { - echo -e "- Creating directory ${YELLOW}${HOME}/${1}${RESET}" + print_log "Creating directory ${YELLOW}${HOME}/${1}${RESET}" mkdir -p "${HOME}/${1}" } # Creates a symlink of the given file from the home directory to here. # USAGE: create_link FILE function create_link() { - echo -e "- Linking ${YELLOW}${HOME}/${1}${RESET} -> ${YELLOW}${SYSTEM_DIR}/${1}${RESET}" + print_log "Linking ${YELLOW}${HOME}/${1}${RESET} -> ${YELLOW}${SYSTEM_DIR}/${1}${RESET}" rm -rf "${HOME:?}/$1" ln -fs "${SYSTEM_DIR}/${1}" "${HOME}/${1}" } @@ -78,15 +77,15 @@ function create_link() { # Function to set owner and permission of a file # USAGE: set_permission OWNER PERMISSION FILE function set_permission() { - echo -e "- Changing permission of ${YELLOW}${3}${RESET} to ${YELLOW}${1}${RESET}" + print_log "Changing owner of ${YELLOW}${3}${RESET} to ${YELLOW}${1}${RESET}" sudo chown -R "${1}" "${3}" - echo -e "- Changing permission of ${YELLOW}${3}${RESET} to ${YELLOW}${2}${RESET}" + print_log "Changing permission of ${YELLOW}${3}${RESET} to ${YELLOW}${2}${RESET}" sudo chmod -R "${2}" "${3}" } # Function to enable a service # USAGE: enable_service SERVICE function enable_service() { - echo -e "- Enabling service ${YELLOW}${1}${RESET}" + print_log "Enabling service ${YELLOW}${1}${RESET}" sudo systemctl enable "${1}" } \ No newline at end of file