4
# Copyright (C) 2008 Canonical Ltd.
6
# Authors: Dustin Kirkland <kirkland@canonical.com>
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, version 3 of the License.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
###########################################################
21
# We should be really "nice" about gathering status:
22
#renice 10 $$ >/dev/null 2>&1 || true
23
#ionice -c3 -p $$ >/dev/null 2>&1 || true
24
# However, this *really* slows down startup.
25
# We need a good way of only doing this for updates,
26
# but not at screen startup.
27
###########################################################
31
if [ -d "$HOME/.$PKG/bin" ]; then
33
elif [ -d "/usr/lib/$PKG" ]; then
46
# default = on, user must override to turn off
47
cpu-count|cpu-freq|date|load-average|logo|mem-available|mem-used|menu|reboot-required|release|time|updates-available|uptime)
48
grep -qs -m1 "^$P=0$" "$HOME/.$PKG/status" && exit 0
50
# default = off, user must override to turn on
51
arch|battery|ec2-cost|hostname|ip-address|network-down|network-up|processes|users|whoami|wifi-quality)
52
grep -qs -m1 "^$P=1$" "$HOME/.$PKG/status" || exit 0
56
[ -x "/usr/bin/dpkg-query" ] && /usr/bin/dpkg-query --show $PKG | awk '{print "# $PKG (" $2 ") detailed status:"}'
58
for i in `ls "$DIR"`; do
59
[ "$i" = "menu" ] && continue
60
printf "\n$W%s$X\n" "$HR"
61
printf "$W $X $B# %s:$X\n" "$i"
62
out=`"$DIR"/$i --detail | sed 's/^/\\\033[47m \\\033[0m /g'` || true
64
printf "$W%s$X\n\n" "$HR"
73
if [ -f "$DIR"/"$P" -a -x "$DIR"/"$P" ]; then