Watch
1
0
Fork
You've already forked dotfiles
0

Drop "uptime" from the welcome message ...

... so that it becomes shorter
This commit is contained in:
Alexander Hess 2026-08-13 22:17:05 +02:00
commit 6dc1f0bb5b
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -8,12 +8,6 @@ _os="$(uname -s) $(uname -r)"
_user=$(whoami) _user=$(whoami)
_work_dir=$(echo "$PWD" | sed "s|^$HOME|~|") _work_dir=$(echo "$PWD" | sed "s|^$HOME|~|")
if uptime -p >/dev/null 2>&1; then # because some systems (e.g. BusyBox) don't support "-p"
_uptime=$(uptime -p | sed 's/up //; s/weeks\?/w/g; s/days\?/d/g; s/hours\?/h/g; s/minutes\?/m/g; s/ //g')
else
_uptime=$(uptime 2>/dev/null | sed 's/.*up *//; s/,.*//')
fi
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
_prompt="#" _prompt="#"
@ -38,7 +32,7 @@ else
fi fi
_info_line="$_user@$_hostname:$_work_dir$_prompt$_remote $_os uptime: $_uptime $_shell_type" _info_line="$_user@$_hostname:$_work_dir$_prompt$_remote $_os $_shell_type"
_sep_line=$(echo "$_info_line" | sed 's/./─/g') _sep_line=$(echo "$_info_line" | sed 's/./─/g')
@ -49,4 +43,4 @@ echo "$_sep_line"
echo "" echo ""
unset _hostname _os _user _work_dir _uptime _prompt _remote _shell_type _info_line _sep_line unset _hostname _os _user _work_dir _prompt _remote _shell_type _info_line _sep_line