* usr/bin/byobu-janitor, usr/share/byobu/profiles/common: LP: #823581

- when a status item is disabled, remove the backtick command entirely
    from the current screen configuration;  this *drastically* reduces
    the number of no-op byobu-status calls (60+ per minute, per session)
This commit is contained in:
Dustin Kirkland 2011-08-11 10:25:46 -05:00
commit 11f3d1e7c5
3 changed files with 20 additions and 1 deletions

4
debian/changelog vendored
View file

@ -10,6 +10,10 @@ byobu (4.29) unreleased; urgency=low
- back and forth, back and forth on this color issue; - back and forth, back and forth on this color issue;
the previous version looked terrible (too bold) on stock the previous version looked terrible (too bold) on stock
Ubuntu/gnome-terminal Ubuntu/gnome-terminal
* usr/bin/byobu-janitor, usr/share/byobu/profiles/common: LP: #823581
- when a status item is disabled, remove the backtick command entirely
from the current screen configuration; this *drastically* reduces
the number of no-op byobu-status calls (60+ per minute, per session)
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 10 Aug 2011 18:24:27 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 10 Aug 2011 18:24:27 -0500

View file

@ -23,9 +23,22 @@ PKG="byobu"
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
. "${BYOBU_PREFIX}/lib/${PKG}/.common" . "${BYOBU_PREFIX}/lib/${PKG}/.common"
FLAG="$BYOBU_RUN_DIR/reload-required" # Source configurations and disable unused backticks
for i in "$BYOBU_PREFIX/share/$PKG/status/status" "$BYOBU_CONFIG_DIR/status"; do
[ -r "$i" ] && . "$i"
done
rm -f "$BYOBU_CONFIG_DIR/backticks"
for i in "$BYOBU_PREFIX/lib/$PKG/"*; do
i=${i##*/}
eval x="\$$i" || true
if [ "$x" != "1" ]; then
num=$(grep "^backtick.*byobu-status $i$" "$BYOBU_PREFIX/share/$PKG/profiles/common" | awk '{print $2}')
[ -n "$num" ] && echo "backtick $num # $i" >> "$BYOBU_CONFIG_DIR/backticks"
fi
done
# Exit immediately, if we're not forced, and there is no reload flag # Exit immediately, if we're not forced, and there is no reload flag
FLAG="$BYOBU_RUN_DIR/reload-required"
if [ "$1" != "--force" ] && [ ! -e "$FLAG" ]; then if [ "$1" != "--force" ] && [ ! -e "$FLAG" ]; then
exit 0 exit 0
fi fi
@ -52,6 +65,7 @@ fi
[ -r "$BYOBU_CONFIG_DIR/profile.tmux" ] || echo "source-file $BYOBU_PREFIX/share/$PKG/profiles/tmux" > "$BYOBU_CONFIG_DIR/profile.tmux" [ -r "$BYOBU_CONFIG_DIR/profile.tmux" ] || echo "source-file $BYOBU_PREFIX/share/$PKG/profiles/tmux" > "$BYOBU_CONFIG_DIR/profile.tmux"
[ -r "$BYOBU_CONFIG_DIR/keybindings" ] || echo "source $BYOBU_PREFIX/share/$PKG/keybindings/common" > "$BYOBU_CONFIG_DIR/keybindings" [ -r "$BYOBU_CONFIG_DIR/keybindings" ] || echo "source $BYOBU_PREFIX/share/$PKG/keybindings/common" > "$BYOBU_CONFIG_DIR/keybindings"
[ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows" [ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows"
[ -r "$BYOBU_CONFIG_DIR/backticks" ] || touch "$BYOBU_CONFIG_DIR/backticks"
[ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc"
for f in status statusrc; do for f in status statusrc; do
if [ ! -r "$BYOBU_CONFIG_DIR/$f" ]; then if [ ! -r "$BYOBU_CONFIG_DIR/$f" ]; then

View file

@ -124,3 +124,4 @@ hardstatus string '%99`%{-}%{=r}%12` %100`%112`%=%117`%133`%130`%135`%102`%101`%
# * http://savannah.gnu.org/bugs/?22146 # * http://savannah.gnu.org/bugs/?22146
source $BYOBU_CONFIG_DIR/keybindings source $BYOBU_CONFIG_DIR/keybindings
source $BYOBU_CONFIG_DIR/backticks