mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* bin/*: use bold for measurements, and non-bold for units; this really
makes byobu's status items 'pop'! Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
79b191ba4c
commit
57612524ed
16 changed files with 28 additions and 25 deletions
|
@ -48,11 +48,11 @@ for bat in $(ls /proc/acpi/battery); do
|
|||
|
||||
percent=$( echo "$rem" "$full" | awk '{printf "%.0f", 100*$1/$2}')
|
||||
if [ "$percent" -lt 33 ]; then
|
||||
per_color="{= Rk}"
|
||||
per_color="Rk"
|
||||
elif [ "$percent" -lt 67 ]; then
|
||||
per_color="{= Yk}"
|
||||
per_color="Yk"
|
||||
else
|
||||
per_color="{= Gk}"
|
||||
per_color="Gk"
|
||||
fi
|
||||
percent="$percent%"
|
||||
|
||||
|
@ -72,6 +72,6 @@ for bat in $(ls /proc/acpi/battery); do
|
|||
sign="$state"
|
||||
;;
|
||||
esac
|
||||
printf "\005%s%s|%s|\005{-} " "$per_color" "$percent" "$sign"
|
||||
printf "\005{=b %s}%s\005{-}\005{= %s}|%s|\005{-} " "$per_color" "$percent" "$per_color" "$sign"
|
||||
break
|
||||
done
|
||||
|
|
|
@ -23,7 +23,7 @@ if [ "$1" = "--detail" ]; then
|
|||
fi
|
||||
|
||||
if [ -r "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" ]; then
|
||||
awk '{ printf "\005{=b cW}%.1fGHz\005{-} ", $1 / 1000000 }' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
|
||||
awk '{ printf "\005{=b cW}%.1f\005{-}\005{= cW}GHz\005{-} ", $1 / 1000000 }' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
|
||||
else
|
||||
egrep -i -m 1 "^cpu MHz|^clock|^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ printf "\005{=b cW}%.1fGHz\005{-} ", $2 / 1000 }'
|
||||
egrep -i -m 1 "^cpu MHz|^clock|^bogomips" /proc/cpuinfo | awk -F"[:.]" '{ printf "\005{=b cW}%.1f\005{-}\005{= cW}GHz\005{-} ", $2 / 1000 }'
|
||||
fi
|
||||
|
|
4
bin/disk
4
bin/disk
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# disk_available: print the current disk space available
|
||||
# disk: print the current disk space and usage
|
||||
# Copyright (C) 2008 Canonical Ltd.
|
||||
#
|
||||
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||
|
@ -30,4 +30,4 @@ case $MP in
|
|||
/dev/*) MP=`grep "$MP" /proc/mounts | awk '{print $2}'` ;;
|
||||
esac
|
||||
|
||||
df -h -P "$MP" | tail -n 1 | awk '{printf "\005{=b MW}%sB,%s\005{-} ", $2, $5}'
|
||||
df -h -P "$MP" | tail -n 1 | awk '{printf "\005{=b MW}%sB\005{-}\005{= MW},%s\005{-} ", $2, $5}'
|
||||
|
|
|
@ -64,7 +64,7 @@ network_cost=`echo "$tx_gb" "$TX_RATE" "$rx_gb" "$RX_RATE" | awk '{printf "%f %f
|
|||
# Some additional input will be required to account for reboots!!!
|
||||
hours=`awk '{printf "%f", 1 + $1 / 60 / 60 }' /proc/uptime | sed 's/\..*$//' `
|
||||
uptime_cost=`echo "$hours" | awk "{printf \"%f\", "$CPU_RATE" * $hours}"`
|
||||
total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "~\$%.2f", $1 + $2}'`
|
||||
total_cost=`echo "$network_cost" "$uptime_cost" | awk '{printf "%.2f", $1 + $2}'`
|
||||
|
||||
if [ "$DETAIL" = "1" ]; then
|
||||
echo "================================================"
|
||||
|
@ -77,9 +77,9 @@ if [ "$DETAIL" = "1" ]; then
|
|||
echo " Uptime: $hours hr @ \$$CPU_RATE/hr"
|
||||
echo " Uptime cost: \$$uptime_cost"
|
||||
echo "------------------------------------------------"
|
||||
echo "Total cost: $total_cost"
|
||||
echo "Total cost: ~\$$total_cost"
|
||||
echo "================================================"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf "\005{= wg}%s\005{-} " $total_cost
|
||||
printf "\005{= KG}~\$\005{-}\005{=b KG}%s\005{-} " $total_cost
|
||||
|
|
3
bin/logo
3
bin/logo
|
@ -81,7 +81,8 @@ print_logo() {
|
|||
$MARKUP && printf "\005{= Wr}$logo" || printf "$logo"
|
||||
;;
|
||||
*)
|
||||
false
|
||||
logo=" 屏風 "
|
||||
$MARKUP && printf "\005{= Wk}$logo" || printf " $logo "
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
2
bin/mail
2
bin/mail
|
@ -23,4 +23,4 @@ if [ "$1" = "--detail" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
[ -s "$mailfile" ] && printf "\005{= wk}[M]\005{-} " || exit 0
|
||||
[ -s "$mailfile" ] && printf "\005{= wk}[\005{-}\005{=b wk}M\005{-}\005{= wk}]\005{-} " || exit 0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# mem_available: grab the current memory available
|
||||
# mem: grab the current memory and usage
|
||||
# Copyright (C) 2008 Canonical Ltd.
|
||||
#
|
||||
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||
|
@ -39,4 +39,4 @@ else
|
|||
mem="$mem"
|
||||
unit="KB"
|
||||
fi
|
||||
printf "\005{=b gW}%s$unit%s\005{-}%s" "$mem" "$comma" "$whitespace"
|
||||
printf "\005{=b gW}%s\005{-}\005{= gW}$unit%s\005{-}%s" "$mem" "$comma" "$whitespace"
|
||||
|
|
|
@ -22,4 +22,4 @@ if [ "$1" = "--detail" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
free | awk '/buffers\/cache:/ {printf "\005{=b gW}%.0f%%\005{-} ", 100*$3/($3 + $4)}'
|
||||
free | awk '/buffers\/cache:/ {printf "\005{=b gW}%.0f\005{-}\005{= gW}%%\005{-} ", 100*$3/($3 + $4)}'
|
||||
|
|
2
bin/menu
2
bin/menu
|
@ -19,4 +19,4 @@
|
|||
|
||||
[ "$1" = "--detail" ] && exit 0
|
||||
|
||||
printf " \005{= kw}%s" `gettext "Menu:<F9>"`
|
||||
printf " \005{= kw}%s:<\005{-}\005{=b kw}F9\005{= kw}>" `gettext "Menu"`
|
||||
|
|
|
@ -22,4 +22,4 @@ if [ "$1" = "--detail" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
printf "\005{= yk}%s&\005{-} " $(ls -d /proc/[0-9]* 2>/dev/null| wc -l)
|
||||
printf "\005{=b yk}%s\005{-}\005{= yk}&\005{-} " $(ls -d /proc/[0-9]* 2>/dev/null| wc -l)
|
||||
|
|
|
@ -28,7 +28,7 @@ case "$1" in
|
|||
[ -e "$reboot" ] && printf "Yes" || printf "No"
|
||||
;;
|
||||
*)
|
||||
[ -e "$reboot" ] && printf "\005{=b bW}(@)\005{-} "
|
||||
[ -e "$reload" ] && printf "\005{=b bW}<F5>\005{-} "
|
||||
[ -e "$reboot" ] && printf "\005{= bW}(\005{-}\005{=b bW}R\005{-}\005{= bW})\005{-} "
|
||||
[ -e "$reload" ] && printf "\005{= bW}<\005{-}\005{=b bW}F5\005{-}\005{= bW}>\005{-} "
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -29,6 +29,6 @@ fi
|
|||
|
||||
for i in `ls "$DIR/"*"/temperature"`; do
|
||||
t=$(sed "s/^[^0-9]\+//" "$i" | sed "s/\s.*$//")
|
||||
printf "\005{=b kY}%sC\005{-} " "$t"
|
||||
printf "\005{=b kY}%s\005{-}\005{= kY}C\005{-} " "$t"
|
||||
break
|
||||
done
|
||||
|
|
|
@ -25,6 +25,6 @@ fi
|
|||
|
||||
for i in `ls "$DIR/"*"/temperature"`; do
|
||||
t=$(sed "s/^[^0-9]\+//" "$i" | sed "s/\s.*$//" | awk '{printf "%.0f", $1 *9/5 + 32}')
|
||||
printf "\005{=b kY}%sF\005{-} " "$t"
|
||||
printf "\005{=b kY}%s\005{-}\005{= kY}F\005{-} " "$t"
|
||||
break
|
||||
done
|
||||
|
|
|
@ -40,7 +40,7 @@ print_updates() {
|
|||
s=$2
|
||||
if [ -n "$u" ]; then
|
||||
if [ "$u" -gt 0 ]; then
|
||||
printf "\005{=b rW}%d!" "$u"
|
||||
printf "\005{=b rW}%d\005{-}\005{= rW}!" "$u"
|
||||
if [ -n "$s" ]; then
|
||||
if [ "$s" -gt 0 ]; then
|
||||
printf "!"
|
||||
|
|
|
@ -25,4 +25,4 @@ if [ "$1" = "--detail" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
printf "\005{= wr}%d#\005{-} " `pgrep -c -f "sshd:.*@"`
|
||||
printf "\005{=b wr}%d\005{-}\005{= wr}#\005{-} " `pgrep -c -f "sshd:.*@"`
|
||||
|
|
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -3,8 +3,10 @@ byobu (2.19) unreleased; urgency=low
|
|||
* bin/cpu_freq, bin/disk, bin/mem_available, bin/mem_used: use bold
|
||||
font for these, to help with dark colored tty's
|
||||
* bin/temp_c, bin/temp_f: fix display of yellow on dark tty's
|
||||
* bin/*: use bold for measurements, and non-bold for units; this really
|
||||
makes byobu's status items 'pop'!
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 02 Jul 2009 16:02:09 -0700
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 03 Jul 2009 15:46:49 -0700
|
||||
|
||||
byobu (2.18-0ubuntu1) karmic; urgency=low
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue