Merge lp:~zorun-42/byobu/fix into lp:byobu

Proposed by zorun on 2011-10-24
Status: Merged
Merged at revision: 1718
Proposed branch: lp:~zorun-42/byobu/fix
Merge into: lp:byobu
Diff against target: 149 lines (+55/-24) 4 files modified
To merge this branch: bzr merge lp:~zorun-42/byobu/fix
Reviewer Review Type Date Requested Status
Dustin Kirkland  2011-10-24 Pending
Review via email: mp+80278@code.launchpad.net

Description of the Change

Some small bugfixes / documentation enhancements.

To post a comment you must log in.
lp:~zorun-42/byobu/fix updated on 2011-10-25
1720. By zorun on 2011-10-25

usr/lib/byobu/.shutil: fix incorrect use of 5165 in get_now, LP: #881437

Preview Diff

1=== modified file 'usr/lib/byobu/.shutil'
2--- usr/lib/byobu/.shutil 2011-10-21 17:33:21 +0000
3+++ usr/lib/byobu/.shutil 2011-10-25 14:02:24 +0000
4@@ -269,9 +269,7 @@
5 }
6
7 get_now() {
8- if [ -n "${BASH_VERSION}" ] && [ -n "${SECONDS}" ]; then
9- _RET=${SECONDS}
10- elif [ -r /proc/uptime ]; then
11+ if [ -r /proc/uptime ]; then
12 # return the integer part of the first item in /proc/uptime
13 local s c
14 read s c < /proc/uptime
15
16=== modified file 'usr/lib/byobu/battery'
17--- usr/lib/byobu/battery 2011-10-22 08:04:01 +0000
18+++ usr/lib/byobu/battery 2011-10-25 14:02:24 +0000
19@@ -26,10 +26,12 @@
20 cat "$bat/info"
21 cat "$bat/state"
22 done
23+ # FIXME: do the same thing with the /sys interface
24 }
25
26 __battery() {
27- local bat line present sign state percent full rem color bcolor
28+ local bat has_bat line present sign state percent full rem color bcolor
29+ has_bat=""
30 for bat in $BATTERY /sys/class/power_supply/* /proc/acpi/battery/*; do
31 present=""; full=""; rem=""; state=""
32 case "$bat" in
33@@ -40,7 +42,7 @@
34 full="$POWER_SUPPLY_CHARGE_FULL"
35 rem="$POWER_SUPPLY_CHARGE_NOW"
36 state="$POWER_SUPPLY_STATUS"
37- [ -n "$present" ] && [ -n "$full" ] && [ -n "$rem" ] && [ "$state" ] && break
38+ [ "$present" = "1" ] && [ -n "$full" ] && [ -n "$rem" ] && [ -n "$state" ] && has_bat=1 && break
39 fi
40 ;;
41 /proc/*)
42@@ -64,28 +66,31 @@
43 esac
44 [ -n "$rem" -a -n "$state" ] && break
45 done < "$bat/state"
46+ [ -n "$full" ] && [ -n "$rem" ] && [ -n "$state" ] && has_bat=1 && break
47 ;;
48 esac
49 done
50- percent=$(((100*$rem)/$full))
51- if [ "$percent" -lt 33 ]; then
52- color="R k"
53- bcolor="b R k"
54- elif [ "$percent" -lt 67 ]; then
55- color="Y k"
56- bcolor="b Y k"
57- else
58- color="G k"
59- bcolor="b G k"
60+ if [ "$has_bat" = "1" ]; then
61+ percent=$(((100*$rem)/$full))
62+ if [ "$percent" -lt 33 ]; then
63+ color="R k"
64+ bcolor="b R k"
65+ elif [ "$percent" -lt 67 ]; then
66+ color="Y k"
67+ bcolor="b Y k"
68+ else
69+ color="G k"
70+ bcolor="b G k"
71+ fi
72+ percent="$percent$PCT"
73+ case $state in
74+ charging|Charging|Unknown) sign="+" ;;
75+ discharging|Discharging) sign="-" ;;
76+ charged|Unknown|Full) sign="="; percent="" ;;
77+ *) sign="$state" ;;
78+ esac
79+ color $bcolor; printf "%s" "$percent"; color -; color $color; printf "%s" "$sign"; color --
80 fi
81- percent="$percent$PCT"
82- case $state in
83- charging|Charging|Unknown) sign="+" ;;
84- discharging|Discharging) sign="-" ;;
85- charged|Unknown) sign="="; percent="" ;;
86- *) sign="$state" ;;
87- esac
88- color $bcolor; printf "%s" "$percent"; color -; color $color; printf "%s" "$sign"; color --
89 }
90
91 # vi: syntax=sh ts=4 noexpandtab
92
93=== modified file 'usr/share/byobu/profiles/tmux'
94--- usr/share/byobu/profiles/tmux 2011-10-10 16:22:51 +0000
95+++ usr/share/byobu/profiles/tmux 2011-10-25 14:02:24 +0000
96@@ -27,6 +27,8 @@
97
98 # Change to Screen's ctrl-a escape sequence
99 source /usr/share/doc/tmux/examples/screen-keys.conf
100+# On Archlinux, this file is not under the same directory
101+source /usr/share/tmux/screen-keys.conf
102
103 # Byobu's Keybindings
104 bind-key -n F1 new-window -k -t config byobu-config
105
106=== modified file 'usr/share/byobu/status/statusrc'
107--- usr/share/byobu/status/statusrc 2011-08-02 05:27:18 +0000
108+++ usr/share/byobu/status/statusrc 2011-10-25 14:02:24 +0000
109@@ -22,13 +22,39 @@
110
111 # Configurations that you can override; if you leave these commented out,
112 # Byobu will try to auto-detect them.
113+
114+# This should be auto-detected for most distro, but setting it here will save
115+# some call to lsb_release and the like.
116+#DISTRO=Ubuntu
117+
118+# Default: depends on the distro (which is either auto-detected, either set
119+# via $DISTRO)
120 #LOGO="\o/"
121+
122+# Default: /
123 #MONITORED_DISK=/
124+
125+# Minimum disk throughput that triggers the notification (in kB/s)
126+# Default: 50
127 #DISK_IO_THRESHOLD=50
128+
129+# Default: eth0
130 #MONITORED_INTERFACE=eth0
131+
132+# Unit used for network throughput (either bits per second or bytes per second)
133+# Default: bits
134+#NETWORK_UNITS=bytes
135+
136+# Minimum network throughput that triggers the notification (in kbit/s)
137+# Default: 20
138 #NETWORK_THRESHOLD=20
139+
140+# You can add an additional source of temperature here
141 #MONITORED_TEMP=/proc/acpi/thermal_zone/THM0/temperature
142+
143+# Default: C
144 #TEMP=F
145-#DISTRO=Ubuntu
146+
147 #SERVICES="eucalyptus-nc|NC eucalyptus-cloud|CLC eucalyptus-walrus eucalyptus-cc|CC eucalyptus-sc|SC"
148+
149 #FAN=$(find /sys -type f -name fan1_input | head -n1)

Subscribers

People subscribed via source and target branches