mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
* 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
This commit is contained in:
parent
33197a24e9
commit
d514810917
11 changed files with 37 additions and 96 deletions
10
debian/changelog
vendored
10
debian/changelog
vendored
|
@ -17,6 +17,16 @@ byobu (4.30) unreleased; urgency=low
|
||||||
helper
|
helper
|
||||||
- add a PCT constant, required to support both screen and tmux
|
- add a PCT constant, required to support both screen and tmux
|
||||||
- fix a bug/typo in shutil (should be /proc/uptime)
|
- 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 <kirkland@ubuntu.com> Thu, 11 Aug 2011 10:31:31 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 11 Aug 2011 10:31:31 -0500
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,10 @@ PKG="byobu"
|
||||||
[ -f "$BYOBU_CONFIG_DIR/status.disable" ] && exit 0
|
[ -f "$BYOBU_CONFIG_DIR/status.disable" ] && exit 0
|
||||||
|
|
||||||
# Clean and create cache directories
|
# 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
|
# 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"
|
[ -r "$i" ] && . "$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ done
|
||||||
get_now; NOW=${_RET}
|
get_now; NOW=${_RET}
|
||||||
|
|
||||||
get_status() {
|
get_status() {
|
||||||
local cachepath="$BYOBU_RUN_DIR/status/$1"
|
local cachepath="$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/$1"
|
||||||
local lastpath="$BYOBU_RUN_DIR/.last/$1"
|
local lastpath="$BYOBU_RUN_DIR/.last.$BYOBU_BACKEND/$1"
|
||||||
local lastrun
|
local lastrun
|
||||||
[ -r "$lastpath" ] && read lastrun < "$lastpath" || lastrun=0
|
[ -r "$lastpath" ] && read lastrun < "$lastpath" || lastrun=0
|
||||||
status_freq "$1"
|
status_freq "$1"
|
||||||
|
@ -53,17 +53,11 @@ get_status() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
left)
|
*left|*right)
|
||||||
IFS= read items < "$BYOBU_CONFIG_DIR/status.tmux.left"
|
eval items="\$$1"
|
||||||
for i in $items; do
|
for i in $items; do
|
||||||
|
case "$i" in \#*) continue ;; esac
|
||||||
get_status "$i"
|
get_status "$i"
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
right)
|
|
||||||
IFS= read items < "$BYOBU_CONFIG_DIR/status.tmux.right"
|
|
||||||
for i in $items; do
|
|
||||||
get_status "$i"
|
|
||||||
done
|
|
||||||
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -42,6 +42,7 @@ else
|
||||||
ICON_TRASH="T"
|
ICON_TRASH="T"
|
||||||
ICON_WIFI=
|
ICON_WIFI=
|
||||||
fi
|
fi
|
||||||
|
PCT="%%"
|
||||||
|
|
||||||
# Support two different backends (screen/tmux)
|
# Support two different backends (screen/tmux)
|
||||||
if [ -z "$BYOBU_BACKEND" ]; then
|
if [ -z "$BYOBU_BACKEND" ]; then
|
||||||
|
@ -53,13 +54,11 @@ case "$BYOBU_BACKEND" in
|
||||||
export BYOBU_BACKEND
|
export BYOBU_BACKEND
|
||||||
BYOBU_ARG_VERSION="-V"
|
BYOBU_ARG_VERSION="-V"
|
||||||
ESC=
|
ESC=
|
||||||
PCT="%%"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
export BYOBU_BACKEND="screen"
|
export BYOBU_BACKEND="screen"
|
||||||
BYOBU_ARG_VERSION="-v"
|
BYOBU_ARG_VERSION="-v"
|
||||||
ESC="\005"
|
ESC="\005"
|
||||||
PCT="%"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,11 @@ backtick 135 59 59 byobu-status raid
|
||||||
backtick 136 19 19 byobu-status swap
|
backtick 136 19 19 byobu-status swap
|
||||||
backtick 137 23 23 byobu-status time_binary
|
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
|
hardstatus alwayslastline
|
||||||
|
|
||||||
# The following line would turn off alternate Screen switching in xterms,
|
# 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
|
setenv SSH_AUTH_SOCK $BYOBU_CONFIG_DIR/.ssh-agent
|
||||||
|
|
||||||
# Window tabs, second to last line
|
# 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
|
# 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
|
# NOTE: Older version of Screen have an arbitrary limit of only being able
|
||||||
# to change colors 16 times in this 'hardstatus string'.
|
# to change colors 16 times in this 'hardstatus string'.
|
||||||
|
|
|
@ -79,7 +79,7 @@ set -g status-fg white
|
||||||
set -g status-interval 1
|
set -g status-interval 1
|
||||||
set -g status-left-length 256
|
set -g status-left-length 256
|
||||||
set -g status-right-length 256
|
set -g status-right-length 256
|
||||||
set -g status-left '#(byobu-status-tmux left)['
|
set -g status-left '#(byobu-status-tmux tmux_left)['
|
||||||
set -g status-right ']#(byobu-status-tmux right)#[default]%Y-%m-%d %H:%M:%S'
|
set -g status-right ']#(byobu-status-tmux tmux_right)#[default]%Y-%m-%d %H:%M:%S'
|
||||||
set -g message-bg magenta
|
set -g message-bg magenta
|
||||||
set -g message-fg white
|
set -g message-fg white
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
color
|
|
|
@ -1,4 +0,0 @@
|
||||||
whoami
|
|
||||||
hostname
|
|
||||||
ip_address
|
|
||||||
menu
|
|
|
@ -1,4 +0,0 @@
|
||||||
color
|
|
||||||
logo
|
|
||||||
release
|
|
||||||
arch
|
|
|
@ -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
|
|
|
@ -1,2 +1,2 @@
|
||||||
statusdir = $(datadir)/@PACKAGE@/status
|
statusdir = $(datadir)/@PACKAGE@/status
|
||||||
status_DATA = 1 2 3 4 status statusrc
|
status_DATA = status statusrc
|
||||||
|
|
|
@ -20,41 +20,12 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
apport=0
|
# Screen has two status lines, with 4 quadrants for status
|
||||||
arch=0
|
screen_upper_left="color"
|
||||||
battery=1
|
screen_upper_right="color whoami hostname ip_address menu"
|
||||||
color=1
|
screen_lower_left="color logo release #arch"
|
||||||
cpu_count=1
|
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"
|
||||||
cpu_freq=1
|
|
||||||
cpu_temp=0
|
# Tmux has one status line, with 2 halves for status
|
||||||
custom=1
|
tmux_left="logo release #arch"
|
||||||
date=1
|
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"
|
||||||
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
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue