mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
byobu-status, profiles/common, profiles_generator/profile.skel,
statusrc: obviate the need for separate profiles per color; read the profile colors from a config file, and use a special "color" status item to dynamically render it
This commit is contained in:
parent
8754907e05
commit
e53cdaa0a1
5 changed files with 36 additions and 23 deletions
48
byobu-status
48
byobu-status
|
@ -36,27 +36,33 @@ find_script () {
|
||||||
[ -r "$HOME/.$PKG/statusrc" ] && . "$HOME/.$PKG/statusrc"
|
[ -r "$HOME/.$PKG/statusrc" ] && . "$HOME/.$PKG/statusrc"
|
||||||
|
|
||||||
export P="$1"
|
export P="$1"
|
||||||
if [ "$P" = "--detail" ]; then
|
case "$P" in
|
||||||
VER=
|
--detail)
|
||||||
if which dpkg-query >/dev/null; then
|
VER=
|
||||||
VER=`dpkg-query --show $PKG | awk '{print "-" $2 }'`
|
if which dpkg-query >/dev/null; then
|
||||||
fi
|
VER=`dpkg-query --show $PKG | awk '{print "-" $2 }'`
|
||||||
printf "$PKG$VER Detailed Status Navigation\n Expand all - zr\t\tCollapse all - zm\n Expand one - zo\t\tCollapse one - zc\n\n"
|
fi
|
||||||
if [ -d "$HOME/.$PKG/bin" ]; then
|
printf "$PKG$VER Detailed Status Navigation\n Expand all - zr\t\tCollapse all - zm\n Expand one - zo\t\tCollapse one - zc\n\n"
|
||||||
DIR="$HOME/.$PKG/bin"
|
if [ -d "$HOME/.$PKG/bin" ]; then
|
||||||
else
|
DIR="$HOME/.$PKG/bin"
|
||||||
DIR="/usr/lib/$PKG"
|
else
|
||||||
fi
|
DIR="/usr/lib/$PKG"
|
||||||
for i in `ls "$DIR"`; do
|
fi
|
||||||
[ "$i" = "menu" ] && continue
|
for i in `ls "$DIR"`; do
|
||||||
script=`find_script $i`
|
[ "$i" = "menu" ] && continue
|
||||||
short=`$script --short | sed 's/^\s*//' | sed 's/\s*$//' | sed 's/.{[^}]*}//g'` || true
|
script=`find_script $i`
|
||||||
detail=`$script --detail | sed '/^$/d' | sed 's/^/\t/g'` || true
|
short=`$script --short | sed 's/^\s*//' | sed 's/\s*$//' | sed 's/.{[^}]*}//g'` || true
|
||||||
printf "%s\n\t(%s)\n" "$short" "$i"
|
detail=`$script --detail | sed '/^$/d' | sed 's/^/\t/g'` || true
|
||||||
[ -n "$detail" ] && printf "%s\n" "$detail"
|
printf "%s\n\t(%s)\n" "$short" "$i"
|
||||||
done
|
[ -n "$detail" ] && printf "%s\n" "$detail"
|
||||||
else
|
done
|
||||||
|
;;
|
||||||
|
color)
|
||||||
|
[ -r "$HOME/.$PKG/color" ] && . "$HOME/.$PKG/color"
|
||||||
|
[ -z "$COLOR" ] && printf "$Wk" || printf "$ESC{= $COLOR}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
eval x="\$$P" || exit 1
|
eval x="\$$P" || exit 1
|
||||||
[ "$x" = "1" ] || exit 0
|
[ "$x" = "1" ] || exit 0
|
||||||
. $(find_script "$P")
|
. $(find_script "$P")
|
||||||
fi
|
esac
|
||||||
|
|
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -16,6 +16,10 @@ byobu (2.40) unreleased; urgency=low
|
||||||
bin/whoami, bin/wifi_quality statusrc: define a set of color variables,
|
bin/whoami, bin/wifi_quality statusrc: define a set of color variables,
|
||||||
such that it's easier to make these theme-able
|
such that it's easier to make these theme-able
|
||||||
* windows/common: suggest w3m rather than elinks
|
* windows/common: suggest w3m rather than elinks
|
||||||
|
* byobu-status, profiles/common, profiles_generator/profile.skel,
|
||||||
|
statusrc: obviate the need for separate profiles per color; read the
|
||||||
|
profile colors from a config file, and use a special "color" status
|
||||||
|
item to dynamically render it
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 10 Nov 2009 10:18:20 -0600
|
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 10 Nov 2009 10:18:20 -0600
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ defutf8 on
|
||||||
# ~60 ~1 minute
|
# ~60 ~1 minute
|
||||||
backtick 10 86389 86389 byobu-janitor
|
backtick 10 86389 86389 byobu-janitor
|
||||||
backtick 11 86399 86399 printf "\005-1="
|
backtick 11 86399 86399 printf "\005-1="
|
||||||
|
backtick 12 86413 86413 byobu-status color
|
||||||
backtick 99 86011 86011 byobu-status logo
|
backtick 99 86011 86011 byobu-status logo
|
||||||
backtick 100 599 599 byobu-status release
|
backtick 100 599 599 byobu-status release
|
||||||
backtick 101 7 7 byobu-status updates_available
|
backtick 101 7 7 byobu-status updates_available
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
source /usr/share/byobu/profiles/common
|
source /usr/share/byobu/profiles/common
|
||||||
|
|
||||||
# Window tabs, second to last line
|
# Window tabs, second to last line
|
||||||
caption always "%{kW}%?%-Lw%50L>%?%{bw}%n*%f %t%?(%u)%?%{kW}%?%+Lw%?%11` %=%{= Wk}%110`%109`%122`%111`%10`%<"
|
caption always "%12`%?%-Lw%50L>%?%{=b wb}%n*%f %t%?(%u)%?%12`%?%+Lw%?%11` %=%12`%110`%109`%122`%111`%10`%<"
|
||||||
|
|
||||||
# Status string, last line
|
# Status string, last line
|
||||||
hardstatus string '%99`%{= Wk} %100`%112`%= %102`%101`%129`%127`%114`%115`%108`%128`%125`%126`%113`%119`%117`%116`%106`%104`%103`%105`%107`%123`%120`%121`'
|
hardstatus string '%99`%12` %100`%112`%= %102`%101`%129`%127`%114`%115`%108`%128`%125`%126`%113`%119`%117`%116`%106`%104`%103`%105`%107`%123`%120`%121`'
|
||||||
|
|
||||||
# NOTE: Older version of screen have an arbitrary limit of only being able
|
# NOTE: Older version of screen have an arbitrary limit of only being able
|
||||||
# to change colors 16 times in this 'hardstatus string'.
|
# to change colors 16 times in this 'hardstatus string'.
|
||||||
|
|
2
statusrc
2
statusrc
|
@ -63,6 +63,7 @@ gW="$ESC{= gW}"
|
||||||
mw="$ESC{= mw}"
|
mw="$ESC{= mw}"
|
||||||
rW="$ESC{= rW}"
|
rW="$ESC{= rW}"
|
||||||
kw="$ESC{= kw}"
|
kw="$ESC{= kw}"
|
||||||
|
kW="$ESC{= kW}"
|
||||||
ky="$ESC{= ky}"
|
ky="$ESC{= ky}"
|
||||||
kY="$ESC{= kY}"
|
kY="$ESC{= kY}"
|
||||||
wb="$ESC{= wb}"
|
wb="$ESC{= wb}"
|
||||||
|
@ -77,6 +78,7 @@ KG="$ESC{= KG}"
|
||||||
MW="$ESC{= MW}"
|
MW="$ESC{= MW}"
|
||||||
Rk="$ESC{= Rk}"
|
Rk="$ESC{= Rk}"
|
||||||
Wg="$ESC{= Wg}"
|
Wg="$ESC{= Wg}"
|
||||||
|
Wk="$ESC{= Wk}"
|
||||||
Wr="$ESC{= Wr}"
|
Wr="$ESC{= Wr}"
|
||||||
Yk="$ESC{= Yk}"
|
Yk="$ESC{= Yk}"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue