From 11f3d1e7c54083de41c7539d630f1ff926a5baae Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 11 Aug 2011 10:25:46 -0500 Subject: [PATCH] * 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) --- debian/changelog | 4 ++++ usr/bin/byobu-janitor | 16 +++++++++++++++- usr/share/byobu/profiles/common | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 97b1cc09..7d9e75e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,10 @@ byobu (4.29) unreleased; urgency=low - back and forth, back and forth on this color issue; the previous version looked terrible (too bold) on stock 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 Wed, 10 Aug 2011 18:24:27 -0500 diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index a5310047..b5e60a39 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -23,9 +23,22 @@ PKG="byobu" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${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 +FLAG="$BYOBU_RUN_DIR/reload-required" if [ "$1" != "--force" ] && [ ! -e "$FLAG" ]; then exit 0 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/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/backticks" ] || touch "$BYOBU_CONFIG_DIR/backticks" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" for f in status statusrc; do if [ ! -r "$BYOBU_CONFIG_DIR/$f" ]; then diff --git a/usr/share/byobu/profiles/common b/usr/share/byobu/profiles/common index d8c4468c..06878022 100644 --- a/usr/share/byobu/profiles/common +++ b/usr/share/byobu/profiles/common @@ -124,3 +124,4 @@ hardstatus string '%99`%{-}%{=r}%12` %100`%112`%=%117`%133`%130`%135`%102`%101`% # * http://savannah.gnu.org/bugs/?22146 source $BYOBU_CONFIG_DIR/keybindings +source $BYOBU_CONFIG_DIR/backticks