* usr/lib/byobu/battery, usr/lib/byobu/.shutil,

usr/share/byobu/profiles/tmux, usr/share/byobu/status/statusrc:
  - various fixes and documentation enhancements
This commit is contained in:
Dustin Kirkland 2011-10-26 09:50:46 -05:00
commit ef5a077a81
5 changed files with 45 additions and 12 deletions

5
debian/changelog vendored
View file

@ -4,6 +4,11 @@ byobu (4.44) unreleased; urgency=low
* usr/lib/byobu/battery:
- protect against division by zero
[ Daniel Hahler ]
* usr/lib/byobu/battery, usr/lib/byobu/.shutil,
usr/share/byobu/profiles/tmux, usr/share/byobu/status/statusrc:
- various fixes and documentation enhancements
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 22 Oct 2011 03:21:46 -0500
byobu (4.43-0ubuntu1) precise; urgency=low

View file

@ -269,9 +269,7 @@ status_freq() {
}
get_now() {
if [ -n "${BASH_VERSION}" ] && [ -n "${SECONDS}" ]; then
_RET=${SECONDS}
elif [ -r /proc/uptime ]; then
if [ -r /proc/uptime ]; then
# return the integer part of the first item in /proc/uptime
local s c
read s c < /proc/uptime

View file

@ -26,6 +26,7 @@ __battery_detail() {
cat "$bat/info"
cat "$bat/state"
done
# FIXME: do the same thing with the /sys interface
}
__battery() {
@ -40,7 +41,7 @@ __battery() {
full="$POWER_SUPPLY_CHARGE_FULL"
rem="$POWER_SUPPLY_CHARGE_NOW"
state="$POWER_SUPPLY_STATUS"
[ -n "$present" ] && [ -n "$full" ] && [ -n "$rem" ] && [ "$state" ] && break
[ "$present" = "1" ] && [ -n "$full" ] && [ -n "$rem" ] && [ -n "$state" ] && break
fi
;;
/proc/*)
@ -64,6 +65,7 @@ __battery() {
esac
[ -n "$rem" -a -n "$state" ] && break
done < "$bat/state"
[ -n "$full" ] && [ -n "$rem" ] && [ -n "$state" ] && break
;;
esac
done
@ -83,7 +85,7 @@ __battery() {
case $state in
charging|Charging|Unknown) sign="+" ;;
discharging|Discharging) sign="-" ;;
charged|Unknown) sign="="; percent="" ;;
charged|Unknown|Full) sign="="; percent="" ;;
*) sign="$state" ;;
esac
color $bcolor; printf "%s" "$percent"; color -; color $color; printf "%s" "$sign"; color --

View file

@ -27,6 +27,8 @@ set -s escape-time 0
# Change to Screen's ctrl-a escape sequence
source /usr/share/doc/tmux/examples/screen-keys.conf
# On Archlinux, this file is not under the same directory
source /usr/share/tmux/screen-keys.conf
# Byobu's Keybindings
bind-key -n F1 new-window -k -t config byobu-config

View file

@ -22,13 +22,39 @@
# Configurations that you can override; if you leave these commented out,
# Byobu will try to auto-detect them.
#LOGO="\o/"
#MONITORED_DISK=/
#DISK_IO_THRESHOLD=50
#MONITORED_INTERFACE=eth0
#NETWORK_THRESHOLD=20
#MONITORED_TEMP=/proc/acpi/thermal_zone/THM0/temperature
#TEMP=F
# This should be auto-detected for most distro, but setting it here will save
# some call to lsb_release and the like.
#DISTRO=Ubuntu
# Default: depends on the distro (which is either auto-detected, either set
# via $DISTRO)
#LOGO="\o/"
# Default: /
#MONITORED_DISK=/
# Minimum disk throughput that triggers the notification (in kB/s)
# Default: 50
#DISK_IO_THRESHOLD=50
# Default: eth0
#MONITORED_INTERFACE=eth0
# Unit used for network throughput (either bits per second or bytes per second)
# Default: bits
#NETWORK_UNITS=bytes
# Minimum network throughput that triggers the notification (in kbit/s)
# Default: 20
#NETWORK_THRESHOLD=20
# You can add an additional source of temperature here
#MONITORED_TEMP=/proc/acpi/thermal_zone/THM0/temperature
# Default: C
#TEMP=F
#SERVICES="eucalyptus-nc|NC eucalyptus-cloud|CLC eucalyptus-walrus eucalyptus-cc|CC eucalyptus-sc|SC"
#FAN=$(find /sys -type f -name fan1_input | head -n1)