* debian/install, etc/byobu/Makefile.am, etc/byobu/statusrc =>

usr/share/byobu/status/statusrc, usr/bin/byobu-janitor,
  usr/bin/byobu-status, usr/bin/byobu-statusd,
  usr/share/byobu/status/Makefile.am, usr/share/byobu/status/status:
  - LP: #803509
  - rework usage of status and statusrc
  - status now contains the enable/disable bits for each status item
  - statusrc contains auxilliary configuration information
  - remove this stuff from /etc/byobu/statusrc altogether, and move
    it to /usr/share
  - standardize the seeding of the local user's configuration
This commit is contained in:
Dustin Kirkland 2011-07-19 13:18:06 -05:00
commit 4e74effcbd
9 changed files with 68 additions and 78 deletions

11
debian/changelog vendored
View file

@ -100,6 +100,17 @@ byobu (4.18) unreleased; urgency=low
- prevent profile from getting sourced twice (thanks, Scott Moser) - prevent profile from getting sourced twice (thanks, Scott Moser)
* usr/bin/byobu-launch: LP: #806609 * usr/bin/byobu-launch: LP: #806609
- support zsh history append - support zsh history append
* debian/install, etc/byobu/Makefile.am, etc/byobu/statusrc =>
usr/share/byobu/status/statusrc, usr/bin/byobu-janitor,
usr/bin/byobu-status, usr/bin/byobu-statusd,
usr/share/byobu/status/Makefile.am, usr/share/byobu/status/status:
- LP: #803509
- rework usage of status and statusrc
- status now contains the enable/disable bits for each status item
- statusrc contains auxilliary configuration information
- remove this stuff from /etc/byobu/statusrc altogether, and move
it to /usr/share
- standardize the seeding of the local user's configuration
[ James Spencer ] [ James Spencer ]
* usr/lib/byobu/.constants: * usr/lib/byobu/.constants:

1
debian/install vendored
View file

@ -1,5 +1,4 @@
/usr /usr
../../etc/byobu/socketdir etc/byobu/ ../../etc/byobu/socketdir etc/byobu/
../../etc/byobu/statusrc etc/byobu/
../../debian/source_byobu.py usr/share/apport/package-hooks ../../debian/source_byobu.py usr/share/apport/package-hooks
../../debian/lintian/byobu usr/share/lintian/overrides ../../debian/lintian/byobu usr/share/lintian/overrides

View file

@ -1,2 +1,2 @@
etcdir = $(datadir)/@PACKAGE@/profiles etcdir = $(datadir)/@PACKAGE@/profiles
etc_DATA = statusrc socketdir etc_DATA = socketdir

View file

@ -51,59 +51,20 @@ fi
# Affects: First runs with no configuration # Affects: First runs with no configuration
# Seed the configuration # Seed the configuration
# Setup initial local user configuration
[ -r "$BYOBU_CONFIG_DIR/color" ] || printf "BACKGROUND=k\nFOREGROUND=w\nMONOCHROME=0" > "$BYOBU_CONFIG_DIR/color" [ -r "$BYOBU_CONFIG_DIR/color" ] || printf "BACKGROUND=k\nFOREGROUND=w\nMONOCHROME=0" > "$BYOBU_CONFIG_DIR/color"
[ -r "$PROFILE" ] || ln -sf $BYOBU_PREFIX/share/$PKG/profiles/common "$PROFILE" [ -r "$BYOBU_CONFIG_DIR/profile" ] || echo "source $BYOBU_PREFIX/share/$PKG/profiles/common" > "$BYOBU_CONFIG_DIR/profile"
[ -r "$BYOBU_CONFIG_DIR/keybindings" ] || echo "source $BYOBU_PREFIX/share/$PKG/keybindings/common" > "$BYOBU_CONFIG_DIR/keybindings"
# Affects: Symlinks pointing to color profiles
if [ -h "$PROFILE" ]; then
PROFILE_FP=$($READLINK -f "$PROFILE")
case "${PROFILE_FP}" in
$BYOBU_PREFIX/share/byobu/profiles/*)
# Set default colors
BG=W
FG=k
color=${PROFILE_FP##*/}
case "$color" in
common) BG=; FG=;;
black|dark) BG=k; FG=W;;
dark_blue) BG=b; FG=W;;
dark_cyan) BG=c; FG=W;;
dark_green) BG=g; FG=W;;
dark_purple) BG=m; FG=W;;
dark_red) BG=r; FG=W;;
dark_yellow) BG=y; FG=W;;
light) BG=W; FG=k;;
light_blue) BG=B; FG=k;;
light_cyan) BG=C; FG=k;;
light_green) BG=G; FG=k;;
light_purple) BG=M; FG=k;;
light_red) BG=R; FG=k;;
light_yellow) BG=Y; FG=k;;
*) BG=W; FG=k;;
esac
if [ -n "$BG" ] && [ -n "$FG" ]; then
rm -f "$PROFILE" 2>/dev/null
byobu-select-profile -b $BG -f $FG >/dev/null 2>&1
fi
;;
esac
fi
[ -s "$BYOBU_CONFIG_DIR/keybindings" ] || echo "source $BYOBU_PREFIX/share/$PKG/keybindings/common" > "$BYOBU_CONFIG_DIR/keybindings"
if [ ! -r "$BYOBU_CONFIG_DIR/status" ]; then
if [ -r /etc/$PKG/statusrc ]; then
skel=/etc/$PKG/statusrc
elif [ -r "$BYOBU_PREFIX/share/$PKG/profiles/statusrc" ]; then
skel="$BYOBU_PREFIX/share/$PKG/profiles/statusrc"
else
skel=/dev/null
fi
grep -A 999999 BEGIN_CUT_HERE $skel | grep -B 999999 END_CUT_HERE | grep -v CUT > "$BYOBU_CONFIG_DIR/status"
# If it looks like we're running in ec2, enable ec2_cost by default
[ -x /usr/sbin/update-grub-legacy-ec2 ] && $SED -i "s/ec2_cost=.*/ec2_cost=1/" "$BYOBU_CONFIG_DIR/status"
fi
[ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows" [ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows"
[ -r "$BYOBU_CONFIG_DIR/status" ] || touch "$BYOBU_CONFIG_DIR/status"
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] || touch "$BYOBU_CONFIG_DIR/statusrc"
[ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc"
for f in status statusrc; do
if [ ! -r "$BYOBU_CONFIG_DIR/$f" ]; then
# Copy from skeleton, if possible
[ -r "/etc/$PKG/$f" ] && cp -f /etc/$PKG/$f "$BYOBU_CONFIG_DIR/$f"
fi
done
# Affects: Upgrades from <= byobu-2.11 # Affects: Upgrades from <= byobu-2.11
# The status scripts used to have hyphens in their name, but now use # The status scripts used to have hyphens in their name, but now use

View file

@ -44,10 +44,9 @@ color() {
} }
# Source configurations # Source configurations
[ -r "$BYOBU_CONFIG_DIR/color" ] && . "$BYOBU_CONFIG_DIR/color" for i in "${BYOBU_PREFIX}/share/$PKG/status/status" "${BYOBU_PREFIX}/share/$PKG/status/statusrc" "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc" "$BYOBU_CONFIG_DIR/color"; do
[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc" [ -r "$i" ] && . "$i"
[ -r "$BYOBU_CONFIG_DIR/status" ] && . "$BYOBU_CONFIG_DIR/status" do
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc"
export P="$1" export P="$1"
case "$P" in case "$P" in

View file

@ -27,7 +27,7 @@ rm -rf "$BYOBU_RUN_DIR/status" "$BYOBU_RUN_DIR/.last"
mkdir -p "$BYOBU_RUN_DIR/status" "$BYOBU_RUN_DIR/.last" mkdir -p "$BYOBU_RUN_DIR/status" "$BYOBU_RUN_DIR/.last"
# Source configurations # Source configurations
for i in "/etc/$PKG/statusrc" "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc"; do for i in "${BYOBU_PREFIX}/share/$PKG/status/status" "${BYOBU_PREFIX}/share/$PKG/status/statusrc" "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc" "$BYOBU_CONFIG_DIR/color"; do
[ -r "$i" ] && . "$i" [ -r "$i" ] && . "$i"
done done
@ -40,7 +40,7 @@ while true; do
fi fi
now=$(date +%s) now=$(date +%s)
# Re-source configuration, if changed since last run # Re-source configuration, if changed since last run
for i in "/etc/$PKG/statusrc" "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc"; do for i in "${BYOBU_PREFIX}/share/$PKG/status/status" "${BYOBU_PREFIX}/share/$PKG/status/statusrc" "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc" "$BYOBU_CONFIG_DIR/color"; do
[ -r "$i" ] && [ "$i" -nt "$BYOBU_RUN_DIR/status" ] && . "$i" [ -r "$i" ] && [ "$i" -nt "$BYOBU_RUN_DIR/status" ] && . "$i"
done done
for i in "$BYOBU_PREFIX/lib/$PKG/"*; do for i in "$BYOBU_PREFIX/lib/$PKG/"*; do

View file

@ -1,2 +1,2 @@
statusdir = $(datadir)/@PACKAGE@/status statusdir = $(datadir)/@PACKAGE@/status
status_DATA = 1 2 3 4 status_DATA = 1 2 3 4 status statusrc

View file

@ -1,8 +1,10 @@
# statusrc # status - Byobu's default status enabled/disabled settings
# Byobu's default status notifications
# Override these in $BYOBU_CONFIG_DIR/status
# #
# Copyright (C) 2009 Canonical Ltd. # Override these in $BYOBU_CONFIG_DIR/status
# where BYOBU_CONFIG_DIR is XDG_CONFIG_HOME if defined,
# and $HOME/.byobu otherwise.
#
# Copyright (C) 2009-2011 Canonical Ltd.
# #
# Authors: Dustin Kirkland <kirkland@ubuntu.com> # Authors: Dustin Kirkland <kirkland@ubuntu.com>
# #
@ -18,8 +20,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# BEGIN_CUT_HERE
# Toggle status notifications
apport=0 apport=0
arch=0 arch=0
battery=1 battery=1
@ -58,16 +58,3 @@ updates_available=1
uptime=1 uptime=1
whoami=1 whoami=1
wifi_quality=1 wifi_quality=1
# Configurations that you can override; if you leave these commented out,
# Byobu will auto-detect them.
#LOGO="\o/"
#MONITORED_DISK=/
#DISK_IO_THRESHOLD=50
#MONITORED_INTERFACE=eth0
#NETWORK_THRESHOLD=20
#MONITORED_TEMP=/proc/acpi/thermal_zone/THM0/temperature
#TEMP=F
#DISTRO=Ubuntu
#SERVICES="eucalyptus-nc|NC eucalyptus-cloud|CLC eucalyptus-walrus eucalyptus-cc|CC eucalyptus-sc|SC"
# END_CUT_HERE

View file

@ -0,0 +1,33 @@
# statusrc - Byobu's default status configurations
#
# Override these in $BYOBU_CONFIG_DIR/statusrc
# where BYOBU_CONFIG_DIR is XDG_CONFIG_HOME if defined,
# and $HOME/.byobu otherwise.
#
# Copyright (C) 2009-2011 Canonical Ltd.
#
# Authors: Dustin Kirkland <kirkland@ubuntu.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Configurations that you can override; if you leave these commented out,
# Byobu will try to auto-detect them.
#LOGO="\o/"
#MONITORED_DISK=/
#DISK_IO_THRESHOLD=50
#MONITORED_INTERFACE=eth0
#NETWORK_THRESHOLD=20
#MONITORED_TEMP=/proc/acpi/thermal_zone/THM0/temperature
#TEMP=F
#DISTRO=Ubuntu
#SERVICES="eucalyptus-nc|NC eucalyptus-cloud|CLC eucalyptus-walrus eucalyptus-cc|CC eucalyptus-sc|SC"