mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
* usr/bin/byobu-select-profile, usr/bin/byobu-ugraph,
usr/lib/byobu/include/cycle-status, usr/lib/byobu/ip_address, usr/lib/byobu/memory: - the sed found in Mac OS X seems to really prefer a -e before expression
This commit is contained in:
parent
09241207b6
commit
46a264249e
6 changed files with 12 additions and 8 deletions
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -17,6 +17,10 @@ byobu (5.30) unreleased; urgency=low
|
||||||
- find a suitable hash sum utility (fixes Mac OS X)
|
- find a suitable hash sum utility (fixes Mac OS X)
|
||||||
* usr/lib/byobu/uptime:
|
* usr/lib/byobu/uptime:
|
||||||
- handle multiple white space with a single digit hour on Mac OS X
|
- handle multiple white space with a single digit hour on Mac OS X
|
||||||
|
* usr/bin/byobu-select-profile, usr/bin/byobu-ugraph,
|
||||||
|
usr/lib/byobu/include/cycle-status, usr/lib/byobu/ip_address,
|
||||||
|
usr/lib/byobu/memory:
|
||||||
|
- the sed found in Mac OS X seems to really prefer a -e before expression
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 19 Jan 2013 14:18:01 -0600
|
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 19 Jan 2013 14:18:01 -0600
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,7 @@ setcolor_screen() {
|
||||||
|
|
||||||
get_contrast() {
|
get_contrast() {
|
||||||
# See section 2.2: http://www.w3.org/TR/AERT
|
# See section 2.2: http://www.w3.org/TR/AERT
|
||||||
local hex="$(echo "$1" | sed "s/\(..\)\(..\)\(..\)/\1 \2 \3/")"
|
local hex="$(echo "$1" | sed -e "s/\(..\)\(..\)\(..\)/\1 \2 \3/")"
|
||||||
local bright=$(echo $hex | awk --non-decimal-data '{printf "%0.0f",(("0x"$1)*299+("0x"$2)*587+("0x"$3)*114)/1000}')
|
local bright=$(echo $hex | awk --non-decimal-data '{printf "%0.0f",(("0x"$1)*299+("0x"$2)*587+("0x"$3)*114)/1000}')
|
||||||
if [ $bright -ge 130 ]; then
|
if [ $bright -ge 130 ]; then
|
||||||
_RET="black"
|
_RET="black"
|
||||||
|
|
|
@ -81,7 +81,7 @@ Examples:
|
||||||
Trailing echo adds a required newline
|
Trailing echo adds a required newline
|
||||||
Note no filename specified.
|
Note no filename specified.
|
||||||
|
|
||||||
$script_name "(/usr/lib/byobu/mem_used |sed 's/% //g';echo)"
|
$script_name "(/usr/lib/byobu/mem_used | sed -e 's/% //g';echo)"
|
||||||
|
|
||||||
|
|
||||||
Using $script_name just to rotate log and display the graph
|
Using $script_name just to rotate log and display the graph
|
||||||
|
|
|
@ -35,7 +35,7 @@ for i in $all $all; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Disable all
|
# Disable all
|
||||||
sed -i "s/^tmux_right=/#tmux_right=/" "$BYOBU_CONFIG_DIR/status"
|
sed -i -e "s/^tmux_right=/#tmux_right=/" "$BYOBU_CONFIG_DIR/status"
|
||||||
|
|
||||||
# Enable the next one
|
# Enable the next one
|
||||||
sed -i "${next}s/^#tmux_right=/tmux_right=/" "$BYOBU_CONFIG_DIR/status"
|
sed -i -e "${next}s/^#tmux_right=/tmux_right=/" "$BYOBU_CONFIG_DIR/status"
|
||||||
|
|
|
@ -49,7 +49,7 @@ __ip_address() {
|
||||||
if [ -x /sbin/ip ]; then
|
if [ -x /sbin/ip ]; then
|
||||||
LC_ALL=C /sbin/ip -6 addr list dev "$interface" scope global >"$cache" 2>/dev/null &
|
LC_ALL=C /sbin/ip -6 addr list dev "$interface" scope global >"$cache" 2>/dev/null &
|
||||||
elif $BYOBU_TEST ifconfig >/dev/null 2>&1; then
|
elif $BYOBU_TEST ifconfig >/dev/null 2>&1; then
|
||||||
LC_ALL=c ifconfig "$interface" | grep "inet6 " | awk '{print $2}' | sed "s/%.*//" >"$cache" 2>/dev/null &
|
LC_ALL=c ifconfig "$interface" | grep "inet6 " | awk '{print $2}' | sed -e "s/%.*//" >"$cache" 2>/dev/null &
|
||||||
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -39,9 +39,9 @@ __memory() {
|
||||||
elif $BYOBU_TEST vm_stat >/dev/null 2>&1; then
|
elif $BYOBU_TEST vm_stat >/dev/null 2>&1; then
|
||||||
# MacOS support
|
# MacOS support
|
||||||
# calculation borrowed from http://apple.stackexchange.com/a/48195/18857
|
# calculation borrowed from http://apple.stackexchange.com/a/48195/18857
|
||||||
free_blocks=$(vm_stat | grep free | awk '{ print $3 }' | sed 's/\.//')
|
free_blocks=$(vm_stat | grep free | awk '{ print $3 }' | sed -e 's/\.//')
|
||||||
inactive_blocks=$(vm_stat | grep inactive | awk '{ print $3 }' | sed 's/\.//')
|
inactive_blocks=$(vm_stat | grep inactive | awk '{ print $3 }' | sed -e 's/\.//')
|
||||||
speculative_blocks=$(vm_stat | grep speculative | awk '{ print $3 }' | sed 's/\.//')
|
speculative_blocks=$(vm_stat | grep speculative | awk '{ print $3 }' | sed -e 's/\.//')
|
||||||
free=$((($free_blocks+speculative_blocks)*4))
|
free=$((($free_blocks+speculative_blocks)*4))
|
||||||
inactive=$(($inactive_blocks*4))
|
inactive=$(($inactive_blocks*4))
|
||||||
total=$((($free+$inactive)))
|
total=$((($free+$inactive)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue