Coder Social home page Coder Social logo

Status line support about mtm HOT 10 OPEN

deadpixi avatar deadpixi commented on August 15, 2024
Status line support

from mtm.

Comments (10)

alexherbo2 avatar alexherbo2 commented on August 15, 2024 1

I don’t see how it could be useful.

Can you give me some usage?

from mtm.

deadpixi avatar deadpixi commented on August 15, 2024

The latest code in master has a status line. Please test it out and close this issue if it works for you. Thanks!

from mtm.

alexherbo2 avatar alexherbo2 commented on August 15, 2024

Will the status line be customizable?

from mtm.

deadpixi avatar deadpixi commented on August 15, 2024

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!

from mtm.

deadpixi avatar deadpixi commented on August 15, 2024

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.

from mtm.

alexherbo2 avatar alexherbo2 commented on August 15, 2024

I would like to add Git status line, using working directory of active pane.

from mtm.

deadpixi avatar deadpixi commented on August 15, 2024

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.

from mtm.

alexherbo2 avatar alexherbo2 commented on August 15, 2024

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.

from mtm.

deadpixi avatar deadpixi commented on August 15, 2024

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.

from mtm.

mazeto avatar mazeto commented on August 15, 2024

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.

from mtm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.