Tmux status bar configuration

How is the status bar configured? I noticed in this youtube video (at 3:05 - the image below), the status bar looks very different than the default that I see after installing tmux on my Mac OS X.

In particular, I like how the current program is displayed in the middle of the status bar, and only the name of the current session is displayed on the left side. For comparison, my installation shows the name of all sessions and does not show the current application (for the current focused panel).

If someone can show me a configuration sample that could do this or show me where I can find the configuration rules, that would be great! Thank!

enter image description here

Update . In case someone is interested, I managed to set up a status bar similar to the one visible in the video (small settings), and you can find my configuration file in my github if you want to see an example.

+50
configuration tmux
Mar 09 '12 at 3:12
source share
4 answers

The man page has a very detailed description of all the various parameters (the status bar is customizable). It is best to read man tmux and pay particular attention to those parameters that begin with status- .

So, for example, status-bg red set the background color on the panel.

The three panel components, the left and right sections and the window list in the middle can be customized to your preference. status-left and status-right , in addition to having their own variables (for example, #S to display the session name), can also call custom scripts to display, for example, system information, such as average load or battery life.

The ability to rename windows or panels based on what is currently running on them is automatic-rename . You can install or disable it globally:

 setw -g automatic-rename [on | off] 

The easiest way to simplify creating your own status bar is to start with vanilla, and then add the changes step by step, reloading the configuration when you go. one

You can also take a look around on github or bitbucket for other conf conf files to provide some inspiration. You can see mine here 2 .





1 You can automate this by including this line in your .tmux.conf :

 bind R source-file ~/.tmux.conf \; display-message "Config reloaded..." 

You can then test your new features with Ctrl b , Shift r . tmux print a useful error message - including the line number of the chipper - if you configure the parameter incorrectly.

2 Note. I call another status bar depending on whether I am in X or the console - I find this very useful.

+64
Mar 09 '12 at 7:21
source share

I used tmux-powerline to completely narrow the tmux status bar. I was googling in order to change the background in the status bar when entering the tmux command. When I came across this post, I thought I should mention this for completeness.

Update . This project is in maintenance mode, and no future functionality is likely to be added. tmux-powerline, with all other powerline projects, is being replaced by the new unifying powerline . However, this project is still operational and may serve as an easy alternative for non-python users.

+28
Nov 01
source share

Today I play with tmux, trying to configure a little here and there, I managed to get battery information showing the status on the right with a ruby ​​script.

Copy the ruby ​​script from http://natedickson.com/blog/2013/04/30/battery-status-in-tmux/ and save it as:

  battinfo.rb in ~/bin 

To make it executable, be sure to run:

 chmod +x ~/bin/battinfo.rb 

edit the ~ / .tmux.config file and include this line

 set -g status-right "#[fg=colour155]#(pmset -g batt | ~/bin/battinfo.rb) | #[fg=colour45]%d %b %R" 
+4
Sep 28 '14 at 10:26
source share

Make Cb :show , which will show you all your current settings. /green , nnn will find you what properties were set to green, by default. Make Cb :set window-status-bg cyan , and the bottom panel should change color.

List of available colors for tmux

You can tell more easily by name and color, since they are really installed in your live session :show , than, for example, by searching the man page. This is a very well written man page when you have time.

If you do not like one of your changes, and you cannot remember how it was originally installed, you can open a new tmux session. To change the settings for good editing ~/.tmux.conf using a string like set window-status-bg -g cyan . Here is mine: https://gist.github.com/9083598

+1
Feb 19
source share



All Articles