Status line support
The latest code in master has a status line. Please test it out and close this issue if it works for you. Thanks!
Will the status line be customizable?
Will the status line be customizable?
It is now. Check out the latest code. You can give mtm a filename and it will read the contents of that file periodically and put them in the status line (in front of any window titles). You're free to put whatever you want in the file.
Please close this issue if you think this solves it. Thanks!
I don’t see how it could be useful.
Can you give me some usage?
For example, I have this in my .Xsession:
while true ; do
DATE=$(date)
BATTERY=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage)
echo "${DATE} ${BATTERY}" > ~/.status
sleep 60
done
Then I invoke mtm like this:
mtm -s ~/.status
Now I have the current date, time, and laptop battery percentage in the status bar updated every minute, along with whatever window title is set by the focused virtual terminal.
I would like to add Git status line, using working directory of active pane.
You could modify your shell's prompt command to run git-status and put the output in the title bar using the title-setting escape sequence. How you'd do that would depend on what shell you're using.
I don’t want Git information in my shell prompt, but rather delegate to the WM or TM status bar I’m using.
In i3 I do something like that.
That enables some ubiquity and DRY, because you always have the information accurate to what you focus, no matter if you are in your shell, editor or what ever application.
For instance in Kakoune, I just have some hooks on focus changes to update the adapters.
Assuming you use bash (I know you can do it with other shells too), doing something like this:
PROMPT_COMMAND='echo -ne "\033]0;`pwd`\007"'
will put your current working directory in mtm's title bar, not your prompt. You could replace "pwd" with whatever command you want (an arbitrarily complex shell script), and thus put whatever you wanted in the title.
mtm is smart enough to display the title for the currently focused window, so different windows can have different titles.
Would be nice if we could just put bash-like escape colors like \x1b[1;33;41m ^-^ \x1b[0m on the status bar. Or a custom escape sequence, easier to implement, like a escape character 0x1b followed by a single byte where each nibble is one of the 16 possible colours for fg and bg, like 0x1b 0xab. And if mtm could get the current terminal width with system("tput cols"), we could have a right aligned status line instead of the actual left-aligned.