diff --git a/debian/changelog b/debian/changelog index 026006e6..eaedea7a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,16 @@ byobu (4.30) unreleased; urgency=low helper - add a PCT constant, required to support both screen and tmux - fix a bug/typo in shutil (should be /proc/uptime) + * usr/bin/byobu-status-tmux, usr/lib/byobu/.constants, + usr/share/byobu/profiles/common, usr/share/byobu/profiles/tmux, + usr/share/byobu/status/1, usr/share/byobu/status/2, + usr/share/byobu/status/3, usr/share/byobu/status/4, + usr/share/byobu/status/Makefile.am, usr/share/byobu/status/status: + - separate status cache between screen and tmux (different formatting) + - make byobu-status-tmux support screen + - PCT="%%" for both + - update backticks and caption/hardstatus + - fix default status -- Dustin Kirkland Thu, 11 Aug 2011 10:31:31 -0500 diff --git a/usr/bin/byobu-status-tmux b/usr/bin/byobu-status-tmux index d1a9d8fc..6a55b2e5 100755 --- a/usr/bin/byobu-status-tmux +++ b/usr/bin/byobu-status-tmux @@ -26,10 +26,10 @@ PKG="byobu" [ -f "$BYOBU_CONFIG_DIR/status.disable" ] && exit 0 # Clean and create cache directories -mkdir -p "$BYOBU_RUN_DIR/status" "$BYOBU_RUN_DIR/.last" +mkdir -p "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND" "$BYOBU_RUN_DIR/.last.$BYOBU_BACKEND" # Source configurations -for i in "${BYOBU_PREFIX}/share/$PKG/status/statusrc" "$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 @@ -37,8 +37,8 @@ done get_now; NOW=${_RET} get_status() { - local cachepath="$BYOBU_RUN_DIR/status/$1" - local lastpath="$BYOBU_RUN_DIR/.last/$1" + local cachepath="$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/$1" + local lastpath="$BYOBU_RUN_DIR/.last.$BYOBU_BACKEND/$1" local lastrun [ -r "$lastpath" ] && read lastrun < "$lastpath" || lastrun=0 status_freq "$1" @@ -53,17 +53,11 @@ get_status() { } case "$1" in - left) - IFS= read items < "$BYOBU_CONFIG_DIR/status.tmux.left" + *left|*right) + eval items="\$$1" for i in $items; do + case "$i" in \#*) continue ;; esac get_status "$i" done ;; - right) - IFS= read items < "$BYOBU_CONFIG_DIR/status.tmux.right" - for i in $items; do - get_status "$i" - done - - ;; esac diff --git a/usr/lib/byobu/.constants b/usr/lib/byobu/.constants index 7caeaabd..21ac207c 100755 --- a/usr/lib/byobu/.constants +++ b/usr/lib/byobu/.constants @@ -42,6 +42,7 @@ else ICON_TRASH="T" ICON_WIFI= fi +PCT="%%" # Support two different backends (screen/tmux) if [ -z "$BYOBU_BACKEND" ]; then @@ -53,13 +54,11 @@ case "$BYOBU_BACKEND" in export BYOBU_BACKEND BYOBU_ARG_VERSION="-V" ESC= - PCT="%%" ;; *) export BYOBU_BACKEND="screen" BYOBU_ARG_VERSION="-v" ESC="\005" - PCT="%" ;; esac diff --git a/usr/share/byobu/profiles/common b/usr/share/byobu/profiles/common index 06878022..f3dec537 100644 --- a/usr/share/byobu/profiles/common +++ b/usr/share/byobu/profiles/common @@ -79,6 +79,11 @@ backtick 135 59 59 byobu-status raid backtick 136 19 19 byobu-status swap backtick 137 23 23 byobu-status time_binary +backtick 1001 9999999 9999999 byobu-status-tmux screen_upper_left +backtick 1002 127 127 byobu-status-tmux screen_upper_right +backtick 1003 599 599 byobu-status-tmux screen_lower_left +backtick 1004 2 2 byobu-status-tmux screen_lower_right + hardstatus alwayslastline # The following line would turn off alternate Screen switching in xterms, @@ -111,10 +116,10 @@ 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 "%1001`%?%-Lw%50L>%?%{=r}%n*%f %t%?(%u)%?%{-}%12`%?%+Lw%?%11` %=%12`%1002`%10`%<" # Status string, last line -hardstatus string '%99`%{-}%{=r}%12` %100`%112`%=%117`%133`%130`%135`%102`%101`%129`%131`%127`%114`%115`%108`%134`%128`%125`%126`%113`%119`%116`%106`%104`%103`%105`%107`%136`%123`%137`%132`%120`%121`' +hardstatus string '%1003`%=%1004`' # NOTE: Older version of Screen have an arbitrary limit of only being able # to change colors 16 times in this 'hardstatus string'. diff --git a/usr/share/byobu/profiles/tmux b/usr/share/byobu/profiles/tmux index cd4981cd..371db7ac 100644 --- a/usr/share/byobu/profiles/tmux +++ b/usr/share/byobu/profiles/tmux @@ -79,7 +79,7 @@ set -g status-fg white set -g status-interval 1 set -g status-left-length 256 set -g status-right-length 256 -set -g status-left '#(byobu-status-tmux left)[' -set -g status-right ']#(byobu-status-tmux right)#[default]%Y-%m-%d %H:%M:%S' +set -g status-left '#(byobu-status-tmux tmux_left)[' +set -g status-right ']#(byobu-status-tmux tmux_right)#[default]%Y-%m-%d %H:%M:%S' set -g message-bg magenta set -g message-fg white diff --git a/usr/share/byobu/status/1 b/usr/share/byobu/status/1 deleted file mode 100644 index 9821353b..00000000 --- a/usr/share/byobu/status/1 +++ /dev/null @@ -1 +0,0 @@ -color diff --git a/usr/share/byobu/status/2 b/usr/share/byobu/status/2 deleted file mode 100644 index cc48a25c..00000000 --- a/usr/share/byobu/status/2 +++ /dev/null @@ -1,4 +0,0 @@ -whoami -hostname -ip_address -menu diff --git a/usr/share/byobu/status/3 b/usr/share/byobu/status/3 deleted file mode 100644 index 4eb787f7..00000000 --- a/usr/share/byobu/status/3 +++ /dev/null @@ -1,4 +0,0 @@ -color -logo -release -arch diff --git a/usr/share/byobu/status/4 b/usr/share/byobu/status/4 deleted file mode 100644 index 7c399266..00000000 --- a/usr/share/byobu/status/4 +++ /dev/null @@ -1,29 +0,0 @@ -network -disk_io -custom -raid -reboot_required -updates_available -apport -services -mail -users -uptime -ec2_cost -rcs_cost -fan_speed -cpu_temp -battery -wifi_quality -processes -load_average -cpu_count -cpu_freq -mem_available -mem_used -swap -disk -time_binary -time_utc -date -time diff --git a/usr/share/byobu/status/Makefile.am b/usr/share/byobu/status/Makefile.am index a346cd3a..91f41595 100644 --- a/usr/share/byobu/status/Makefile.am +++ b/usr/share/byobu/status/Makefile.am @@ -1,2 +1,2 @@ statusdir = $(datadir)/@PACKAGE@/status -status_DATA = 1 2 3 4 status statusrc +status_DATA = status statusrc diff --git a/usr/share/byobu/status/status b/usr/share/byobu/status/status index ec7a2aa2..d83d30b3 100644 --- a/usr/share/byobu/status/status +++ b/usr/share/byobu/status/status @@ -20,41 +20,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -apport=0 -arch=0 -battery=1 -color=1 -cpu_count=1 -cpu_freq=1 -cpu_temp=0 -custom=1 -date=1 -disk=0 -disk_io=0 -ec2_cost=0 -fan_speed=0 -hostname=1 -ip_address=1 -load_average=1 -logo=1 -mail=0 -mem_available=1 -mem_used=1 -menu=1 -network=1 -notify_osd=0 -processes=0 -raid=1 -rcs_cost=0 -reboot_required=1 -release=1 -services=1 -swap=0 -time=1 -time_binary=0 -time_utc=0 -users=1 -updates_available=1 -uptime=1 -whoami=1 -wifi_quality=1 +# Screen has two status lines, with 4 quadrants for status +screen_upper_left="color" +screen_upper_right="color whoami hostname ip_address menu" +screen_lower_left="color logo release #arch" +screen_lower_right="color network #disk_io custom raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq mem_available mem_used #swap #disk #time_utc date time" + +# Tmux has one status line, with 2 halves for status +tmux_left="logo release #arch" +tmux_right="network #disk_io custom raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq mem_available mem_used #swap #disk #whoami #hostname #ip_address #time_utc date time"