mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
Tranform byobu-status --detail to use vim's folding feature
* byobu-status: output text compatible with vim's folding feature Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
826a43496b
commit
a5fe5a84df
2 changed files with 34 additions and 14 deletions
23
byobu-status
23
byobu-status
|
@ -37,10 +37,6 @@ 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
|
||||||
|
@ -52,16 +48,19 @@ case "$P" in
|
||||||
grep -qs -m1 "^$P=1$" "$HOME/.$PKG/status" || exit 0
|
grep -qs -m1 "^$P=1$" "$HOME/.$PKG/status" || exit 0
|
||||||
;;
|
;;
|
||||||
--detail)
|
--detail)
|
||||||
printf "\033[1m"
|
if [ -x "/usr/bin/dpkg-query" ]; then
|
||||||
[ -x "/usr/bin/dpkg-query" ] && /usr/bin/dpkg-query --show $PKG | awk '{print "# $PKG (" $2 ") detailed status:"}'
|
/usr/bin/dpkg-query --show $PKG | awk '{print $1 "-" $2 " detailed status:"}'
|
||||||
printf "$X\n"
|
else
|
||||||
|
printf "$PKG detailed status:"
|
||||||
|
fi
|
||||||
|
printf "\n"
|
||||||
for i in `ls "$DIR"`; do
|
for i in `ls "$DIR"`; do
|
||||||
[ "$i" = "menu" ] && continue
|
[ "$i" = "menu" ] && continue
|
||||||
printf "\n$W%s$X\n" "$HR"
|
short=`"$DIR"/$i --short | sed 's/ $//' | sed 's/.{[^}]*}//g' | sed 's/^/\t/g'` || true
|
||||||
printf "$W $X $B# %s:$X\n" "$i"
|
detail=`"$DIR"/$i --detail | sed '/^$/d' | sed 's/^/\t/g'` || true
|
||||||
out=`"$DIR"/$i --detail | sed 's/^/\\\033[47m \\\033[0m /g'` || true
|
printf "%-20s - %s\n" "$i" "$short"
|
||||||
printf "$out\n"
|
[ -n "$short" ] && printf "%s\n" "$short"
|
||||||
printf "$W%s$X\n\n" "$HR"
|
[ -n "$detail" ] && printf "%s\n" "$detail"
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
25
debian/changelog
vendored
25
debian/changelog
vendored
|
@ -1,8 +1,29 @@
|
||||||
byobu (2.1) jaunty; urgency=low
|
byobu (2.1) unreleased; urgency=low
|
||||||
|
|
||||||
* byobu-export: touch an empty .byobu/profile, silence error message
|
* byobu-export: touch an empty .byobu/profile, silence error message
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 06 May 2009 15:33:47 -0500
|
Tranform byobu-status --detail to use vim's folding feature
|
||||||
|
* byobu-status: output text compatible with vim's folding feature
|
||||||
|
* byobu-status-detail: use vim's folding status feature to allow
|
||||||
|
for collapsing/expanding each status item; fall back on
|
||||||
|
sensible-pager if +folding is not available; and fall back on less
|
||||||
|
if sensible-pager is not available
|
||||||
|
* bin/cpu-count: nothing to print on --detail
|
||||||
|
* bin/date: add --short which actually prints the current date
|
||||||
|
* bin/ec2-cost: handle on/off configuration like *all* other status
|
||||||
|
scripts, no need for FORCE
|
||||||
|
* bin/ip-address: --detail shows all inet addr's in ifconfig
|
||||||
|
* bin/logo: --detail should be empty
|
||||||
|
* bin/network-down, bin/network-up: trim leading and trailing whitespace
|
||||||
|
* bin/reboot-required: add a --short option, which prints Yes or No
|
||||||
|
* bin/time: add --short which actually prints the current time
|
||||||
|
rather than the screen escape sequence
|
||||||
|
* bin/updates-available: add a --short option, which only displays the
|
||||||
|
number of updates available; show more info on --detail about upgrades
|
||||||
|
* bin/users: grep out the grep statement in the ps
|
||||||
|
* bin/whoami: print /etc/passwd info on --detail
|
||||||
|
|
||||||
|
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 06 May 2009 21:01:56 -0500
|
||||||
|
|
||||||
byobu (2.0-0ubuntu1) karmic; urgency=low
|
byobu (2.0-0ubuntu1) karmic; urgency=low
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue