mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 05:53:22 -07:00
* usr/bin/byobu, usr/lib/byobu/ip_address, usr/share/man/man1/byobu.1:
- support IP_EXTERNAL fetching, LP: #873736 - put ip address in the terminal title bar, since we ran out of room for it in tmux
This commit is contained in:
parent
5527be3f11
commit
3dd87d8db3
4 changed files with 25 additions and 10 deletions
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -1,6 +1,9 @@
|
|||
byobu (4.43) unreleased; urgency=low
|
||||
|
||||
* UNRELEASED
|
||||
* usr/bin/byobu, usr/lib/byobu/ip_address, usr/share/man/man1/byobu.1:
|
||||
- support IP_EXTERNAL fetching, LP: #873736
|
||||
- put ip address in the terminal title bar, since we ran out of room
|
||||
for it in tmux
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 21 Oct 2011 13:43:57 -0500
|
||||
|
||||
|
|
|
@ -63,7 +63,9 @@ fi
|
|||
byobu-janitor --force
|
||||
|
||||
# Set the window title
|
||||
[ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@${HOSTNAME:-$(hostname)} - ${PKG}\007"
|
||||
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc"
|
||||
. $BYOBU_PREFIX/lib/$PKG/ip_address
|
||||
[ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@${HOSTNAME:-$(hostname)} ($(__ip_address t)) - ${PKG}\007"
|
||||
|
||||
# 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
|
||||
|
|
|
@ -38,14 +38,20 @@ __ip_address() {
|
|||
fi
|
||||
case "$IPV6" in
|
||||
1|true|yes)
|
||||
ipaddr=$(LC_ALL=C /sbin/ip -6 addr list dev "$interface" scope global)
|
||||
# Print 'None' if we have no global address
|
||||
[ -z "$ipaddr" ] && ipaddr="None"
|
||||
ipaddr=${ipaddr#* inet6 }
|
||||
ipaddr=${ipaddr%%/*}
|
||||
if [ "$IP_EXTERNAL" = "1" ]; then
|
||||
ipaddr=$(wget -O- -q http://v6.ipv6-test.com/api/myip.php)
|
||||
else
|
||||
ipaddr=$(LC_ALL=C /sbin/ip -6 addr list dev "$interface" scope global)
|
||||
# Print 'None' if we have no global address
|
||||
[ -z "$ipaddr" ] && ipaddr="None"
|
||||
ipaddr=${ipaddr#* inet6 }
|
||||
ipaddr=${ipaddr%%/*}
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if metadata_available; then
|
||||
if [ "$IP_EXTERNAL" = "1" ]; then
|
||||
ipaddr=$(wget -O- -q http://v4.ipv6-test.com/api/myip.php)
|
||||
elif metadata_available; then
|
||||
# We're in EC2, so get our public IP address
|
||||
ipaddr=$(wget -q -O- http://169.254.169.254/latest/meta-data/public-ipv4)
|
||||
else
|
||||
|
@ -56,7 +62,11 @@ __ip_address() {
|
|||
;;
|
||||
esac
|
||||
if [ -n "$ipaddr" ]; then
|
||||
color bold2; printf "%s" "$ipaddr"; color --
|
||||
if [ "$1" = "t" ]; then
|
||||
printf "%s" "$ipaddr"
|
||||
else
|
||||
color bold2; printf "%s" "$ipaddr"; color --
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ Note that BYOBU_CONFIG_DIR=\fI$XDG_CONFIG_HOME/byobu\fP if defined, and \fI$HOME
|
|||
|
||||
\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$BYOBU_CONFIG_DIR/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', and you can show your external ip address by setting 'IP_EXTERNAL=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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue