If using the tmux
backend for byobu, you will need to use a different format for color codes. Luckily, it's less complicated than the screen
format.
To set colors, use #[<color and attribute codes>]
. Examples:
#[default]
: restore default colors (use at the end of your custom status).
#[fg=red]
: set the foreground color to red.
#[fg=#ff0000]
: set the foreground color to #ff0000
. Only accepts lowercase -- FF0000
won't work.
#[bg=black]
: makes the background black.
#[fg=bold]
: makes text bold. See below for more.
#[reverse]
: swaps foreground/background colors.
You can combine them, e.g. #[fg=white,bold,bg=black]
.
Named colors: black
, red
, green
, yellow
, blue
, magenta
, cyan
, white
, black
, brightblack
, brightred
, brightgreen
, brightyellow
, brightblue
, brightmagenta
, brightcyan
, brightwhite
Attributes: dim
, underscore
, bold
, reverse
, standout
, blinking
, hidden
, italics
You can also use the environment variables $BYOBU_LIGHT
, $BYOBU_DARK
, $BYOBU_ACCENT
, and $BYOBU_HIGHLIGHT
as colors.
To play with this, create a file, ~/.byobu/bin/1_hello
with the following contents, and make it executable.
#!/bin/sh
echo "#[reverse]Hello world#[default]"
This should create a black-on-white status notification that says "Hello world".
Here are two example custom status bar components, and the codes that produce them:
#[fg=#aa77cc,bg=#222222] @XXX.XX #[default]
#[fg=white,bg=black] ✉ ️X #[default]
This information will probably only work if you're using tmux
and a color-enabled shell, though :)
(Sources: /usr/lib/byobu/include/colors
, /usr/lib/byobu/include/shutil
)
Not easily, no. Unfortunately, tmux only supports a single status line at a time. That's a function of tmux, and not byobu.
What you can do, however, is configure multiple status lines and cycle through them using shift-F5. You'll only be able to see one at a time, but you can cycle through them with a single keystroke.
You can define and customize these in your ~/.byobu/status
file. Here's a snippet:
# Tmux has one status line, with 2 halves for status
# 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"
tmux_left=" logo #distro release #arch"
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"
Best Answer
In you case, you have explicitly disabled your status line, as you can tell by the flag file
status.disable
. You can either remove this file or runbyobu-quiet --undo
.It looks like you figured this out and answered your own question in the comment. As to your new question in your comment, we have disabled a few of the infrequently used and hard to maintain menu options, which includes the background/foreground color setting.
To set the foreground/background colors, you have two options now:
$HOME/.byobu/color.tmux
Full disclosure: I'm the author and maintainer of Byobu.