diff --git a/zsh/functions/motd.zsh b/zsh/functions/motd.zsh index 3367ce1..af06826 100644 --- a/zsh/functions/motd.zsh +++ b/zsh/functions/motd.zsh @@ -59,7 +59,7 @@ _motd_disk() { # ============================================================================ # Fixed box width -_M_WIDTH=78 +_M_WIDTH=64 _motd_line() { local char="$1" @@ -97,7 +97,7 @@ show_motd() { local load=$(_motd_load) local mem=$(_motd_mem) local disk=$(_motd_disk) - + local local_ip=$(hostname -i | awk -F" " '{print $1}') local hline=$(_motd_line '═') local inner=$((_M_WIDTH - 2)) @@ -108,11 +108,12 @@ show_motd() { # Header: hostname + datetime local h_left="✦ ${hostname}" + local h_center="${local_ip}" local h_right="${datetime}" - local h_pad=$((inner - ${#h_left} - ${#h_right})) + local h_pad=$(((inner - ${#h_left} - ${#h_center} - ${#h_right}) / 2 )) local h_spaces="" for ((i=0; i