Dotfiles update 2025-12-22 00:39

This commit is contained in:
Aaron D. Lee
2025-12-22 00:39:04 -05:00
parent c294bbb5d5
commit ee1805a978
4 changed files with 105 additions and 26 deletions

View File

@@ -123,19 +123,48 @@ CYAN='\033[0;36m'
NC='\033[0m'
# ============================================================================
# Helper Functions
# MOTD-style header
# ============================================================================
_M_WIDTH=66
print_header() {
local user="${USER:-root}"
local hostname="${HOSTNAME:-localhost}"
local timestamp=$(date '+%a %b %d %H:%M')
local hostname="${HOSTNAME:-$(hostname -s 2>/dev/null)}"
local script_name="install.sh"
local datetime=$(date '+%a %b %d %H:%M')
# Colors
local _M_RESET=$'\033[0m'
local _M_BOLD=$'\033[1m'
local _M_DIM=$'\033[2m'
local _M_BLUE=$'\033[38;5;39m'
local _M_GREY=$'\033[38;5;242m'
# Build horizontal line
local hline=""
for ((i=0; i<_M_WIDTH; i++)); do hline+="═"; done
local inner=$((_M_WIDTH - 2))
# Header content
local h_left="${user}@${hostname}"
local h_center="${script_name}"
local h_right="${datetime}"
local h_pad=$(((inner - ${#h_left} - ${#h_center} - ${#h_right}) / 2))
local h_spaces=""
for ((i=0; i<h_pad; i++)); do h_spaces+=" "; done
echo ""
printf "${CYAN}+ ${NC}%-20s %30s %25s\n" "$user@$hostname" "install.sh" "$timestamp"
echo -e "${_M_GREY}${hline}${_M_RESET}"
echo -e "${_M_GREY}${_M_RESET} ${_M_BOLD}${_M_BLUE}${h_left}${_M_RESET}${h_spaces}${_M_DIM}${h_center}${h_spaces}${h_right}${_M_RESET} ${_M_GREY}${_M_RESET}"
echo -e "${_M_GREY}${hline}${_M_RESET}"
echo ""
}
# ============================================================================
# Helper Functions
# ============================================================================
print_step() {
echo -e "${GREEN}==>${NC} $1"
}