* screen-profiles-status: color code and format the detailed status output

Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
Dustin Kirkland 2009-05-02 14:25:33 -05:00
commit c9326c125e
2 changed files with 20 additions and 7 deletions

9
debian/changelog vendored
View file

@ -1,13 +1,20 @@
screen-profiles (1.54) unreleased; urgency=low screen-profiles (1.54) unreleased; urgency=low
* bin/ip-address: don't color the whitespace * bin/ip-address: don't color the whitespace
* bin/cpu-count: don't echo blank line in detailed status
* bin/updates-available: print "None" in detailed status, if no updates
are available
* screen-profiles-status: ensure that all detail scripts get a chance * screen-profiles-status: ensure that all detail scripts get a chance
to run to run
* debian/copyright: there have *never* been icons in screen-profiles; * debian/copyright: there have *never* been icons in screen-profiles;
remove the CC2.5 license statement, as this was erroneously copied over remove the CC2.5 license statement, as this was erroneously copied over
from another package for the initial packaging from another package for the initial packaging
* screen-profiles-status: color code and format the detailed status output
* screen-profiles-status-detail: use less -R to render ansi escaped
color formatting correctly; seed the search pattern with the header
for each section
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 01 May 2009 15:48:32 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Sat, 02 May 2009 14:25:28 -0500
screen-profiles (1.53-0ubuntu1) karmic; urgency=low screen-profiles (1.53-0ubuntu1) karmic; urgency=low

View file

@ -35,6 +35,10 @@ else
fi fi
P="$1" P="$1"
B='\033[34;1m'
W='\033[47m'
X='\033[0m'
HR=" "
case "$P" in case "$P" in
# default = on, user must override to turn off # default = on, user must override to turn off
@ -46,14 +50,16 @@ case "$P" in
grep -qs -m1 "^$P=1$" "$HOME/.screen-profiles/status" || exit 0 grep -qs -m1 "^$P=1$" "$HOME/.screen-profiles/status" || exit 0
;; ;;
--detail) --detail)
printf "\033[1m"
[ -x "/usr/bin/dpkg-query" ] && /usr/bin/dpkg-query --show screen-profiles | awk '{print "# screen-profiles (" $2 ") detailed status:"}'
printf "$X\n"
for i in `ls "$DIR"`; do for i in `ls "$DIR"`; do
[ "$i" = "menu" ] && continue [ "$i" = "menu" ] && continue
echo printf "\n$W%s$X\n" "$HR"
echo " ______________________________________________________________________" printf "$W $X $B# %s:$X\n" "$i"
echo "/ * $i:" out=`"$DIR"/$i --detail | sed 's/^/\\\033[47m \\\033[0m /g'` || true
out=`"$DIR"/$i --detail` || true printf "$out\n"
echo "$out" | sed "s/^/| /g" printf "$W%s$X\n\n" "$HR"
echo "\\______________________________________________________________________"
done done
exit 0 exit 0
;; ;;