mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
* usr/lib/byobu/distro, usr/lib/byobu/include/common,
usr/lib/byobu/logo, usr/share/byobu/profiles/bashrc: - save a couple of forks in the fast path - load BYOBU_DISTRO into the environment as we need this in multiple places
This commit is contained in:
parent
37e58c511b
commit
d2431665ba
5 changed files with 20 additions and 13 deletions
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -1,6 +1,10 @@
|
||||||
byobu (5.55) unreleased; urgency=low
|
byobu (5.55) unreleased; urgency=low
|
||||||
|
|
||||||
* UNRELEASED
|
* usr/lib/byobu/distro, usr/lib/byobu/include/common,
|
||||||
|
usr/lib/byobu/logo, usr/share/byobu/profiles/bashrc:
|
||||||
|
- save a couple of forks in the fast path
|
||||||
|
- load BYOBU_DISTRO into the environment as we need this in
|
||||||
|
multiple places
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 07 Aug 2013 12:49:27 +0100
|
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 07 Aug 2013 12:49:27 +0100
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,7 @@ __distro() {
|
||||||
# user defined
|
# user defined
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
get_distro
|
DISTRO="$BYOBU_DISTRO"
|
||||||
DISTRO="$_RET"
|
|
||||||
fi
|
fi
|
||||||
color bold2; printf "%s" "$DISTRO"; color --
|
color bold2; printf "%s" "$DISTRO"; color --
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,5 +57,7 @@ if [ -z "${BYOBU_INCLUDED_LIBS}" ]; then
|
||||||
|
|
||||||
. "${BYOBU_PREFIX}/lib/${PKG}/include/shutil"
|
. "${BYOBU_PREFIX}/lib/${PKG}/include/shutil"
|
||||||
. "${BYOBU_PREFIX}/lib/${PKG}/include/constants"
|
. "${BYOBU_PREFIX}/lib/${PKG}/include/constants"
|
||||||
|
get_distro || true
|
||||||
|
export BYOBU_DISTRO="$_RET"
|
||||||
BYOBU_INCLUDED_LIBS=1
|
BYOBU_INCLUDED_LIBS=1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -31,8 +31,7 @@ __logo() {
|
||||||
printf "%s" "$LOGO"
|
printf "%s" "$LOGO"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
get_distro
|
local distro="$(printf "%s" "$BYOBU_DISTRO" | $BYOBU_SED 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')"
|
||||||
local distro="$(printf "%s" "$_RET" | $BYOBU_SED 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')"
|
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
*ubuntu*)
|
*ubuntu*)
|
||||||
if $MARKUP; then
|
if $MARKUP; then
|
||||||
|
|
|
@ -16,15 +16,18 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Ensure that we're in a tmux or screen session
|
# Ensure that we're in a tmux or screen session
|
||||||
if [ -n "$TMUX" ] || (printf "$TERMCAP" | grep -qs "screen"); then
|
if [ -n "$TMUX" ] || [ "${TERMCAP#*screen}" != "${TERMCAP}" ]; then
|
||||||
# Ensure that we're in bash, in a byobu environment
|
# Ensure that we're in bash, in a byobu environment
|
||||||
if [ -n "$BYOBU_BACKEND" ] && [ "$SHELL" = "/bin/bash" ]; then
|
if [ -n "$BYOBU_BACKEND" ] && [ "$SHELL" = "/bin/bash" ]; then
|
||||||
if [ -z "$DISTRO" ] && grep -qs "^Ubuntu" /etc/issue; then
|
case "$BYOBU_DISTRO" in
|
||||||
# Use Ubuntu colors (grey / aubergine / orange)
|
"Ubuntu")
|
||||||
PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;5m\]\h\[\e[00m\]:\[\e[38;5;172m\]\w\[\e[00m\]❭ "
|
# Use Ubuntu colors (grey / aubergine / orange)
|
||||||
else
|
PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;5m\]\h\[\e[00m\]:\[\e[38;5;172m\]\w\[\e[00m\]❭ "
|
||||||
# Use Byobu colors (green / blue / red)
|
;;
|
||||||
PS1="${debian_chroot:+($debian_chroot)}\[\e[00;32m\]\u\[\e[00m\]@\[\e[00;36m\]\h\[\e[00m\]:\[\e[00;31m\]\w\[\e[00m\]\$ "
|
*)
|
||||||
fi
|
# Use Byobu colors (green / blue / red)
|
||||||
|
PS1="${debian_chroot:+($debian_chroot)}\[\e[00;32m\]\u\[\e[00m\]@\[\e[00;36m\]\h\[\e[00m\]:\[\e[00;31m\]\w\[\e[00m\]\$ "
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue