Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

byobu-like status bar #1240

Open
Alessandro-Barbieri opened this issue Mar 18, 2022 · 15 comments
Open

byobu-like status bar #1240

Alessandro-Barbieri opened this issue Mar 18, 2022 · 15 comments
Labels
plugin system Enhancement or fixes related to plugin system plugin Issue related to plugins

Comments

@Alessandro-Barbieri
Copy link

Alessandro-Barbieri commented Mar 18, 2022

I really like byobu and it's status bar
This is what it looks like
https://i.ytimg.com/vi/NawuGmcvKus/maxresdefault.jpg

This is the list of features taken from the manpage

byobu supports a number of unique and interesting status notifications across  the  lowest
       two  lines  in  the  screen.  Each status notification item is independently configurable,
       enabled and disabled by the configuration utility.  The guide below  helps  identify  each
       status item (in alphabetical order):

       apport  - symbol displayed if there are pending crash reports; {!} symbol displayed on the
       lower bar toward the left, in black on an orange background

       arch - system architecture; displayed on the lower bar toward the  left,  in  the  default
       text color on the default background color

       battery  -  battery  information;  display  on the lower bar toward the right; - indicates
       discharging,  +  indicates  charging,  =  indicates  fully  charged;   when  charging   or
       discharging,  the  current  battery  capacity  as  a percentage is displayed;  the colours
       green, yellow, and red are used to give further indication of the battery's charge  state;
       you  may  override  the  detected  battery  by  setting BATTERY=/proc/acpi/battery/BAT0 in
       $BYOBU_CONFIG_DIR/statusrc

       cpu_count - the number of cpu's or cores on the system; displayed in the lower bar  toward
       the right in the default text color on the default background, followed by a trailing 'x'

       cpu_freq  - the current frequency of the cpu in GHz; displayed in the lower bar toward the
       right in white text on a light blue background

       cpu_temp - the cpu temperature in Celsius (default) or  Fahrenheit,  configure  TEMP=F  or
       TEMP=C  in  $BYOBU_CONFIG_DIR/statusrc;  displayed  in  the  lower bar toward the right in
       yellow text on a black background; you may override the detected cpu temperature device by
       setting MONITORED_TEMP=/proc/acpi/whatever in $BYOBU_CONFIG_DIR/statusrc

       custom  -  user  defined  custom  scripts;  must  be  executable  programs  of any kind in
       $BYOBU_CONFIG_DIR/bin; must be named N_NAME, where  N  is  the  frequency  in  seconds  to
       refresh  the  status  indicator,  and NAME is the name of the script; N should not be less
       than 5 seconds; the script should echo a small amount of text to  standard  out,  standard
       error is discarded; the indicator will be displayed in the lower panel, in default colors,
       unless you manually specify the colors in  your  script's  output;  BEWARE,  cpu-intensive
       custom  scripts  may  impact  your  overall system performance and could upset your system
       administrator!  In fact, you can easily copy and modify any status script usually found in
       [/usr/lib/byobu/](file:///usr/lib/byobu/)* to your local $HOME/.byobu/ directory.
         Example: $BYOBU_CONFIG_DIR/bin/1000_uname
           #![/bin/sh](file:///usr/lib/w3m/cgi-bin/w3mman2html.cgi?sh)
           printf "\005{= bw}%s\005{-}" "$(uname -r)"

       date  - the system date in YYYY-MM-DD format, or you can set this to any valid [strftime](https://manpages.ubuntu.com/manpages/jammy/en/man3/strftime.3.html)(3)
       you like in $BYOBU_CONFIG_DIR/datetime; displayed in the lower on the  far  right  in  the
       default text color on the default background

       disk  -  total  disk space available and total used on / directory; displayed in the lower
       bar on the far right in white text on a light  purple  background;  override  the  default
       directory  by  specifying  an  alternate  mount  point  with  MONITORED_DISK=/wherever  in
       $BYOBU_CONFIG_DIR/statusrc

       disk_io - instantaneous read/write througput in kB/s or MB/s  over  the  last  3  seconds;
       displayed  in  the  lower  bar toward the right in white text on a light purple background
       with a leading '<' sign indicating 'read speed' and '>'  sign  indicating  'write  speed';
       override   the   default   monitored   disk   by   specifying  an  alternate  device  with
       MONITORED_DISK=/dev/sdb,  and  override  the  default   DISK_IO_THRESHOLD=50   (kB/s)   in
       $BYOBU_CONFIG_DIR/statusrc

       distro  - OS/distribution name of the release running on the current system as reported by
       [lsb_release](https://manpages.ubuntu.com/manpages/jammy/en/man1/lsb_release.1.html)(1) or [/etc/issue](file:///etc/issue); displayed in the lower bar in bold  black  text  toward  the
       left  on  a grey background; you may override the detected release with DISTRO=Whatever in
       $BYOBU_CONFIG_DIR/statusrc

       entropy - a count of the system's current entropy in bytes; displayed  in  the  lower  bar
       toward  the  right  in  yellow  text  on a dark grey background; there is a leading 'e' to
       indicate 'entropy'

       raid - note very prominently if there is a RAID failure detected, in red blinking text  on
       a white background; the term 'RAID' notes that there is something wrong with the RAID, and
       if there is a rebuild/resync in progress, the percent complete is also shown

       fan_speed - cpu or system fan speed as reported by lm-sensors; displayed in the lower  bar
       toward  the right in black text on a grey background; there is a trailing 'rpm' for units;
       you  may  override  the  detected  fan  by  setting  FAN=/sys/path/to/your/fan1_input   in
       $BYOBU_CONFIG_DIR/statusrc

       hostname - 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

       ip_address - 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 $BYOBU_CONFIG_DIR/statusrc

       ip_address4 - 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 show your
       external ip address by setting 'IP_EXTERNAL=1' in $BYOBU_CONFIG_DIR/statusrc

       ip_address6 - the IPv6 address of the system; displayed in the upper bar on the far  right
       in bold black text on a grey background;  you can show your external ip address by setting
       'IP_EXTERNAL=1' in $BYOBU_CONFIG_DIR/statusrc

       load_average - the system load average over the last 1 minute; displayed in the lower  bar
       toward the right in black text on a yellow background

       logo - an approximation of the current operating system's logo; displayed in the lower bar
       on the far left; you may customize this logo by setting a chosen  logo  with  LOGO=:-D  in
       $BYOBU_CONFIG_DIR/statusrc

       mail  -  system  mail for the current user; the letter '[M]' is displayed in the lower bar
       toward the left in black text on a grey background

       memory - total memory available and used percentage in the system; displayed in the  lower
       bar toward the right in white text on a green background

       menu - a simple indicator directing new users to use the F9 keybinding to access the byobu
       menu

       network - instantaneous upload/download bandwidth in [GMk]bps over  the  last  3  seconds;
       nothing  is displayed if traffic is 0; displayed in the lower bar toward the left in white
       text on a purple background  with  a  leading  '^'  sign  indicating  'up'  and  'v'  sign
       indicating  'down';  override  the  default interface by specifying an alternate interface
       with   MONITORED_NETWORK=eth1,   and   override   the   default    units    (bits)    with
       NETWORK_UNITS=bytes,   and   override   the   default   NETWORK_THRESHOLD=20   (kbps)   in
       $BYOBU_CONFIG_DIR/statusrc

       notify_osd - Send on-screen notification messages to screen's notification buffer

       processes - total number of processes running on the system; displayed in the lower bar in
       white  text  on  a  dark  yellow  background  with  a  trailing '&' indicating 'background
       processes'

       reboot_required - symbol present if a  reboot  is  required  following  a  system  update;
       displayed  in  the  lower  bar  white  text  on  a  blue  background  by the symbol '(R)';
       additionally, reboot_required will print '<F5>' in white text on  a  blue  background,  if
       Byobu  requires  you to reload your profile to affect some changes; it will also detect if
       your system is currently in [powernap](https://manpages.ubuntu.com/manpages/jammy/en/man8/powernap.8.html)(8) state and if so print '.zZ';  if  your  system  is
       currently  performing  an [unattended-upgrade](https://manpages.ubuntu.com/manpages/jammy/en/man1/unattended-upgrade.1.html)(1) you will see a white warning sign on a red
       background.

       release - OS/distribution name of the release running on the current system as reported by
       [lsb_release](https://manpages.ubuntu.com/manpages/jammy/en/man1/lsb_release.1.html)(1)  or  [/etc/issue](file:///etc/issue);  displayed  in the lower bar in bold black text toward the
       left on a grey background; you may override the detected release with RELEASE=Whatever  in
       $BYOBU_CONFIG_DIR/statusrc;  you may also abbreviate the release string to N characters by
       setting RELEASE_ABBREVIATED=N in $BYOBU_CONFIG_DIR/statusrc

       services - users can configure a list of services to monitor, define the SERVICES variable
       in  $BYOBU_CONFIG_DIR/statusrc,  a  whitespace  separated of services, each service should
       include the init name of the service, then a pipe, and then an abbreviated name or  symbol
       to display when running (e.g. SERVICES="ssh|ssh apache2|http"); displayed in the lower bar
       toward the center in cyan on a white background

       session - byobu session name (only supported in [byobu-tmux](https://manpages.ubuntu.com/manpages/jammy/en/man1/byobu-tmux.1.html)(1)); displayed in the lower bar
       on the left in underlined black text on a white background

       swap  -  total swap space and total used as a percentage of the total available; displayed
       in the lower bar toward the right in black  text  on  a  light  green  background  with  a
       trailing '%' sign

       time  -  the system time in HH:MM:SS format (by default), or you can set this to any valid
       [strftime](https://manpages.ubuntu.com/manpages/jammy/en/man3/strftime.3.html)(3) you like in $BYOBU_CONFIG_DIR/datetime; displayed in the lower bar on the  far
       right in the default text and default background colors

       time_binary - only for the hard core geek, the local system time in binary; requires UTF-8
       support in a VERY recent version of GNU Screen; displayed in the  lower  bar  on  the  far
       right in the default text and background colors

       time_utc  -  the  UTC  system  time in HH:MM format; displayed in the lower bar on the far
       right in dark text on a light background

       updates_available - the number of updates available on the system; displayed in the  lower
       bar  toward  the  right in white text on a red background with a trailing '!' sign; if any
       updates are marked 'security updates',  then  there  will  be  a  total  of  two  trailing
       exclamation points, '!!'

       uptime  -  the  total system uptime since last boot; displayed in the lower bar toward the
       right in blue text on a grey background

       users - the number of remote users logged into the system via  sshd,  empty  if  0  users;
       displayed  in  the  lower  bar  toward  the  right in red text on a grey background with a
       trailing '#' sign; set USERS_DISTINCT=1 to instead count  the  number  of  distinct  users
       logged into the system (rather than open ssh sessions)

       whoami  -  the  name  of  the user who owns the screen session; displayed in the upper bar
       toward the far right in bold black text on a grey background

       wifi_quality - the connection rate and signal quality of the wifi connection; displayed in
       the  lower bar toward the right in black text on a cyan background; the connection rate is
       in 'Mb/s' and the signal quality is as a percentage with  a  trailing  '%';  override  the
       default  interface  by  specifying  an alternate interface with MONITORED_NETWORK=wlan0 in
       $BYOBU_CONFIG_DIR/statusrc

It would be great to have them in zellij too

@imsnif
Copy link
Member

imsnif commented Mar 18, 2022

Maybe we can give these as APIs to plugins and then have an additional built-in plugin that supports this? What does @TheLostLambda think?

@a-kenji
Copy link
Contributor

a-kenji commented Mar 18, 2022

With #317 we could implement close to everything there into our status bar.

@a-kenji a-kenji added plugin Issue related to plugins plugin system Enhancement or fixes related to plugin system labels Mar 18, 2022
@imsnif
Copy link
Member

imsnif commented Mar 18, 2022

With #317 we could implement close to everything there into our status bar.

How? Isn't the main thing here providing APIs for these?

@TheLostLambda
Copy link
Member

With #317 we could implement close to everything there into our status bar.

How? Isn't the main thing here providing APIs for these?

Yes, but that part is super easy compared to getting configs working (which now seems blocked behind moving KDL). That's as far as I can tell at least!

@imsnif
Copy link
Member

imsnif commented Mar 18, 2022

But why do we need configs for this? Like for sure - it will be cool to be able to configure this, true. But isn't that an extension to getting it to basically work?

@a-kenji
Copy link
Contributor

a-kenji commented Mar 18, 2022

I don't think so. The main thing is showing the information the user wants. That's why we need a good path for configuration. The plugins can be allowed currently to request this information by themselves.

@imsnif
Copy link
Member

imsnif commented Mar 18, 2022

I don't think so. The main thing is showing the information the user wants. That's why we need a good path for configuration. The plugins can be allowed currently to request this information by themselves.

So in your opinion, there is no sane default here? Even just copying the byobu screenshot and including it as an alternative status bar?

@a-kenji
Copy link
Contributor

a-kenji commented Mar 18, 2022

I don't think so. The main thing is showing the information the user wants. That's why we need a good path for configuration. The plugins can be allowed currently to request this information by themselves.

So in your opinion, there is no sane default here? Even just copying the byobu screenshot and including it as an alternative status bar?

Honestly? Not really. If someone wants to do it, it would be a cool option to load of course. But realistically close to every plugin is held back by the configuration currently. And especially a sort of status bra that should show what people want. As soon as someone builds it and a second person wants to use it they will ask how can I not show the battery for example, or a different module. And that would be a totally separate plugin
We can realistically change our existing plugin to be able to show it in this style. Which I believe is a more worthwhile endeavour.

@imsnif
Copy link
Member

imsnif commented Mar 18, 2022

I get what you're saying. If I were to prioritize my own work I'd do it as you say. But it would be a pity if every change anyone wants to make to the plugins would be blocked by this one big issue.

@TheLostLambda
Copy link
Member

@a-kenji Would you like to help with moving all of configuration to KDL? I'm happy to help as well, but I think we have a really fully fleshed out config already, we just need the code for loading it.

Once KDL is out the door, plugin config is next, then we can power on from there?

@TheLostLambda
Copy link
Member

I get what you're saying. If I were to prioritize my own work I'd do it as you say. But it would be a pity if every change anyone wants to make to the plugins would be blocked by this one big issue.

We can work on adding these APIs in parallel, even if a useful bar needs both issues solved

@a-kenji
Copy link
Contributor

a-kenji commented Mar 18, 2022

@a-kenji Would you like to help with moving all of configuration to KDL? I'm happy to help as well, but I think we have a really fully fleshed out config already, we just need the code for loading it.

Once KDL is out the door, plugin config is next, then we can power on from there?

Sure, hmu on matrix? Maybe it's even easier the other way, depending on how we are adding kdl.

Since the pr is currently for yaml and if we change it to kdl the main change will be annotations and moving stuff around. Not the actual logic, since we are already dealing with deserialized data.

@TheLostLambda
Copy link
Member

Sure, hmu on matrix? Maybe it's even easier the other way, depending on how we are adding kdl.

Whoops, have I missed things being on Matrix? I think I'm only on the Discord at the moment!

@a-kenji
Copy link
Contributor

a-kenji commented Mar 18, 2022

Sure, hmu on matrix? Maybe it's even easier the other way, depending on how we are adding kdl.

Whoops, have I missed things being on Matrix? I think I'm only on the Discord at the moment!

Sure! That is also fine.

@Marzal
Copy link

Marzal commented Feb 22, 2023

Hi, I think zellig is a great proyect, the main thing I miss is this functionality.

Any update in Issue?

And thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin system Enhancement or fixes related to plugin system plugin Issue related to plugins
Projects
None yet
Development

No branches or pull requests

5 participants