diff --git a/debian/changelog b/debian/changelog index 633bd6fc..9910c704 100644 --- a/debian/changelog +++ b/debian/changelog @@ -51,6 +51,14 @@ byobu (4.18) unreleased; urgency=low - drop the backtick commands for all the individual status functions - add the backtick commands for the 4 quadrants of status - update the hardstatus line accordingly + * usr/bin/byobu-select-session, usr/lib/byobu/.common, + usr/lib/byobu/.constants, usr/lib/byobu/.dirs, + usr/lib/byobu/Makefile.am, usr/share/byobu/profiles/common, + usr/share/byobu/status/1, usr/share/byobu/status/2: + - fix string bug in select session + - re-add a couple of necessary backticks + - update caption line to use new statusd cache + - significantly reduce the number of mkdir -p commands [ James Spencer ] * usr/lib/byobu/.constants: diff --git a/usr/bin/byobu-select-session b/usr/bin/byobu-select-session index 3cdb1419..fdd5ea60 100755 --- a/usr/bin/byobu-select-session +++ b/usr/bin/byobu-select-session @@ -30,7 +30,7 @@ sessions = [] text = [] i = 0 -output = commands.getoutput('%s -ls ', BYOBU_BACKEND) +output = commands.getoutput('%s -ls ' % BYOBU_BACKEND) if output: for s in output.split("\n"): s = re.sub(r'\s+', ' ', s) diff --git a/usr/lib/byobu/.common b/usr/lib/byobu/.common index 0075676a..d0d3b571 100644 --- a/usr/lib/byobu/.common +++ b/usr/lib/byobu/.common @@ -19,6 +19,7 @@ # along with this program. If not, see . if [ -z "${BYOBU_INCLUDED_LIBS}" ]; then + . "${BYOBU_PREFIX}/lib/${PKG}/.dirs" . "${BYOBU_PREFIX}/lib/${PKG}/.shutil" . "${BYOBU_PREFIX}/lib/${PKG}/.constants" BYOBU_INCLUDED_LIBS=1 diff --git a/usr/lib/byobu/.constants b/usr/lib/byobu/.constants index e4db2060..92bcf820 100755 --- a/usr/lib/byobu/.constants +++ b/usr/lib/byobu/.constants @@ -20,30 +20,6 @@ PKG="byobu" -# Create and set the user configuration directory -if [ -d "$XDG_CONFIG_HOME" ] && mkdir -p "$XDG_CONFIG_HOME/$PKG"; then - export BYOBU_CONFIG_DIR="$XDG_CONFIG_HOME/$PKG" -elif mkdir -p "$HOME/.$PKG"; then - export BYOBU_CONFIG_DIR="$HOME/.$PKG" -fi - -# 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 [ -d "$XDG_CACHE_HOME" ] && mkdir -p "$XDG_CACHE_HOME/$PKG"; then - export BYOBU_RUN_DIR="$XDG_CACHE_HOME/$PKG" -elif mkdir -p "$SOCKETDIR/S-$USER/$PKG" 2>/dev/null; then - export BYOBU_RUN_DIR="$SOCKETDIR/S-$USER/$PKG" -elif mkdir -p "$HOME/.cache/$PKG"; then - # But if not, we'll use a cache directory - export 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="℃" diff --git a/usr/lib/byobu/.dirs b/usr/lib/byobu/.dirs new file mode 100755 index 00000000..0c28afee --- /dev/null +++ b/usr/lib/byobu/.dirs @@ -0,0 +1,51 @@ +#!/bin/sh +# +# .dirs: some dirs needed by all library status 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 . + +PKG="byobu" + +# Some users build and install byobu themselves, rather than from a distro +[ -n "$BYOBU_PREFIX" ] || BYOBU_PREFIX="/usr" + +# Create and export the user configuration directory +if [ -d "$XDG_CONFIG_HOME" ]; then + # Use XDG, as some users insist on such nonsense :-) + export BYOBU_CONFIG_DIR="$XDG_CONFIG_HOME/$PKG" +else + # But fall back to classic config dir location + export BYOBU_CONFIG_DIR="$HOME/.$PKG" +fi +[ -d "$BYOBU_CONFIG_DIR" ] || 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" + +# Create and export the runtime cache directory +if [ -d "$XDG_CACHE_HOME" ]; then + # Use XDG, as some users insist on such nonsense :-) + export BYOBU_RUN_DIR="$XDG_CACHE_HOME/$PKG" +elif [ -d "$SOCKETDIR/S-$USER" ]; then + # But for FAR better performance, use a tmpfs if available + export BYOBU_RUN_DIR="$SOCKETDIR/S-$USER/$PKG" +else + # But if not, we'll use a cache directory + export BYOBU_RUN_DIR="$HOME/.cache/$PKG" +fi +[ -d "$BYOBU_RUN_DIR" ] || mkdir -p "$BYOBU_RUN_DIR" diff --git a/usr/lib/byobu/Makefile.am b/usr/lib/byobu/Makefile.am index c2aa797b..9ee94913 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 color 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 +libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp color 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 .dirs .shutil diff --git a/usr/share/byobu/profiles/common b/usr/share/byobu/profiles/common index e4f81544..18a0bb67 100644 --- a/usr/share/byobu/profiles/common +++ b/usr/share/byobu/profiles/common @@ -29,6 +29,10 @@ defutf8 on deflogin on backtick 10 9999999 9999999 byobu-janitor +backtick 11 9999999 9999999 printf "\005-1=" +backtick 12 9999999 9999999 byobu-status color +backtick 13 0 0 byobu-status notify_osd +backtick 1000 0 0 run-this-one byobu-statusd backtick 1001 1 1 byobu-status-print 1 backtick 1002 1 1 byobu-status-print 2 backtick 1003 1 1 byobu-status-print 3 @@ -64,7 +68,7 @@ fit setenv SSH_AUTH_SOCK $BYOBU_CONFIG_DIR/.ssh-agent # Window tabs, second to last line -caption always "%12`%?%-Lw%50L>%?%{=r}%n*%f %t%?(%u)%?%{-}%12`%?%+Lw%?%11` %=%12`%110`%109`%122`%111`%10`%<" +caption always "%12`%1001`%?%-Lw%50L>%?%{=r}%n*%f %t%?(%u)%?%{-}%12`%?%+Lw%?%11` %=%12`%1002`%10`%<" # Status string, last line hardstatus alwayslastline diff --git a/usr/share/byobu/status/1 b/usr/share/byobu/status/1 index e69de29b..9821353b 100644 --- a/usr/share/byobu/status/1 +++ b/usr/share/byobu/status/1 @@ -0,0 +1 @@ +color diff --git a/usr/share/byobu/status/2 b/usr/share/byobu/status/2 index e69de29b..cc48a25c 100644 --- a/usr/share/byobu/status/2 +++ b/usr/share/byobu/status/2 @@ -0,0 +1,4 @@ +whoami +hostname +ip_address +menu