Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 1581  / 2 Years ago, tue, july 19, 2022, 9:13:54

When I log into my server, I'm usually greeted with a bunch of stats, like this:



Usual login; stats are shown



But if I enable byobu on login (through byobu-enable), I don't get to see the stats.

I'm immediately presented to byobu when I login:



Byobu login; no stats



Of course, the stats are output, but byobu immediately clears the screen.

Is there any way to see the stats while still having Byobu run at login?


More From » server

 Answers
3

The dynamic statistics that Ubuntu shows normally when you log in are contained in the file /run/motd.dynamic. This file is normally displayed when you log in, but as you correctly noticed, byobu clears the screen so it can't be seen. What you need to do is arrange for that file to be printed when the first byobu shell is started.



One way to accomplish this that works for me is to add the following shell snippet to your ~/.bashrc file. It will run for every new shell process, but the motd will only be shown once in the first tmux window that is started.



if [ -z "$_motd_listed" ]; then
case "$TMUX_PANE" in
%1) cat /run/motd.dynamic
export _motd_listed=yes
;;
*) ;;
esac
fi

[#24956] Thursday, July 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eving

Total Points: 162
Total Questions: 102
Total Answers: 112

Location: Trinidad and Tobago
Member since Thu, Dec 1, 2022
1 Year ago
eving questions
;