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:
Dustin Kirkland 2009-11-23 23:19:09 -06:00
commit e53cdaa0a1
5 changed files with 36 additions and 23 deletions

View file

@ -36,7 +36,8 @@ 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
--detail)
VER= VER=
if which dpkg-query >/dev/null; then if which dpkg-query >/dev/null; then
VER=`dpkg-query --show $PKG | awk '{print "-" $2 }'` VER=`dpkg-query --show $PKG | awk '{print "-" $2 }'`
@ -55,8 +56,13 @@ if [ "$P" = "--detail" ]; then
printf "%s\n\t(%s)\n" "$short" "$i" printf "%s\n\t(%s)\n" "$short" "$i"
[ -n "$detail" ] && printf "%s\n" "$detail" [ -n "$detail" ] && printf "%s\n" "$detail"
done done
else ;;
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
View file

@ -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

View file

@ -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

View file

@ -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'.

View file

@ -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}"