mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* 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:
parent
1a7ba6cdc6
commit
4e74effcbd
9 changed files with 68 additions and 78 deletions
11
debian/changelog
vendored
11
debian/changelog
vendored
|
@ -100,6 +100,17 @@ byobu (4.18) unreleased; urgency=low
|
|||
- prevent profile from getting sourced twice (thanks, Scott Moser)
|
||||
* usr/bin/byobu-launch: LP: #806609
|
||||
- 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 ]
|
||||
* usr/lib/byobu/.constants:
|
||||
|
|
1
debian/install
vendored
1
debian/install
vendored
|
@ -1,5 +1,4 @@
|
|||
/usr
|
||||
../../etc/byobu/socketdir etc/byobu/
|
||||
../../etc/byobu/statusrc etc/byobu/
|
||||
../../debian/source_byobu.py usr/share/apport/package-hooks
|
||||
../../debian/lintian/byobu usr/share/lintian/overrides
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
etcdir = $(datadir)/@PACKAGE@/profiles
|
||||
etc_DATA = statusrc socketdir
|
||||
etc_DATA = socketdir
|
||||
|
|
|
@ -51,59 +51,20 @@ fi
|
|||
|
||||
# Affects: First runs with no 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 "$PROFILE" ] || ln -sf $BYOBU_PREFIX/share/$PKG/profiles/common "$PROFILE"
|
||||
|
||||
# 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/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"
|
||||
[ -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"
|
||||
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
|
||||
# The status scripts used to have hyphens in their name, but now use
|
||||
|
|
|
@ -44,10 +44,9 @@ color() {
|
|||
}
|
||||
|
||||
# Source configurations
|
||||
[ -r "$BYOBU_CONFIG_DIR/color" ] && . "$BYOBU_CONFIG_DIR/color"
|
||||
[ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc"
|
||||
[ -r "$BYOBU_CONFIG_DIR/status" ] && . "$BYOBU_CONFIG_DIR/status"
|
||||
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc"
|
||||
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"
|
||||
do
|
||||
|
||||
export P="$1"
|
||||
case "$P" in
|
||||
|
|
|
@ -27,7 +27,7 @@ rm -rf "$BYOBU_RUN_DIR/status" "$BYOBU_RUN_DIR/.last"
|
|||
mkdir -p "$BYOBU_RUN_DIR/status" "$BYOBU_RUN_DIR/.last"
|
||||
|
||||
# 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"
|
||||
done
|
||||
|
||||
|
@ -40,7 +40,7 @@ while true; do
|
|||
fi
|
||||
now=$(date +%s)
|
||||
# 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"
|
||||
done
|
||||
for i in "$BYOBU_PREFIX/lib/$PKG/"*; do
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
statusdir = $(datadir)/@PACKAGE@/status
|
||||
status_DATA = 1 2 3 4
|
||||
status_DATA = 1 2 3 4 status statusrc
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# statusrc
|
||||
# Byobu's default status notifications
|
||||
# Override these in $BYOBU_CONFIG_DIR/status
|
||||
# status - Byobu's default status enabled/disabled settings
|
||||
#
|
||||
# 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>
|
||||
#
|
||||
|
@ -18,8 +20,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# BEGIN_CUT_HERE
|
||||
# Toggle status notifications
|
||||
apport=0
|
||||
arch=0
|
||||
battery=1
|
||||
|
@ -58,16 +58,3 @@ updates_available=1
|
|||
uptime=1
|
||||
whoami=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
|
33
usr/share/byobu/status/statusrc
Normal file
33
usr/share/byobu/status/statusrc
Normal 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"
|
Loading…
Add table
Add a link
Reference in a new issue