diff --git a/debian/changelog b/debian/changelog index e0148903..f4b1b734 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,12 @@ byobu (5.0) unreleased; urgency=low usr/share/doc/byobu/help.tmux.txt: - put all of the status line functions under *-F5 - put all of the split arrangement functions under *-F8 + * usr/lib/byobu/include/cycle-status, + usr/lib/byobu/include/Makefile.am, usr/share/byobu/keybindings/f- + keys.tmux, usr/share/byobu/status/status: LP: #887140 + - support multiple toggle-able status lines + - define one or more tmux_right lines in ~/.byobu/status + - press Shift-F5 to toggle through -- Dustin Kirkland Sun, 18 Dec 2011 21:35:00 -0600 diff --git a/usr/lib/byobu/include/Makefile.am b/usr/lib/byobu/include/Makefile.am index 92014cd1..4184dd54 100644 --- a/usr/lib/byobu/include/Makefile.am +++ b/usr/lib/byobu/include/Makefile.am @@ -1,2 +1,2 @@ inclibdirdir = $(prefix)/lib/@PACKAGE@/include -inclibdir_SCRIPTS = common constants dirs layout mondrian notify_osd shutil +inclibdir_SCRIPTS = common constants cycle-status dirs layout mondrian notify_osd shutil diff --git a/usr/lib/byobu/include/cycle-status b/usr/lib/byobu/include/cycle-status new file mode 100755 index 00000000..906f9261 --- /dev/null +++ b/usr/lib/byobu/include/cycle-status @@ -0,0 +1,41 @@ +#!/bin/sh +# +# cycle-status: cycle the status bar through multiple configurations +# +# 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 . + + +# Find line number of the enabled tmux_right +current=$(grep -n "^tmux_right=" "$BYOBU_CONFIG_DIR/status" | awk -F: '{print $1}' | tail -n1) + +# Find next line number to enable +all=$(grep -n "tmux_right=" "$BYOBU_CONFIG_DIR/status" | awk -F: '{print $1}') +next= +for i in $all $all; do + if [ "$next" = "flagged" ]; then + next="$i" + break + elif [ "$i" = "$current" ]; then + next="flagged" + fi +done + +# Disable all +sed -i "s/^tmux_right=/#tmux_right=/" "$BYOBU_CONFIG_DIR/status" + +# Enable the next one +sed -i "${next}s/^#tmux_right=/tmux_right=/" "$BYOBU_CONFIG_DIR/status" diff --git a/usr/share/byobu/keybindings/f-keys.tmux b/usr/share/byobu/keybindings/f-keys.tmux index d0abe461..65f605fd 100644 --- a/usr/share/byobu/keybindings/f-keys.tmux +++ b/usr/share/byobu/keybindings/f-keys.tmux @@ -50,6 +50,7 @@ bind-key -n C-Down resize-pane -D bind-key -n C-Left resize-pane -L bind-key -n C-Right resize-pane -R bind-key -n F5 source $BYOBU_PREFIX/share/byobu/profiles/tmuxrc +bind-key -n S-F5 new-window -k "$BYOBU_PREFIX/lib/byobu/include/cycle-status" \; source $BYOBU_PREFIX/share/byobu/profiles/tmuxrc bind-key -n C-F5 send-keys ". $BYOBU_PREFIX/bin/byobu-reconnect-sockets" \; send-keys Enter bind-key -n C-S-F5 new-window -d "byobu-select-profile -r" bind-key -n F6 detach diff --git a/usr/share/byobu/status/status b/usr/share/byobu/status/status index 19e65cf5..184d5b65 100644 --- a/usr/share/byobu/status/status +++ b/usr/share/byobu/status/status @@ -30,4 +30,6 @@ screen_lower_right="color network #disk_io custom #entropy raid reboot_required # Tmux has one status line, with 2 halves for status tmux_left="logo #distro release #arch" +# You can have as many tmux right lines below here, and cycle through them using Shift-F5 tmux_right="network #disk_io custom #entropy 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 memory #swap #disk #whoami #hostname #ip_address #time_utc date time" +#tmux_right="#network disk_io #custom entropy #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 #memory #swap whoami hostname ip_address #time_utc disk date time"