Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Whenever I listen to music with Music on Console, the tab will display the song’s title, and it is long, it takes up the entire width of my status bar.

I want to limit X amount of characters displayed on the tabs, what should I put in my configuration file?

share|improve this question
    
My tmux initially did this, but now the tab just stayed named mocp, I'm on debian testing with version 1.5-3 –  Rob Dec 14 '11 at 17:42
add comment

1 Answer

If you are using #() in status-right (or status-left), you can specify a maximum length for the used output of the command by putting a number between the # and the (:

set-option -g status-right '#20(your-command) %H:%M'

Alternatively, you could pipe whatever you are using to generate the music information to cut -c1-20 to only use the first 20 characters:

set-option -g status-right '#(your-command|cut -c1-20) %H:%M'

This may be easier to integrate into your setup if your command’s output has internal sections and you want to limit them individually (i.e. cut the title off at 10 characters and the artist off at 5); although it might be better to break something like that up into multiple uses of #() and give each one a limit as in the first example: #10(current-track-command) #5(current-artist-command).

If your #() is the only thing in your status-right, then you could just use status-right-length instead:

set-option -g status-right '#(your-command)'
set-option -g status-right-length 20

This only works well if you do not have other data in there (like the time: %H:%M, above) that you might want to give priority over the music information.

share|improve this answer
    
Neither of those two helped out. I tried your piping method, but all I got was, "[1;24r[0;10m[4]" on the right-side of my status bar. –  gregor Nov 20 '11 at 12:01
    
You should edit your question to include the method you are using to put the data into your tmux status line (i.e. the value of your status-right, or whatever) and a hex dump of an example of any commands you are using to generate the information (e.g. pipe it to xxd or hd or od -x). –  Chris Johnsen Nov 20 '11 at 12:10
    
There's no method involved, the tab renames itself to have all the song info by itself. Mine used to do that, but doesn't anymore for some reason. 1.5-3 from debian testing. –  Rob Dec 14 '11 at 17:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.