From 83f0acdb40921098ae24a82b2ba9ae0e58dd4c54 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 29 Jun 2011 00:27:50 +0000 Subject: [PATCH] * debian/postinst, etc/byobu/socketdir, experimental/byobu-aggregate- status, experimental/byobu-status-all, === modified symlink usr/share/byobu/keybindings/common, === target was uf-keys, usr/bin/byobu, usr/bin/byobu-config, usr/bin/byobu-ctrl-a, usr/bin/byobu-disable, usr/bin/byobu-enable, usr/bin/byobu-export, usr/bin/byobu-janitor, usr/bin/byobu-launch, usr/bin/byobu-launcher, usr/bin/byobu-launcher-install, usr/bin/byobu-launcher-uninstall, usr/bin/byobu-quiet, usr/bin/byobu-reconnect-sockets, usr/bin/byobu- select-profile, usr/bin/byobu-shell, usr/bin/byobu-silent, usr/bin/byobu-status, usr/bin/byobu-status-detail, usr/bin/byobu- ugraph, usr/bin/byobu-ulevel, usr/lib/byobu/.common, usr/lib/byobu/.constants, usr/lib/byobu/custom, usr/lib/byobu/disk_io, usr/lib/byobu/ec2_cost, usr/lib/byobu/ip_address, usr/lib/byobu/logo, usr/lib/byobu/Makefile.am, usr/lib/byobu/mem_available, usr/lib/byobu/menu, usr/lib/byobu/network, usr/lib/byobu/.notify_osd, usr/lib/byobu/reboot_required, usr/lib/byobu/services, usr/lib/byobu/.shutil, usr/lib/byobu/updates_available, usr/share/byobu/keybindings/f-keys, usr/share/byobu/profiles/common, usr/share/man/man1/byobu.1, usr/share/man/man1/byobu-select-session.1: LP: #802122 - massive reworking to globalize and standardize the use of + BYOBU_RUN_DIR, which is typically /var/run/screen/S-$USER/byobu + BYOBU_CONFIG_DIR, which is typically $HOME/.byobu - this rework should more easily allow us to support users who's SOCKETDIR is not /var/run/screen, and XDG_USER_DIRS users --- debian/changelog | 26 +++++++ debian/postinst | 13 ++-- etc/byobu/socketdir | 3 +- experimental/byobu-aggregate-status | 8 +-- experimental/byobu-status-all | 4 +- usr/bin/byobu | 25 +++---- usr/bin/byobu-config | 34 +++++----- usr/bin/byobu-ctrl-a | 4 +- usr/bin/byobu-disable | 4 ++ usr/bin/byobu-enable | 4 ++ usr/bin/byobu-export | 4 ++ usr/bin/byobu-janitor | 69 ++++++++----------- usr/bin/byobu-launch | 7 +- usr/bin/byobu-launcher | 7 +- usr/bin/byobu-launcher-install | 8 ++- usr/bin/byobu-launcher-uninstall | 7 +- usr/bin/byobu-quiet | 6 +- usr/bin/byobu-reconnect-sockets | 4 +- usr/bin/byobu-select-profile | 15 ++-- usr/bin/byobu-shell | 5 +- usr/bin/byobu-silent | 6 +- usr/bin/byobu-status | 10 +-- usr/bin/byobu-status-detail | 4 ++ usr/bin/byobu-ugraph | 4 ++ usr/bin/byobu-ulevel | 4 ++ usr/lib/byobu/.common | 22 ++++++ usr/lib/byobu/.constants | 25 +++++-- usr/lib/byobu/.notify_osd | 2 +- usr/lib/byobu/.shutil | 4 +- usr/lib/byobu/Makefile.am | 2 +- usr/lib/byobu/custom | 4 +- usr/lib/byobu/disk_io | 4 +- usr/lib/byobu/ec2_cost | 2 +- usr/lib/byobu/ip_address | 2 +- usr/lib/byobu/logo | 4 +- usr/lib/byobu/mem_available | 2 +- usr/lib/byobu/menu | 2 +- usr/lib/byobu/network | 6 +- usr/lib/byobu/reboot_required | 2 +- usr/lib/byobu/services | 2 +- usr/lib/byobu/updates_available | 2 +- usr/share/byobu/keybindings/common | 83 ++++++++++++++++++++++- usr/share/byobu/keybindings/f-keys | 6 +- usr/share/byobu/profiles/common | 2 +- usr/share/man/man1/byobu-select-session.1 | 6 +- usr/share/man/man1/byobu.1 | 36 +++++----- 46 files changed, 332 insertions(+), 173 deletions(-) create mode 100644 usr/lib/byobu/.common mode change 120000 => 100644 usr/share/byobu/keybindings/common diff --git a/debian/changelog b/debian/changelog index 7b79fde0..217adf71 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,32 @@ byobu (4.17) unreleased; urgency=low - fix temperature on Atom D510 * usr/bin/byobu-status: - deprecated RUNDIR + * debian/postinst, etc/byobu/socketdir, experimental/byobu-aggregate- + status, experimental/byobu-status-all, === modified symlink + usr/share/byobu/keybindings/common, === target was uf-keys, + usr/bin/byobu, usr/bin/byobu-config, usr/bin/byobu-ctrl-a, + usr/bin/byobu-disable, usr/bin/byobu-enable, usr/bin/byobu-export, + usr/bin/byobu-janitor, usr/bin/byobu-launch, usr/bin/byobu-launcher, + usr/bin/byobu-launcher-install, usr/bin/byobu-launcher-uninstall, + usr/bin/byobu-quiet, usr/bin/byobu-reconnect-sockets, usr/bin/byobu- + select-profile, usr/bin/byobu-shell, usr/bin/byobu-silent, + usr/bin/byobu-status, usr/bin/byobu-status-detail, usr/bin/byobu- + ugraph, usr/bin/byobu-ulevel, usr/lib/byobu/.common, + usr/lib/byobu/.constants, usr/lib/byobu/custom, + usr/lib/byobu/disk_io, usr/lib/byobu/ec2_cost, + usr/lib/byobu/ip_address, usr/lib/byobu/logo, + usr/lib/byobu/Makefile.am, usr/lib/byobu/mem_available, + usr/lib/byobu/menu, usr/lib/byobu/network, + usr/lib/byobu/.notify_osd, usr/lib/byobu/reboot_required, + usr/lib/byobu/services, usr/lib/byobu/.shutil, + usr/lib/byobu/updates_available, usr/share/byobu/keybindings/f-keys, + usr/share/byobu/profiles/common, usr/share/man/man1/byobu.1, + usr/share/man/man1/byobu-select-session.1: LP: #802122 + - massive reworking to globalize and standardize the use of + + BYOBU_RUN_DIR, which is typically /var/run/screen/S-$USER/byobu + + BYOBU_CONFIG_DIR, which is typically $HOME/.byobu + - this rework should more easily allow us to support users who's + SOCKETDIR is not /var/run/screen, and XDG_USER_DIRS users -- Dustin Kirkland Mon, 27 Jun 2011 14:14:17 +0000 diff --git a/debian/postinst b/debian/postinst index c3abd8a4..80eec740 100644 --- a/debian/postinst +++ b/debian/postinst @@ -25,13 +25,14 @@ fi rm -f /etc/update-motd.d/55-window-manager # Notify users that they should reload their profile -DIR="/var/run/screen" -if [ -d "$DIR" ]; then - for d in "$DIR"/*; do +[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" +if [ -d "$SOCKETDIR" ]; then + for d in "$DIR"/*/"$PKG"; do [ -d "$d" ] || continue - touch "$d/$PKG.reload-required" - chown --reference "$d" "$d/$PKG.reload-required" || true - chmod 700 "$d/$PKG.reload-required" + flag="$d/reload-required" + touch "$flag" + chown --reference "$d" "$flag" || true + chmod 700 "$flag" done fi diff --git a/etc/byobu/socketdir b/etc/byobu/socketdir index e3596a24..7ceb0209 100644 --- a/etc/byobu/socketdir +++ b/etc/byobu/socketdir @@ -1,6 +1,7 @@ # Set the location of the socket directory that byobu will use. # On Debian/Ubuntu systems, this is in /var/run/screen, but on -# other distros, it might be elsewhere, such as /tmp +# other distros, it might be elsewhere, such as /tmp/screens +# depending on your screen compilation. # # This file will be sourced by both shell scripts and python code, # so please ensure that: diff --git a/experimental/byobu-aggregate-status b/experimental/byobu-aggregate-status index 3fc62c82..08ae0831 100755 --- a/experimental/byobu-aggregate-status +++ b/experimental/byobu-aggregate-status @@ -1,8 +1,6 @@ #!/bin/sh PKG="byobu" -RUN="/var/run/screen/S-$USER" -mkdir -p "$RUN/$PKG" hput() { eval "$1""$2"='$3' @@ -57,8 +55,8 @@ hput freq wifi_quality 17 NOW=$(date +%s) for i in /usr/lib/$PKG/*; do j=${i##*/} - #byobu-status "$j" > "$RUN/$PKG/$j.status" - CACHE="$RUN/$PKG/$j.status" + #byobu-status "$j" > "$BYOBU_RUN_DIR/$j.status" + CACHE="$BYOBU_RUN_DIR/$j.status" [ -r "$CACHE.last" ] && read lastrun < "$CACHE.last" || lastrun=0 freq=$(hget freq $j) expiration=$(($lastrun+$freq)) @@ -69,6 +67,6 @@ for i in /usr/lib/$PKG/*; do done # Print -sed -e ':a;N;$!ba;s/\n//g' "$RUN/$PKG/"*.status > "$RUN/$PKG.status" +sed -e ':a;N;$!ba;s/\n//g' "$BYOBU_RUN_DIR/"*.status > "$BYOBU_RUN_DIR/status" # vi: syntax=sh ts=4 noexpandtab diff --git a/experimental/byobu-status-all b/experimental/byobu-status-all index b68aec56..35e800fe 100755 --- a/experimental/byobu-status-all +++ b/experimental/byobu-status-all @@ -4,7 +4,7 @@ LIBDIR=/home/kirkland/src/byobu/byobu/usr/lib/byobu . "$LIBDIR/.constants" . "$LIBDIR/.shutil" -mkdir -p "$CACHE_DIR/status" +mkdir -p "$BYOBU_RUN_DIR/status" for i in "$LIBDIR/"*; do case "$i" in */Makefile.am) @@ -18,7 +18,7 @@ for i in "$LIBDIR/"*; do . "$i" j=${i##*/} #printf "Running [__$j]...[" - eval "__$j" > "$CACHE_DIR/status/$j" + eval "__$j" > "$BYOBU_RUN_DIR/status/$j" #printf "]\n" ;; esac diff --git a/usr/bin/byobu b/usr/bin/byobu index 5bbf74c9..f38aa829 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -17,20 +17,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -PKG="byobu" VERSION=4.17 -[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr" -export BYOBU_PREFIX -[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" -RUN="$SOCKETDIR/S-$USER" -DATA="$HOME/.$PKG" +PKG="byobu" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/.shutil" -if [ ! -x "$BYOBU_PREFIX/bin/$PKG" ]; then - error "Cannot find $BYOBU_PREFIX/bin/$PKG" - error "If you have installed it elsewhere, export BYOBU_PREFIX in your shell" - exit 1 -fi +. "${BYOBU_PREFIX}/lib/${PKG}/.constants" + # Add a version argument for debugging purposes if [ "$#" = "1" ]; then @@ -44,7 +37,7 @@ if [ "$#" = "1" ]; then fi # Check if we're being autolaunched, and this user explicitly does not want it. -if [ "$0" = "/etc/profile.d/Z98-$PKG.sh" ] && [ -r "$DATA/disable-autolaunch" ]; then +if [ "$0" = "/etc/profile.d/Z98-$PKG.sh" ] && [ -r "$BYOBU_CONFIG_DIR/disable-autolaunch" ]; then exit 0 fi @@ -58,11 +51,11 @@ byobu-janitor --force CUSTOM_WINDOW_SET=0 if [ -r "$BYOBU_WINDOWS" ]; then CUSTOM_WINDOW_SET=1 -elif [ -r "$DATA/windows.$BYOBU_WINDOWS" ]; then +elif [ -r "$BYOBU_CONFIG_DIR/windows.$BYOBU_WINDOWS" ]; then CUSTOM_WINDOW_SET=1 - BYOBU_WINDOWS="$DATA/windows.$BYOBU_WINDOWS" + BYOBU_WINDOWS="$BYOBU_CONFIG_DIR/windows.$BYOBU_WINDOWS" elif [ "$#" = "0" ]; then - BYOBU_WINDOWS="$DATA/windows" + BYOBU_WINDOWS="$BYOBU_CONFIG_DIR/windows" else BYOBU_WINDOWS="/dev/null" fi @@ -80,7 +73,7 @@ fi # Drop a symlink to the ssh socket in $HOME, since we can ensure that exists if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then - ln -sf "$SSH_AUTH_SOCK" "$DATA/.ssh-agent" + ln -sf "$SSH_AUTH_SOCK" "$BYOBU_CONFIG_DIR/.ssh-agent" fi # Some users want to maintain a separate ~/.byoburc from ~/.screenrc, diff --git a/usr/bin/byobu-config b/usr/bin/byobu-config index dc0b5860..f023850e 100755 --- a/usr/bin/byobu-config +++ b/usr/bin/byobu-config @@ -29,17 +29,17 @@ from snack import * PKG="byobu" HOME=os.getenv("HOME") USER=os.getenv("USER") +BYOBU_CONFIG_DIR=os.getenv("BYOBU_CONFIG_DIR") if os.getenv("BYOBU_PREFIX"): PREFIX = os.getenv("BYOBU_PREFIX") else: PREFIX = "/usr" SHARE=PREFIX+'/share/'+PKG DOC=PREFIX+'/share/doc/'+PKG -DATA=HOME+"/."+PKG if not os.path.exists(SHARE): - SHARE = DATA+"/"+SHARE + SHARE = BYOBU_CONFIG_DIR+"/"+SHARE if not os.path.exists(DOC): - DOC = DATA+"/"+DOC + DOC = BYOBU_CONFIG_DIR+"/"+DOC DEF_ESC="A" RELOAD = "If you are using the default set of keybindings, press\n or to activate these changes.\n\nOtherwise, exit this screen session and start a new one." SOCKETDIR="/var/run/screen" @@ -48,8 +48,8 @@ if os.path.exists("/etc/%s/socketdir" % PKG): execfile(i) except: SOCKETDIR="/var/run/screen" -RELOAD_FLAG="%s/S-%s/%s.reload-required" % (SOCKETDIR, USER, PKG) -RELOAD_CMD="screen -X at 0 source "+DATA+"/profile" +RELOAD_FLAG="%s/reload-required" % (BYOBU_CONFIG_DIR) +RELOAD_CMD="screen -X at 0 source "+BYOBU_CONFIG_DIR+"/profile" ESC = '' snack.hotkeys[ESC] = ord(ESC) snack.hotkeys[ord(ESC)] = ESC @@ -193,7 +193,7 @@ def keybindings(screen, size): return 100 def switch_keybindings(set): - commands.getoutput(SED + " -i -e 's:^source .*$:source "+SHARE+"/keybindings/"+set+":' "+DATA+"/keybindings") + commands.getoutput(SED + " -i -e 's:^source .*$:source "+SHARE+"/keybindings/"+set+":' "+BYOBU_CONFIG_DIR+"/keybindings") def newwindow(screen, size): title=Entry(8, text="shell", returnExit=1) @@ -255,7 +255,7 @@ def newwindow(screen, size): return 100 def appendwindow(win): - f=open(DATA+'/windows', 'a') + f=open(BYOBU_CONFIG_DIR+'/windows', 'a') try: f.write(win+"\n") @@ -266,12 +266,12 @@ def appendwindow(win): f.close() def readwindows(): - if not os.path.isfile(DATA+'/windows'): + if not os.path.isfile(BYOBU_CONFIG_DIR+'/windows'): windowsfile=SHARE+'/windows/common' - elif os.path.getsize(DATA+'/windows') == 0: + elif os.path.getsize(BYOBU_CONFIG_DIR+'/windows') == 0: windowsfile=SHARE+'/windows/common' else: - windowsfile=DATA+'/windows' + windowsfile=BYOBU_CONFIG_DIR+'/windows' f=open(windowsfile) try: li=[] @@ -333,8 +333,8 @@ def readstatus(): status["uptime"]=1 status["whoami"]=1 status["wifi_quality"]=1 - if os.path.exists(DATA+'/status'): - f=open(DATA+'/status', 'r') + if os.path.exists(BYOBU_CONFIG_DIR+'/status'): + f=open(BYOBU_CONFIG_DIR+'/status', 'r') for line in f.readlines(): try: line = line.rstrip() @@ -353,7 +353,7 @@ def readstatus(): return li def writestatus(items): - f=open(DATA+'/status', 'w') + f=open(BYOBU_CONFIG_DIR+'/status', 'w') try: for i in items: if i[0] == 1: @@ -390,7 +390,7 @@ def togglestatus(screen, size): return 100 def writewindows(winlist): - f=open(DATA+'/windows', 'w') + f=open(BYOBU_CONFIG_DIR+'/windows', 'w') try: for win in winlist: if win[0] == -1: @@ -459,7 +459,7 @@ def appendtofile(p, s): def getesckey(): - path=DATA+'/keybindings' + path=BYOBU_CONFIG_DIR+'/keybindings' if not os.path.exists(path): return DEF_ESC line = commands.getoutput("grep ^escape "+path) @@ -471,7 +471,7 @@ def getesckey(): return esc def setesckey(key): - path = DATA+'/keybindings' + path = BYOBU_CONFIG_DIR+'/keybindings' if key != "": if key == " ": key = "`" @@ -525,7 +525,7 @@ def chgesc(screen, size): return 100 def autolaunch(): - if os.path.exists(DATA+"/disable-autolaunch"): + if os.path.exists(BYOBU_CONFIG_DIR+"/disable-autolaunch"): return 0 if commands.getstatusoutput('grep -qs byobu-launch %s/.profile' % HOME)[0] == 0: return 1 diff --git a/usr/bin/byobu-ctrl-a b/usr/bin/byobu-ctrl-a index 9e8161ea..53d48d50 100755 --- a/usr/bin/byobu-ctrl-a +++ b/usr/bin/byobu-ctrl-a @@ -17,8 +17,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - PKG="byobu" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + keybindings="$HOME/.$PKG/keybindings" touch "$keybindings" diff --git a/usr/bin/byobu-disable b/usr/bin/byobu-disable index e5cb3f1e..8f954017 100755 --- a/usr/bin/byobu-disable +++ b/usr/bin/byobu-disable @@ -17,6 +17,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +PKG="byobu" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + byobu-launcher-uninstall echo diff --git a/usr/bin/byobu-enable b/usr/bin/byobu-enable index 30a1ae13..8c9483e8 100755 --- a/usr/bin/byobu-enable +++ b/usr/bin/byobu-enable @@ -17,6 +17,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +PKG="byobu" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + byobu-launcher-install echo diff --git a/usr/bin/byobu-export b/usr/bin/byobu-export index 92fd9196..c5080607 100755 --- a/usr/bin/byobu-export +++ b/usr/bin/byobu-export @@ -17,6 +17,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +PKG="byobu" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + gettext " The byobu-export utility is now deprecated. diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 993f26b9..d0d2a752 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -20,20 +20,19 @@ # along with this program. If not, see . PKG="byobu" -DATA="$HOME/.$PKG" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + XDG="$HOME/.local/share/$PKG" -[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr" -[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" -RUN="$SOCKETDIR/S-$USER" -FLAG="$RUN/$PKG.reload-required" +FLAG="$BYOBU_RUN_DIR/reload-required" # Let's get prepped to switch over to XDG one day; maintain symlink for now mkdir -p "$XDG" -if [ ! -h "$DATA" ]; then - mv -f "$DATA"/* "$DATA"/.* "$XDG" 2>/dev/null || true - rmdir "$DATA" 2>/dev/null || true +if [ ! -h "$BYOBU_CONFIG_DIR" ]; then + mv -f "$BYOBU_CONFIG_DIR"/* "$BYOBU_CONFIG_DIR"/.* "$XDG" 2>/dev/null || true + rmdir "$BYOBU_CONFIG_DIR" 2>/dev/null || true fi -ln -sf "$XDG" "$DATA" +ln -sf "$XDG" "$BYOBU_CONFIG_DIR" # Exit immediately, if we're not forced, and there is no reload flag if [ "$1" != "--force" ] && [ ! -e "$FLAG" ]; then @@ -42,26 +41,24 @@ fi # Set the rest of the variables DEFAULT_PROFILE="light" -PROFILE="$DATA/profile" +PROFILE="$BYOBU_CONFIG_DIR/profile" # Use gsed on non-Linux OS's command -v gsed >/dev/null && SED="gsed" || SED="sed" command -v greadlink >/dev/null && READLINK="greadlink" || READLINK="readlink" # Create byobu-exchange buffer file, with secure permissions, if it doesn't exist -if [ -w "$RUN" ] && [ ! -e "$RUN/$PKG-exchange" ]; then - install -m 600 /dev/null "$RUN/$PKG-exchange" -fi +[ -e "$BYOBU_RUN_DIR/printscreen" ] || install -m 600 /dev/null "$BYOBU_RUN_DIR/printscreen" # Affects: users who launched using sudo, such that their config dir # is not writable by them -if [ -d "$DATA" ] && [ ! -w "$DATA" ]; then - echo "ERROR: [$DATA] is not writable by the current user" 1>&2 +if [ -d "$BYOBU_CONFIG_DIR" ] && [ ! -w "$BYOBU_CONFIG_DIR" ]; then + echo "ERROR: [$BYOBU_CONFIG_DIR] is not writable by the current user" 1>&2 exit 1 fi # Affects: First runs with no configuration # Seed the configuration -[ -r "$DATA/color" ] || printf "BACKGROUND=k\nFOREGROUND=w\nMONOCHROME=0" > "$DATA/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" # Affects: Symlinks pointing to color profiles @@ -99,8 +96,8 @@ if [ -h "$PROFILE" ]; then esac fi -[ -s "$DATA/keybindings" ] || echo "source $BYOBU_PREFIX/share/$PKG/keybindings/common" > "$DATA/keybindings" -if [ ! -r "$DATA/status" ]; then +[ -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 @@ -108,20 +105,20 @@ if [ ! -r "$DATA/status" ]; then else skel=/dev/null fi - grep -A 999999 BEGIN_CUT_HERE $skel | grep -B 999999 END_CUT_HERE | grep -v CUT > "$DATA/status" + 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/" "$DATA/status" + [ -x /usr/sbin/update-grub-legacy-ec2 ] && sed -i "s/ec2_cost=.*/ec2_cost=1/" "$BYOBU_CONFIG_DIR/status" fi -[ -r "$DATA/windows" ] || touch "$DATA/windows" +[ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" # Affects: Upgrades from <= byobu-2.11 # The status scripts used to have hyphens in their name, but now use # underscores such that we can source the file as a shell snippet; # fix existing status configuration. -$SED -i -e "s/\([^=]+\)-\([^=]+\)=/\1_\2=/g" "$DATA/status" -$SED -i -e "s/^disk-.*=/disk=/" "$DATA/status" -$SED -i -e "s/^network-.*=/network=/" "$DATA/status" +$SED -i -e "s/\([^=]+\)-\([^=]+\)=/\1_\2=/g" "$BYOBU_CONFIG_DIR/status" +$SED -i -e "s/^disk-.*=/disk=/" "$BYOBU_CONFIG_DIR/status" +$SED -i -e "s/^network-.*=/network=/" "$BYOBU_CONFIG_DIR/status" # Affects: Upgrades from <= byobu-2.16 # screen-launcher was renamed byobu-launcher; if the user has byobu @@ -133,8 +130,8 @@ fi # Affects: Upgrades from <= byobu-2.25 # Collapse separate status config files into the sourced config for i in disk network distro logo; do - if [ -r "$DATA/$i" ]; then - val=`cat $DATA/$i` + if [ -r "$BYOBU_CONFIG_DIR/$i" ]; then + val=`cat $BYOBU_CONFIG_DIR/$i` uc=`echo "$i" | tr "[:lower:]" "[:upper:]"` case $i in disk|network) @@ -142,8 +139,8 @@ for i in disk network distro logo; do distro|logo) key="$uc" ;; esac - echo "$key=\"$val\"" >> "$DATA/statusrc" - rm "$DATA/$i" + echo "$key=\"$val\"" >> "$BYOBU_CONFIG_DIR/statusrc" + rm "$BYOBU_CONFIG_DIR/$i" fi done @@ -161,22 +158,16 @@ fi # Affects: Upgrades from <= byobu-2.78 which might have "motd+shell" # in their window list; update this to just "shell" -if grep -qs "motd+shell" "$DATA/windows"; then - $SED -i -e "s/motd+shell/shell/g" "$DATA/windows" || true -fi - -# Affects: Upgrades from <= byobu-3.6, change location of $SSH_AUTH_SOCK -if [ -h "$RUN/$PKG.ssh-agent" ]; then - rm -f "$DATA/.ssh-agent" - mv -f "$RUN/$PKG.ssh-agent" "$DATA/.ssh-agent" +if grep -qs "motd+shell" "$BYOBU_CONFIG_DIR/windows"; then + $SED -i -e "s/motd+shell/shell/g" "$BYOBU_CONFIG_DIR/windows" || true fi # Affects: Upgrades from <= byobu 4.3, remove ec2_rates -rm -f "$DATA/ec2_rates" +rm -f "$BYOBU_CONFIG_DIR/ec2_rates" # Affects: Upgrades from <= byobu 4.4, update "shell" -> "byobu-shell" -if grep -qs " shell$" "$DATA/windows"; then - $SED -i -e "s/ shell$/ $PKG-shell/g" "$DATA/windows" || true +if grep -qs " shell$" "$BYOBU_CONFIG_DIR/windows"; then + $SED -i -e "s/ shell$/ $PKG-shell/g" "$BYOBU_CONFIG_DIR/windows" || true fi # Clean up flag diff --git a/usr/bin/byobu-launch b/usr/bin/byobu-launch index d1095c95..ee9ceee0 100755 --- a/usr/bin/byobu-launch +++ b/usr/bin/byobu-launch @@ -18,7 +18,8 @@ # along with this program. If not, see . PKG="byobu" -DATA="$HOME/.$PKG" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" # Respect an environment variable passable over SSH to disable # Byobu launch. This put that configurability on the SSH client, @@ -44,9 +45,9 @@ if [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_DISABLE" != "1" ]; then if byobu-launcher; then # Wait very briefly for the no-logout flag to get written? sleep 0.1 - if [ -e "$DATA/no-logout-on-detach" ] || [ -e "/var/run/screen/S-$USER/byobu.no-logout" ]; then + if [ -e "$BYOBU_CONFIG_DIR/no-logout-on-detach" ] || [ -e "$BYOBU_RUN_DIR/no-logout" ]; then # The user does not want to logout on byobu detach - rm -f "/var/run/screen/S-$USER/byobu.no-logout" # Remove one-time no-logout flag, if it exists + rm -f "$BYOBU_RUN_DIR/no-logout" # Remove one-time no-logout flag, if it exists true else exit 0 diff --git a/usr/bin/byobu-launcher b/usr/bin/byobu-launcher index 12367bfc..0ec841cc 100755 --- a/usr/bin/byobu-launcher +++ b/usr/bin/byobu-launcher @@ -18,11 +18,10 @@ # along with this program. If not, see . PKG="byobu" -DATA="$HOME/.$PKG" -[ -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" -if [ -e "$DATA/disable-autolaunch" ]; then +if [ -e "$BYOBU_CONFIG_DIR/disable-autolaunch" ]; then false else case "$TERM" in diff --git a/usr/bin/byobu-launcher-install b/usr/bin/byobu-launcher-install index 02661c9a..69baedcc 100755 --- a/usr/bin/byobu-launcher-install +++ b/usr/bin/byobu-launcher-install @@ -19,8 +19,10 @@ # along with this program. If not, see . PKG="byobu" -DATA="$HOME/.$PKG" -FLAG="$DATA/no-logout-on-detach" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + +FLAG="$BYOBU_CONFIG_DIR/no-logout-on-detach" LOGOUT_ON_DETACH=1 for i in $@; do @@ -47,7 +49,7 @@ install_launcher() { $PKG-launcher-uninstall || true # Hush login, since we will handle motd printing touch "$HOME"/.hushlogin -rm -f "$DATA/disable-autolaunch" +rm -f "$BYOBU_CONFIG_DIR/disable-autolaunch" # Update the logout/nologout flag update_flag diff --git a/usr/bin/byobu-launcher-uninstall b/usr/bin/byobu-launcher-uninstall index 19f1a740..cce9e747 100755 --- a/usr/bin/byobu-launcher-uninstall +++ b/usr/bin/byobu-launcher-uninstall @@ -19,7 +19,8 @@ # along with this program. If not, see . PKG="byobu" -DATA="$HOME/.$PKG" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" # Use gsed on non-Linux OS's which gsed 2>/dev/null && SED="gsed" || SED="sed" @@ -34,8 +35,8 @@ remove_launcher() { for i in ".profile" ".bashrc" ".bash_profile" ".zprofile"; do remove_launcher "$HOME/$i" done -mkdir -p "$DATA" -touch "$DATA/disable-autolaunch" +mkdir -p "$BYOBU_CONFIG_DIR" +touch "$BYOBU_CONFIG_DIR/disable-autolaunch" # install disabled motd printing; re-enable rm -f "$HOME"/.hushlogin diff --git a/usr/bin/byobu-quiet b/usr/bin/byobu-quiet index 63b5a185..28935ab9 100755 --- a/usr/bin/byobu-quiet +++ b/usr/bin/byobu-quiet @@ -17,9 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - PKG="byobu" -FLAG="$HOME/.$PKG/status.disable" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + +FLAG="$BYOBU_CONFIG_DIR/status.disable" # Clean up environment sed -i "/hardstatus/d" "$HOME/.$PKG/keybindings" || true diff --git a/usr/bin/byobu-reconnect-sockets b/usr/bin/byobu-reconnect-sockets index e94e0041..5eb39740 100755 --- a/usr/bin/byobu-reconnect-sockets +++ b/usr/bin/byobu-reconnect-sockets @@ -22,8 +22,8 @@ # along with this program. If not, see . PKG="byobu" - -. "${BYOBU_PREFIX}/lib/${PKG}/.shutil" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" case "$-" in *i*) diff --git a/usr/bin/byobu-select-profile b/usr/bin/byobu-select-profile index 58f0669c..d4e17379 100755 --- a/usr/bin/byobu-select-profile +++ b/usr/bin/byobu-select-profile @@ -23,11 +23,8 @@ # ./debian/rules get-po PKG="byobu" -DATA="$HOME/.$PKG" -mkdir -p "$DATA" -[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr" -export BYOBU_PREFIX -[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" TEXTDOMAIN="$PKG" @@ -65,7 +62,7 @@ EOT # Initialize variables FILE="$HOME"/."$PKG"/color -PROFILE="$DATA/profile" +PROFILE="$BYOBU_CONFIG_DIR/profile" [ -r "$PROFILE" ] || ln -sf $BYOBU_PREFIX/share/$PKG/profiles/common "$PROFILE" selected=-1 color= @@ -80,7 +77,7 @@ assert_symlink() { } # If these files exist, they must be a symlink -assert_symlink "$DATA/profile" +assert_symlink "$BYOBU_CONFIG_DIR/profile" listprofiles() { # Display list of profiles, one per line @@ -179,13 +176,13 @@ setcolor() { fi [ "$MONOCHROME" = "1" ] || MONOCHROME=0 printf "FOREGROUND=$FOREGROUND\nBACKGROUND=$BACKGROUND\nMONOCHROME=$MONOCHROME" > $FILE - touch "$SOCKETDIR/S-$USER/$PKG.reload-required" + touch "$BYOBU_RUN_DIR/reload-required" } if [ $# -eq 0 ]; then prompt "background" prompt "foreground" - screen -X at 0 source "$DATA/profile" + screen -X at 0 source "$BYOBU_CONFIG_DIR/profile" else while true; do case "$1" in diff --git a/usr/bin/byobu-shell b/usr/bin/byobu-shell index 6f85fed7..079d8e24 100755 --- a/usr/bin/byobu-shell +++ b/usr/bin/byobu-shell @@ -18,7 +18,10 @@ # along with this program. If not, see . PKG="byobu" -FLAG="$HOME/.$PKG/.welcome-displayed" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + +FLAG="$BYOBU_CONFIG_DIR/.welcome-displayed" [ -r /etc/motd ] && cat /etc/motd diff --git a/usr/bin/byobu-silent b/usr/bin/byobu-silent index 5c94ce44..a4f26db5 100755 --- a/usr/bin/byobu-silent +++ b/usr/bin/byobu-silent @@ -17,9 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - PKG="byobu" -FLAG="$HOME/.$PKG/status.disable" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + +FLAG="$BYOBU_CONFIG_DIR/status.disable" # Clean up environment sed -i "/caption/d" "$HOME/.$PKG/keybindings" || true diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status index bf341b59..c7971353 100755 --- a/usr/bin/byobu-status +++ b/usr/bin/byobu-status @@ -18,8 +18,8 @@ # along with this program. If not, see . PKG="byobu" -DATA="$HOME/.$PKG" -[ -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" if ! . "${BYOBU_PREFIX}/lib/${PKG}/.shutil"; then echo "failed to source ${BYOBU_PREFIX}/lib/${PKG}/.shutil" 2>&1 @@ -56,10 +56,10 @@ color() { } # Source configurations -[ -r "$DATA/color" ] && . "$DATA/color" +[ -r "$BYOBU_CONFIG_DIR/color" ] && . "$BYOBU_CONFIG_DIR/color" [ -r "/etc/$PKG/statusrc" ] && . "/etc/$PKG/statusrc" -[ -r "$DATA/status" ] && . "$DATA/status" -[ -r "$DATA/statusrc" ] && . "$DATA/statusrc" +[ -r "$BYOBU_CONFIG_DIR/status" ] && . "$BYOBU_CONFIG_DIR/status" +[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc" export P="$1" case "$P" in diff --git a/usr/bin/byobu-status-detail b/usr/bin/byobu-status-detail index 42655e12..773cce26 100755 --- a/usr/bin/byobu-status-detail +++ b/usr/bin/byobu-status-detail @@ -17,6 +17,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +PKG="byobu" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + if which vim >/dev/null && `vim --version | grep -q +folding`; then byobu-status --detail | vim -c "set foldmethod=indent" -c "set foldminlines=0" -c "set foldnestmax=1" -c "set foldcolumn=2" -R - else diff --git a/usr/bin/byobu-ugraph b/usr/bin/byobu-ugraph index 4909b3f6..be567be8 100755 --- a/usr/bin/byobu-ugraph +++ b/usr/bin/byobu-ugraph @@ -24,6 +24,10 @@ # #--------------------------------------------------------------------- +PKG="byobu" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + script_name=${0##*/} min_default=0 max_default=100 diff --git a/usr/bin/byobu-ulevel b/usr/bin/byobu-ulevel index 726cbb61..1db3dbcd 100755 --- a/usr/bin/byobu-ulevel +++ b/usr/bin/byobu-ulevel @@ -35,6 +35,10 @@ # you can always change the ordering of these values using the 'invert' # command-line option. +PKG="byobu" +[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX +. "${BYOBU_PREFIX}/lib/${PKG}/.common" + circles_2=(○ ●) diamonds_2=(◇ ◆) flags_2=(⚐ ⚑) diff --git a/usr/lib/byobu/.common b/usr/lib/byobu/.common new file mode 100644 index 00000000..1129b478 --- /dev/null +++ b/usr/lib/byobu/.common @@ -0,0 +1,22 @@ +#!/bin/sh +# +# .common: common stuff sourced by all scripts +# +# Copyright (C) 2011 Dustin Kirkland +# +# Authors: Dustin Kirkland +# +# 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 . + +. "${BYOBU_PREFIX}/lib/${PKG}/.shutil" +. "${BYOBU_PREFIX}/lib/${PKG}/.constants" diff --git a/usr/lib/byobu/.constants b/usr/lib/byobu/.constants index bbdf472d..22ad3579 100755 --- a/usr/lib/byobu/.constants +++ b/usr/lib/byobu/.constants @@ -19,16 +19,29 @@ # along with this program. If not, see . PKG="byobu" -CONFIG_DIR="$HOME/.$PKG" -mkdir -p "$CONFIG_DIR" -if mkdir -p "/var/run/screen/S-$USER/$PKG/cache" 2>/dev/null; then - CACHE_DIR="/var/run/screen/S-$USER/$PKG/cache" +BYOBU_VERSION="4.17" + +# Create and set the user configuration directory +BYOBU_CONFIG_DIR="$HOME/.$PKG" +mkdir -p "$BYOBU_CONFIG_DIR" + +# Grab the global, then local socket directory +[ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" +[ -r "$BYOBU_CONFIG_DIR/socketdir" ] && . "$BYOBU_CONFIG_DIR/socketdir" + +# Hopefully, we can make a runtime data directory in a tmpfs +if mkdir -p "$SOCKETDIR/S-$USER/$PKG" 2>/dev/null; then + BYOBU_RUN_DIR="$SOCKETDIR/S-$USER/$PKG" else - mkdir -p "$CONFIG_DIR/cache" - CACHE_DIR="$CONFIG_DIR/cache" + # But if not, we'll use a cache direcotry + mkdir -p "$HOME/.cache/$PKG" + BYOBU_RUN_DIR="$HOME/.cache/$PKG" fi + +# Some users build and install byobu themselves, rather than from a distro [ -n "$BYOBU_PREFIX" ] || BYOBU_PREFIX="/usr" +# UTF8 support in the hardstatus is coming one day in screen if [ "$UTF8" = "1" ]; then ICON_C="℃" ICON_F="℉" diff --git a/usr/lib/byobu/.notify_osd b/usr/lib/byobu/.notify_osd index c7585da8..3879136a 100755 --- a/usr/lib/byobu/.notify_osd +++ b/usr/lib/byobu/.notify_osd @@ -25,7 +25,7 @@ $sleep = 5; while () { # Ensure that the notify_osd indicator is enabled my $skip = 0; - open(F, "<$ENV{HOME}/.$PKG/status"); + open(F, "<$ENV{BYOBU_CONFIG_DIR}/status"); foreach my $i () { if ($i =~ /notify_osd=0/) { $skip = 1; diff --git a/usr/lib/byobu/.shutil b/usr/lib/byobu/.shutil index fb2c2b13..82427c53 100755 --- a/usr/lib/byobu/.shutil +++ b/usr/lib/byobu/.shutil @@ -49,8 +49,8 @@ fail() { find_script() { # Allow for local status scripts - if [ -x "$DATA/bin/$1" ]; then - _RET="$DATA/bin/$1" + if [ -x "$BYOBU_CONFIG_DIR/bin/$1" ]; then + _RET="$BYOBU_CONFIG_DIR/bin/$1" elif [ -x "$BYOBU_PREFIX/lib/$PKG/$1" ]; then _RET="$BYOBU_PREFIX/lib/$PKG/$1" elif [ -x "$BYOBU_PREFIX/libexec/$PKG/$1" ]; then diff --git a/usr/lib/byobu/Makefile.am b/usr/lib/byobu/Makefile.am index 1acb583d..c2d4e775 100644 --- a/usr/lib/byobu/Makefile.am +++ b/usr/lib/byobu/Makefile.am @@ -1,3 +1,3 @@ libdirdir = $(prefix)/lib/@PACKAGE@ -libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp custom date disk disk_io ec2_cost fan_speed hostname ip_address load_average logo mail mem_available mem_used menu network .notify_osd notify_osd processes raid rcs_cost reboot_required release services swap time time_binary time_utc trash updates_available uptime users whoami wifi_quality .constants .shutil +libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp custom date disk disk_io ec2_cost fan_speed hostname ip_address load_average logo mail mem_available mem_used menu network .notify_osd notify_osd processes raid rcs_cost reboot_required release services swap time time_binary time_utc trash updates_available uptime users whoami wifi_quality .common .constants .shutil diff --git a/usr/lib/byobu/custom b/usr/lib/byobu/custom index ef9823c4..6454cf08 100755 --- a/usr/lib/byobu/custom +++ b/usr/lib/byobu/custom @@ -24,9 +24,9 @@ __custom_detail() { } __custom() { - local cache="$CACHE_DIR/custom" + local cache="$BYOBU_RUN_DIR/custom" local i= output= - for i in "$HOME/.$PKG/bin/"[0-9]*_*; do + for i in "$BYOBU_CONFIG_DIR/bin/"[0-9]*_*; do # Loop over custom scripts [ -x "$i" ] || continue local now="$(date +%s)" diff --git a/usr/lib/byobu/disk_io b/usr/lib/byobu/disk_io index 965e2f1b..227ae262 100755 --- a/usr/lib/byobu/disk_io +++ b/usr/lib/byobu/disk_io @@ -45,7 +45,7 @@ __disk_io() { # Default to disk providing /, but let users override with MONITORED_DISK [ -z "$MONITORED_DISK" ] && mount_point="/" || mount_point="$MONITORED_DISK" # By default, we won't bug the user with the display of network traffic - # below DISK_IO_THRESHOLD in kB/s; override in $CONFIG_DIR/status + # below DISK_IO_THRESHOLD in kB/s; override in $BYOBU_CONFIG_DIR/status [ -n "$DISK_IO_THRESHOLD" ] || DISK_IO_THRESHOLD=50 case "$mount_point" in /dev/*) part="${mount_point}";; @@ -55,7 +55,7 @@ __disk_io() { local disk=${_RET} local t2=`date +%s` t1= for i in "read" "write"; do - local cache="$CACHE_DIR/disk.$i" + local cache="$BYOBU_RUN_DIR/disk.$i" t1=`stat -c %Y "$cache"` 2>/dev/null || t1=0 local unit="kB/s" local rate= x1= x2= symbol= unit= diff --git a/usr/lib/byobu/ec2_cost b/usr/lib/byobu/ec2_cost index 0801dc49..56bedae9 100755 --- a/usr/lib/byobu/ec2_cost +++ b/usr/lib/byobu/ec2_cost @@ -39,7 +39,7 @@ __ec2_cost() { . "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}" type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | sed -e "s/\./_/g") eval rate="\$$type" - file_to_stat="$CACHE_DIR/ec2_cost.instance_type" + file_to_stat="$BYOBU_RUN_DIR/ec2_cost.instance_type" [ -f "$file_to_stat" ] || wget -q -O "$file_to_stat" http://169.254.169.254/latest/meta-data/instance-type else . "$BYOBU_PREFIX/share/$PKG/ec2/rates."* diff --git a/usr/lib/byobu/ip_address b/usr/lib/byobu/ip_address index 8d585982..9e2f3773 100755 --- a/usr/lib/byobu/ip_address +++ b/usr/lib/byobu/ip_address @@ -27,7 +27,7 @@ __ip_address_detail() { __ip_address() { local interface ipaddr - # Allow interface overrides in $CONFIG_DIR/statusrc + # Allow interface overrides in $BYOBU_CONFIG_DIR/statusrc if [ -n "$MONITORED_NETWORK" ]; then interface="$MONITORED_NETWORK" else diff --git a/usr/lib/byobu/logo b/usr/lib/byobu/logo index 7fdea767..355c8930 100755 --- a/usr/lib/byobu/logo +++ b/usr/lib/byobu/logo @@ -22,7 +22,7 @@ get_distro() { _RET= if [ -n "$DISTRO" ]; then - # Allow manual override of distro in $CONFIG_DIR/status + # Allow manual override of distro in $BYOBU_CONFIG_DIR/status _RET="$DISTRO" elif [ -r "/etc/issue" ]; then # Otherwise, check /etc/issue @@ -45,7 +45,7 @@ __logo_detail() { __logo() { local logo= if [ -n "$LOGO" ]; then - # Allow users to define their own logo in $CONFIG_DIR/status + # Allow users to define their own logo in $BYOBU_CONFIG_DIR/status printf "%s" "$LOGO" return fi diff --git a/usr/lib/byobu/mem_available b/usr/lib/byobu/mem_available index 3313b1aa..0355c134 100755 --- a/usr/lib/byobu/mem_available +++ b/usr/lib/byobu/mem_available @@ -25,7 +25,7 @@ __mem_available_detail() { __mem_available() { local mem_used comma whitespace unit mem name - . "$CONFIG_DIR/status" + . "$BYOBU_CONFIG_DIR/status" [ "$mem_used" = "1" ] && comma="," || whitespace=" " read name mem unit < /proc/meminfo if [ $mem -ge 1048576 ]; then diff --git a/usr/lib/byobu/menu b/usr/lib/byobu/menu index 12dafe1a..af8f4970 100755 --- a/usr/lib/byobu/menu +++ b/usr/lib/byobu/menu @@ -25,7 +25,7 @@ __menu_detail() { __menu() { local bindings esc key text - [ -r "$CONFIG_DIR/keybindings" ] && bindings="$CONFIG_DIR/keybindings" || bindings="$HOME/.screenrc" + [ -r "$BYOBU_CONFIG_DIR/keybindings" ] && bindings="$BYOBU_CONFIG_DIR/keybindings" || bindings="$HOME/.screenrc" if grep -qs "^source.*screen-escape-keys$" $bindings 2>/dev/null || [ "$1" = "--disable-f-keys" ]; then esc=`grep "^escape" $bindings | sed "s/^.*\(.\)$/\1/"` [ -n "$esc" ] && key="^$esc-@" || key="^a-@" diff --git a/usr/lib/byobu/network b/usr/lib/byobu/network index 4cccdedf..44f58374 100755 --- a/usr/lib/byobu/network +++ b/usr/lib/byobu/network @@ -21,7 +21,7 @@ get_interface() { _RET= - # Allow interface overrides in $CONFIG_DIR/status + # Allow interface overrides in $BYOBU_CONFIG_DIR/status if [ -n "$MONITORED_NETWORK" ]; then _RET="$MONITORED_NETWORK" else @@ -38,7 +38,7 @@ __network_detail() { __network() { get_interface; local interface="$_RET" # By default, we won't bug the user with the display of network traffic - # below NETWORK_THRESHOLD in kbps; override in $CONFIG_DIR/status + # below NETWORK_THRESHOLD in kbps; override in $BYOBU_CONFIG_DIR/status [ -n "$NETWORK_THRESHOLD" ] || NETWORK_THRESHOLD=20 t2=`date +%s` OIFS=$IFS @@ -48,7 +48,7 @@ __network() { up) symbol="$ICON_UP" ;; down) symbol="$ICON_DN" ;; esac - cache="$CACHE_DIR/network.$i" + cache="$BYOBU_RUN_DIR/network.$i" t1=`stat -c %Y "$cache"` 2>/dev/null || t1=0 if [ $t2 -le $t1 ]; then rate=0 diff --git a/usr/lib/byobu/reboot_required b/usr/lib/byobu/reboot_required index 2482828e..4faf3b70 100755 --- a/usr/lib/byobu/reboot_required +++ b/usr/lib/byobu/reboot_required @@ -20,7 +20,7 @@ # along with this program. If not, see . REBOOT_FLAG="/var/run/reboot-required" -RELOAD_FLAG="$CACHE_DIR/reload-required" +RELOAD_FLAG="$BYOBU_RUN_DIR/reload-required" __reboot_required_detail() { [ -e "$REBOOT_FLAG" ] && ls -alF "$REBOOT_FLAG" 2>&1 diff --git a/usr/lib/byobu/services b/usr/lib/byobu/services index aa7a5fb5..c29b3bf5 100755 --- a/usr/lib/byobu/services +++ b/usr/lib/byobu/services @@ -44,7 +44,7 @@ service_running() { __services() { local services= - # Users can define a list of services to monitor in $CONFIG_DIR/status + # Users can define a list of services to monitor in $BYOBU_CONFIG_DIR/status if [ -z "$services" ]; then if [ -f "/etc/eucalyptus/eucalyptus.conf" ]; then # If the user has not defined any services, but this system is a diff --git a/usr/lib/byobu/updates_available b/usr/lib/byobu/updates_available index be458eab..de8aa2a0 100755 --- a/usr/lib/byobu/updates_available +++ b/usr/lib/byobu/updates_available @@ -96,7 +96,7 @@ __updates_available_detail() { } __updates_available() { - local mycache="$CACHE_DIR/updates-available" + local mycache="$BYOBU_RUN_DIR/updates-available" # If mycache is present, use it [ -r $mycache ] && ___print_updates `sed -n '/[^0-9]/s/ .*$//p' $mycache` # If we really need to do so (mycache doesn't exist, or the package database has changed), diff --git a/usr/share/byobu/keybindings/common b/usr/share/byobu/keybindings/common deleted file mode 120000 index 246cda3e..00000000 --- a/usr/share/byobu/keybindings/common +++ /dev/null @@ -1 +0,0 @@ -f-keys \ No newline at end of file diff --git a/usr/share/byobu/keybindings/common b/usr/share/byobu/keybindings/common new file mode 100644 index 00000000..9b3b3b18 --- /dev/null +++ b/usr/share/byobu/keybindings/common @@ -0,0 +1,82 @@ +############################################################################### +# Byobu f-key keybindings +# This configuration profile is intended to provide a useful +# keybindings using the keyboard's f-keys +# +# Copyright (C) 2008-2011 Dustin Kirkland +# Nick Barcet +# +# 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 . +############################################################################### + +# Byobu's escape key is ASCII Dec:94, Hex:5E, Oct:136, Char: ctrl-^ -- ctrl-caret +# which is bound to F12 +escape ^^^^ +register x "^^" # | Goes with the F12 definition + +# F-keys seem to work well in both gnome-terminal and tty consoles +bindkey -k k1 screen -t config 0 byobu-config # F1 | Configuration (along with F9) + # | since F1 = Help in gnome-terminal +bindkey -k k2 screen # F2 | Create new window +bindkey -k k3 eval 'prev' 'fit' # F3 | Previous Window +bindkey -k k4 eval 'next' 'fit' # F4 | Next Window +register r ":source $HOME/.byobu/profile^M" # | Goes with F5 definition +bindkey -k k5 eval 'process x' 'process r' # F5 | Reload profile +bindkey -k k6 detach # F6 | Detach from this session +bindkey -k k7 copy # F7 | Enter copy/scrollback mode +register t "A^[OH^k^h" # | Goes with the F8 definition +bindkey -k k8 eval 'process x' 'process t' # F8 | Re-title a window +bindkey -k k9 screen -t config 0 byobu-config # F9 | Configuration + # F10 | 'toolbar' in gnome-terminal + # F11 | 'fullscreen' in gnome-terminal +bindkey -k F2 process x # F12 | Byobu's escape key +bind $ screen -t status 0 byobu-status-detail # F12 $ | show detailed status +bind @ screen -t config 0 byobu-config # F12 @ | Configuration +bind R process r # F12 R | Reload profile +register s "[g G$>^h" # Goes with F12 ~ definition +bind ~ eval 'process x' 'process s' 'exec sed -i -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' 'screen -t PRINTSCREEN view $BYOBU_RUN_DIR/printscreen' # F12 ~ | write the buffer to file, open in a new window + +# Hotkeys for splits (gnome-terminal) +bindkey "^[O1;2Q" eval 'split' 'focus down' 'next' 'focus up' 'layout save byobu' 'layout autosave' # shift-F2 | horizontal split +bindkey "^[O1;5Q" eval 'split -v' 'focus down' 'next' 'focus up' 'layout save byobu' 'layout autosave' # ctrl-F2 | vertical split +bindkey "^[O1;2R" focus up # shift-F3 | focus up +bindkey "^[O1;2S" focus down # shift-F4 | focus down +bindkey "^[[15;2~" only # shift-F5 | kill all splits +bindkey "^[[17;5~" remove # ctrl-F6 | kill this split + +# Hotkeys for splits (tty) +bindkey "^[[26~" eval 'split' 'focus down' 'next' 'focus up' # shift-F2 | horizontal split + # ctrl-F2 | sadly, does not work in tty :-( +bindkey "^[[28~" focus up # shift-F3 | focus up +bindkey "^[[29~" focus down # shift-F4 | focus down +bindkey "^[[31~" only # shift-F5 | kill all splits + # ctrl-F6 | sadly, does not work in tty :-( + +# Make it more logical how to enter scrollback +register p "^[[5~" +bindkey "^[[5;3~" eval 'msgwait 0' 'msgminwait 0' 'copy' 'process p' # alt-pageup | scrollback +register n "^[[6~" +bindkey "^[[6;3~" eval 'msgwait 0' 'msgminwait 0' 'copy' 'process n' # alt-pagedn | scrollback + +# Make socket reconnection a little easier +bindkey "^[[15;5~" eval 'process x' 'process r' 'stuff ". $BYOBU_PREFIX/bin/byobu-reconnect-sockets^M"' # ctrl-F5 | reconnect gpg/ssh/x sockets + +# Detach from an auto-launched byobu, but don't log out of the shell +bindkey "^[[17;2~" eval 'exec touch $BYOBU_RUN_DIR/no-logout' 'detach' # shift-F6 | detach, but don't logout +bindkey "^[[32~" eval 'exec touch $BYOBU_RUN_DIR/no-logout' 'detach' # shift-F6 | detach, but don't logout + +# toggle f-key keybindings off +register d ":source $BYOBU_PREFIX/share/byobu/keybindings/screen-escape-keys^M" +bind ! eval 'process x' 'process d' 'backtick 111 9999999 9999999 byobu-status menu --disable-f-keys' # F12 ! | toggle on/off f-keys + +bindkey "^A" screen -t ctrl-a byobu-ctrl-a diff --git a/usr/share/byobu/keybindings/f-keys b/usr/share/byobu/keybindings/f-keys index 4c17174d..9b3b3b18 100644 --- a/usr/share/byobu/keybindings/f-keys +++ b/usr/share/byobu/keybindings/f-keys @@ -44,7 +44,7 @@ bind $ screen -t status 0 byobu-status-detail # F12 $ | show detailed status bind @ screen -t config 0 byobu-config # F12 @ | Configuration bind R process r # F12 R | Reload profile register s "[g G$>^h" # Goes with F12 ~ definition -bind ~ eval 'process x' 'process s' 'exec sed -i -e "/./,/^$/!d" /var/run/screen/S-$USER/printscreen' 'screen -t PRINTSCREEN view /var/run/screen/S-$USER/printscreen' # F12 ~ | write the buffer to file, open in a new window +bind ~ eval 'process x' 'process s' 'exec sed -i -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' 'screen -t PRINTSCREEN view $BYOBU_RUN_DIR/printscreen' # F12 ~ | write the buffer to file, open in a new window # Hotkeys for splits (gnome-terminal) bindkey "^[O1;2Q" eval 'split' 'focus down' 'next' 'focus up' 'layout save byobu' 'layout autosave' # shift-F2 | horizontal split @@ -72,8 +72,8 @@ bindkey "^[[6;3~" eval 'msgwait 0' 'msgminwait 0' 'copy' 'process n' # alt-page bindkey "^[[15;5~" eval 'process x' 'process r' 'stuff ". $BYOBU_PREFIX/bin/byobu-reconnect-sockets^M"' # ctrl-F5 | reconnect gpg/ssh/x sockets # Detach from an auto-launched byobu, but don't log out of the shell -bindkey "^[[17;2~" eval 'exec touch /var/run/screen/S-$USER/byobu.no-logout' 'detach' # shift-F6 | detach, but don't logout -bindkey "^[[32~" eval 'exec touch /var/run/screen/S-$USER/byobu.no-logout' 'detach' # shift-F6 | detach, but don't logout +bindkey "^[[17;2~" eval 'exec touch $BYOBU_RUN_DIR/no-logout' 'detach' # shift-F6 | detach, but don't logout +bindkey "^[[32~" eval 'exec touch $BYOBU_RUN_DIR/no-logout' 'detach' # shift-F6 | detach, but don't logout # toggle f-key keybindings off register d ":source $BYOBU_PREFIX/share/byobu/keybindings/screen-escape-keys^M" diff --git a/usr/share/byobu/profiles/common b/usr/share/byobu/profiles/common index eed706a8..68087a21 100644 --- a/usr/share/byobu/profiles/common +++ b/usr/share/byobu/profiles/common @@ -97,7 +97,7 @@ defbce "on" defscrollback 10000 # Set per-user screen-exchange -bufferfile /var/run/screen/S-$USER/printscreen +bufferfile $BYOBU_RUN_DIR/printscreen compacthist on # Monitor windows diff --git a/usr/share/man/man1/byobu-select-session.1 b/usr/share/man/man1/byobu-select-session.1 index e485e2c7..4a509c9b 100644 --- a/usr/share/man/man1/byobu-select-session.1 +++ b/usr/share/man/man1/byobu-select-session.1 @@ -7,15 +7,15 @@ byobu\-select\-session \- select and connect to a byobu session If an invalid selection is chosen 3 times in a row, the user is connected to the youngest session. -By default, if only one session exists, the user is connected to that session, and if no sessions exist, a new session is created -- such that there is no interactive prompt in the normal behavior. However, some users may choose to always be prompted, by touching the file $DATA/.always-select. +By default, if only one session exists, the user is connected to that session, and if no sessions exist, a new session is created -- such that there is no interactive prompt in the normal behavior. However, some users may choose to always be prompted, by touching the file $BYOBU_CONFIG_DIR/.always-select. -Note that DATA=$HOME/.byobu. +Note that BYOBU_CONFIG_DIR=$HOME/.byobu. Named sessions that begin with a "." are "hidden" from \fBbyobu\-select\-session\fP(1). This is useful, for instance, if you do not want a session to be automatically selected at login. Example: byobu \-S .hidden .SH "FILES" -\fI$DATA/.always-select\fP +\fI$BYOBU_CONFIG_DIR/.always-select\fP .SH "SEE ALSO" .PD 0 diff --git a/usr/share/man/man1/byobu.1 b/usr/share/man/man1/byobu.1 index c62d5b35..a3fa8c52 100644 --- a/usr/share/man/man1/byobu.1 +++ b/usr/share/man/man1/byobu.1 @@ -10,7 +10,7 @@ Options to \fBbyobu\fP are simply passed through \fBscreen\fP(1). .SH DESCRIPTION \fBbyobu\fP is a script that launches GNU screen in the byobu configuration. This enables the display of system information and status notifications within two lines at the bottom of the screen session. It also enables multiple tabbed terminal sessions, accessible through simple keystrokes. -Note that DATA=\fI$HOME/.byobu\fP. +Note that BYOBU_CONFIG_DIR=\fI$HOME/.byobu\fP. .SH STATUS NOTIFICATIONS @@ -20,24 +20,24 @@ Note that DATA=\fI$HOME/.byobu\fP. \fBarch\fP \- system architecture; displayed on the lower bar toward the left, in the default text color on the default background color -\fBbattery\fP \- battery information; display on the lower bar toward the right; |\-| indicates discharging, |+| indicates charging, |=| indicates fully charged; when charging or discharging, the current battery capacity as a percentage is displayed; the colours green, yellow, and red are used to give further indication of the battery's charge state; you may override the detected battery by setting BATTERY=/proc/acpi/battery/BAT0 in \fI$DATA/statusrc\fP +\fBbattery\fP \- battery information; display on the lower bar toward the right; |\-| indicates discharging, |+| indicates charging, |=| indicates fully charged; when charging or discharging, the current battery capacity as a percentage is displayed; the colours green, yellow, and red are used to give further indication of the battery's charge state; you may override the detected battery by setting BATTERY=/proc/acpi/battery/BAT0 in \fI$BYOBU_CONFIG_DIR/statusrc\fP \fBcpu_count\fP \- the number of cpu's or cores on the system; displayed in the lower bar toward the right in the default text color on the default background, followed by a trailing 'x' \fBcpu_freq\fP \- the current frequency of the cpu in GHz; displayed in the lower bar toward the right in white text on a light blue background -\fBcpu_temp\fP \- the cpu temperature in Celsius (default) or Fahrenheit, configure TEMP=F or TEMP=C in \fI$DATA/statusrc\fP; displayed in the lower bar toward the right in yellow text on a black background; you may override the detected cpu temperature device by setting MONITORED_TEMP=/proc/acpi/whatever in \fI$DATA/statusrc\fP +\fBcpu_temp\fP \- the cpu temperature in Celsius (default) or Fahrenheit, configure TEMP=F or TEMP=C in \fI$BYOBU_CONFIG_DIR/statusrc\fP; displayed in the lower bar toward the right in yellow text on a black background; you may override the detected cpu temperature device by setting MONITORED_TEMP=/proc/acpi/whatever in \fI$BYOBU_CONFIG_DIR/statusrc\fP -\fBcustom\fP \- user defined custom scripts; must be executable programs of any kind in \fI$DATA/bin\fP; must be named N_NAME, where N is the frequency in seconds to refresh the status indicator, and NAME is the name of the script; N should not be less than 5 seconds; the script should echo a small amount of text to standard out, standard error is discarded; the indicator will be displayed in the lower panel, in inverted colors to your current background/foreground scheme, unless you manually specify the colors in your script's output; BEWARE, cpu-intensive custom scripts may impact your overall system performance and could upset your system administrator! - Example: \fI$DATA/bin/1000_uname\fP +\fBcustom\fP \- user defined custom scripts; must be executable programs of any kind in \fI$BYOBU_CONFIG_DIR/bin\fP; must be named N_NAME, where N is the frequency in seconds to refresh the status indicator, and NAME is the name of the script; N should not be less than 5 seconds; the script should echo a small amount of text to standard out, standard error is discarded; the indicator will be displayed in the lower panel, in inverted colors to your current background/foreground scheme, unless you manually specify the colors in your script's output; BEWARE, cpu-intensive custom scripts may impact your overall system performance and could upset your system administrator! + Example: \fI$BYOBU_CONFIG_DIR/bin/1000_uname\fP #!/bin/sh printf "\\005{= bw}%s\\005{\-}" "$(uname \-r)" \fBdate\fP \- the system date in YYYY-MM-DD formate; displayed in the lower on the far right in the default text color on the default background -\fBdisk\fP \- total disk space available and total used on / directory; displayed in the lower bar on the far right in white text on a light purple background; override the default directory by specifying an alternate mount point with MONITORED_DISK=/wherever in \fI$DATA/statusrc\fP +\fBdisk\fP \- total disk space available and total used on / directory; displayed in the lower bar on the far right in white text on a light purple background; override the default directory by specifying an alternate mount point with MONITORED_DISK=/wherever in \fI$BYOBU_CONFIG_DIR/statusrc\fP -\fBdisk_io\fP \- instantaneous read/write througput in kB/s or MB/s over the last 3 seconds; displayed in the lower bar toward the right in white text on a light purple background with a leading '<' sign indicating 'read speed' and '>' sign indicating 'write speed'; override the default monitored disk by specifying an alternate device with MONITORED_DISK=/dev/sdb, and override the default DISK_IO_THRESHOLD=50 (kB/s) in \fI$DATA/statusrc\fP +\fBdisk_io\fP \- instantaneous read/write througput in kB/s or MB/s over the last 3 seconds; displayed in the lower bar toward the right in white text on a light purple background with a leading '<' sign indicating 'read speed' and '>' sign indicating 'write speed'; override the default monitored disk by specifying an alternate device with MONITORED_DISK=/dev/sdb, and override the default DISK_IO_THRESHOLD=50 (kB/s) in \fI$BYOBU_CONFIG_DIR/statusrc\fP \fBec2_cost\fP \- an estimation of the cost of the current boot of the system in terms of the Amazon EC2 billing model; displayed in the lower bar toward the right in green text on a black background; there is a leading '~' to indicate that this is an estimation, and the monetary units are US Dollars '$' @@ -49,11 +49,11 @@ Note that DATA=\fI$HOME/.byobu\fP. \fBhostname\fP \- the hostname of the system; displayed in the upper bar on the far right in bold black text on a grey background; there is a leading '@' symbol if the username status is also enabled -\fBip_address\fP \- the IPv4 address of the system in dotted decimal form; displayed in the upper bar on the far right in bold black text on a grey background; you can override and display your IPv6 address by setting 'IPV6=1' in \fI$DATA/statusrc\fP +\fBip_address\fP \- the IPv4 address of the system in dotted decimal form; displayed in the upper bar on the far right in bold black text on a grey background; you can override and display your IPv6 address by setting 'IPV6=1' in \fI$BYOBU_CONFIG_DIR/statusrc\fP \fBload_average\fP \- the system load average over the last 1 minute; displayed in the lower bar toward the right in black text on a yellow background -\fBlogo\fP \- an approximation of the current operating system's logo; displayed in the lower bar on the far left; you may customize this logo by setting a chosen logo in \fI$DATA/logo\fP, or you may override this with LOGO=:-D in \fI$DATA/statusrc\fP +\fBlogo\fP \- an approximation of the current operating system's logo; displayed in the lower bar on the far left; you may customize this logo by setting a chosen logo in \fI$BYOBU_CONFIG_DIR/logo\fP, or you may override this with LOGO=:-D in \fI$BYOBU_CONFIG_DIR/statusrc\fP \fBmail\fP \- system mail for the current user; the letter '[M]' is displayed in the lower bar toward the left in black text on a grey background @@ -63,7 +63,7 @@ Note that DATA=\fI$HOME/.byobu\fP. \fBmenu\fP \- a simple indicator directing new users to use the F9 keybinding to access the byobu menu -\fBnetwork\fP \- instantaneous upload/download bandwidth in [GMk]bps over the last 3 seconds; nothing is displayed if traffic is 0; displayed in the lower bar toward the left in white text on a purple background with a leading '^' sign indicating 'up' and 'v' sign indicating 'down'; override the default interface by specifying an alternate interface with MONITORED_NETWORK=eth1, and override the default units (bits) with NETWORK_UNITS=bytes, and override the default NETWORK_THRESHOLD=20 (kbps) in \fI$DATA/statusrc\fP +\fBnetwork\fP \- instantaneous upload/download bandwidth in [GMk]bps over the last 3 seconds; nothing is displayed if traffic is 0; displayed in the lower bar toward the left in white text on a purple background with a leading '^' sign indicating 'up' and 'v' sign indicating 'down'; override the default interface by specifying an alternate interface with MONITORED_NETWORK=eth1, and override the default units (bits) with NETWORK_UNITS=bytes, and override the default NETWORK_THRESHOLD=20 (kbps) in \fI$BYOBU_CONFIG_DIR/statusrc\fP \fBnotify_osd\fP \- Send on-screen notification messages to screen's notification buffer @@ -71,15 +71,15 @@ Note that DATA=\fI$HOME/.byobu\fP. \fBreboot_required\fP \- symbol present if a reboot is required following a system update; displayed in the lower bar white text on a blue background by the symbol '(R)'; additionally, reboot_required will print '' in white text on a blue background, if Byobu requires you to reload your profile to affect some changes. -\fBrelease\fP \- distribution and version information about the release running on the current system as reported by \fBlsb_release(1)\fP or \fI/etc/issue\fP; displayed in the lower bar in bold black text toward the left on a grey background; you may override the detected release with DISTRO=Whatever in \fI$DATA/statusrc\fP +\fBrelease\fP \- distribution and version information about the release running on the current system as reported by \fBlsb_release(1)\fP or \fI/etc/issue\fP; displayed in the lower bar in bold black text toward the left on a grey background; you may override the detected release with DISTRO=Whatever in \fI$BYOBU_CONFIG_DIR/statusrc\fP -\fBservices\fP \- users can configure a list of services to monitor, define the SERVICES variable in \fI$DATA/statusrc\fP, a whitespace separated of services, each service should include the init name of the service, then a pipe, and then an abbreviated name or symbol to display when running (e.g. SERVICES="ssh|ssh apache2|http"); displayed in the lower bar toward the center in cyan on a white background +\fBservices\fP \- users can configure a list of services to monitor, define the SERVICES variable in \fI$BYOBU_CONFIG_DIR/statusrc\fP, a whitespace separated of services, each service should include the init name of the service, then a pipe, and then an abbreviated name or symbol to display when running (e.g. SERVICES="ssh|ssh apache2|http"); displayed in the lower bar toward the center in cyan on a white background \fBswap\fP \- total swap space and total used as a percentage of the total available; displayed in the lower bar toward the right in white text on a light green background with a trailing '%' sign \fBtime\fP \- the system time in HH:MM:SS format; displayed in the lower bar on the far right in the default text and default background colors -\fBtime_binary\fP \- only for the hard core geek, the local system time in binary; requires UTF8 support in a VERY recent version of GNU Screen; you must additionally set "UTF8=1" in \fI$DATA/statusrc\fP; displayed in the lower bar on the far right in the default text and background colors +\fBtime_binary\fP \- only for the hard core geek, the local system time in binary; requires UTF8 support in a VERY recent version of GNU Screen; you must additionally set "UTF8=1" in \fI$BYOBU_CONFIG_DIR/statusrc\fP; displayed in the lower bar on the far right in the default text and background colors \fBtime_utc\fP \- the UTC system time in HH:MMformat; displayed in the lower bar on the far right in dark text on a light background @@ -91,7 +91,7 @@ Note that DATA=\fI$HOME/.byobu\fP. \fBwhoami\fP \- the name of the user who owns the screen session; displayed in the upper bar toward the far right in bold black text on a grey background -\fBwifi_quality\fP \- the connection rate and signal quality of the wifi connection; displayed in the lower bar toward the right in black text on a cyan background; the connection rate is in 'Mb/s' and the signal quality is as a percentage with a trailing '%'; override the default interface by specifying an alternate interface with MONITORED_NETWORK=wlan0 in \fI$DATA/statusrc\fP +\fBwifi_quality\fP \- the connection rate and signal quality of the wifi connection; displayed in the lower bar toward the right in black text on a cyan background; the connection rate is in 'Mb/s' and the signal quality is as a percentage with a trailing '%'; override the default interface by specifying an alternate interface with MONITORED_NETWORK=wlan0 in \fI$BYOBU_CONFIG_DIR/statusrc\fP .SH SESSIONS @@ -103,12 +103,12 @@ Byobu name screen sessions "byobu", if unspecified. To hide sessions from \fBby Each open window in the screen session is displayed in the upper bar toward the far left. These are numbered, and include indicators as to activity in the window (see "activity" in \fBscreen\fP(1) for symbol definitions). The current active window is highlighted by inverting the background/text from the rest of the window bar. -Users can create a list of windows to launch at startup in \fI$DATA/windows\fP. This file is the same syntax as \fI~/.screenrc\fP, each line specifying a window using the "screen" command, as described in \fBscreen\fP(1). +Users can create a list of windows to launch at startup in \fI$BYOBU_CONFIG_DIR/windows\fP. This file is the same syntax as \fI~/.screenrc\fP, each line specifying a window using the "screen" command, as described in \fBscreen\fP(1). -User can also launch Byobu with unique window sets. Users can store these as \fI$DATA/windows.[NAME]\fP, and launch Byobu with the environment variable \fBBYOBU_WINDOWS\fP. +User can also launch Byobu with unique window sets. Users can store these as \fI$BYOBU_CONFIG_DIR/windows.[NAME]\fP, and launch Byobu with the environment variable \fBBYOBU_WINDOWS\fP. For example: - $ cat $DATA/windows.ssh_sessions + $ cat $BYOBU_CONFIG_DIR/windows.ssh_sessions screen \-t localhost bash screen \-t aussie ssh root@aussie screen \-t beagle ssh root@beagle @@ -172,7 +172,7 @@ byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or withi \fBCtrl-a k\fP \- Kill the current window -\fBCtrl-a ~\fP \- Write the current window's scrollback buffer to \fI/var/run/screen/S-$USER/byobu-exchange\fP +\fBCtrl-a ~\fP \- Save the current window's scrollback buffer .SH "BUGS"