diff --git a/zsh/functions/motd.zsh b/zsh/functions/motd.zsh index 6bc2b2f..6255ffd 100644 --- a/zsh/functions/motd.zsh +++ b/zsh/functions/motd.zsh @@ -116,7 +116,7 @@ show_motd() { echo "${DF_GREY}╒${hline}╕${DF_NC}" local h_left="✦ ${username}@${hostname} " - local h_center=$(hostname -i 2>/dev/null | awk -F" " '{print $1}') + local h_center=$(ip route get 1 2>/dev/null | awk '{print $7; exit}' || hostname -i 2>/dev/null | awk '{print $1}') local h_right="${datetime}" local h_pad=$(((inner - ${#h_left} - ${#h_center} - ${#h_right}) / 2)) local h_spaces=""