Newlines are important

This commit is contained in:
Connor Sheridan 2021-03-25 18:46:07 -04:00
commit 0dbb93b961
No known key found for this signature in database
GPG key ID: F63E070C165D2362
6 changed files with 7 additions and 7 deletions

View file

@ -31,4 +31,4 @@ __cpu_count() {
c=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo) c=$(getconf _NPROCESSORS_ONLN 2>/dev/null || grep -ci "^processor" /proc/cpuinfo)
fi fi
[ "$c" = "1" ] || printf "%sx" "$c" [ "$c" = "1" ] || printf "%sx" "$c"
} }

View file

@ -48,4 +48,4 @@ __cpu_freq() {
fi fi
[ -n "$freq" ] || return [ -n "$freq" ] || return
color b c W; printf "%s" "$freq"; color -; color c W; printf "%s" "$ICON_GHz"; color -- color b c W; printf "%s" "$freq"; color -; color c W; printf "%s" "$ICON_GHz"; color --
} }

View file

@ -55,4 +55,4 @@ __disk() {
[ -n "$size" ] || return [ -n "$size" ] || return
color b m W; printf "%s" "$size"; color -; color m W; printf "%s" "$unit"; color -; color b m W; printf "%s" "$size"; color -; color m W; printf "%s" "$unit"; color -;
color b m W; printf "%s" "$pct"; color -; color m W; printf "%s" "$PCT"; color --; color b m W; printf "%s" "$pct"; color -; color m W; printf "%s" "$PCT"; color --;
} }

View file

@ -33,4 +33,4 @@ __load_average() {
fi fi
[ -n "$one" ] || return [ -n "$one" ] || return
color Y k; printf "$one"; color -- color Y k; printf "$one"; color --
} }

View file

@ -31,7 +31,7 @@ __uptime() {
read u idle < /proc/uptime read u idle < /proc/uptime
u=${u%.*} u=${u%.*}
elif [ $(uname) = "FreeBSD" ]; then elif [ $(uname) = "FreeBSD" ]; then
u=$( sysctl -n kern.boottime | sed -En 's:.*sec = ([[:digit:]]+),.*:\1:p' ) u=$(sysctl -n kern.boottime | sed -En 's:.*sec = ([[:digit:]]+),.*:\1:p')
u=$(($(date +%s) - $u)) u=$(($(date +%s) - $u))
elif [ -x /usr/sbin/sysctl ]; then elif [ -x /usr/sbin/sysctl ]; then
# MacOS support # MacOS support
@ -54,4 +54,4 @@ __uptime() {
fi fi
[ -n "$str" ] || return [ -n "$str" ] || return
color w b; printf "%s" "${str}"; color -- color w b; printf "%s" "${str}"; color --
} }

View file

@ -39,4 +39,4 @@ __users() {
else else
rm -f "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/users"* rm -f "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/users"*
fi fi
} }