Giter VIP home page Giter VIP logo

Comments (6)

TomasTomecek avatar TomasTomecek commented on August 11, 2024

I am running tmux 2.3 with no issues - I haven't actually touch this code for a loooooong time.

Does the coloring work when you paste the output directly to .tmux.conf?

from tmux-top.

TomasTomecek avatar TomasTomecek commented on August 11, 2024

Closing, since this is more than 6 months old. Feel free to reopen.

from tmux-top.

tommyknows avatar tommyknows commented on August 11, 2024

I have this in my tmux-top config:

  "net": {
    "interfaces": {
      "enp0s31f6": {
        "alias": ""
      },
      "wlp4s0": {
        "alias": ""
      }
    }

Which, should yield in a "colorless" config, I assume.
My problem is, that instead I get this:

#[bg=,fg=]#[bg=default,fg=default] #[bg=,fg=]10.249.100.125/24#[bg=default,fg=default] #[bg=,fg=]#[bg=default,fg=default] #[bg=,fg=]10.249.103.162/24#[bg=default,fg=default]

But I would want this:

#[bg=,fg=]#[bg=,fg=] #[bg=,fg=]10.249.100.125/24#[bg=,fg=] #[bg=,fg=]#[bg=,fg=] #[bg=,fg=]10.249.103.162/24#[bg=,fg=]

Without any default colors, as I want my tmux-conf to handle those.
How can I configure tmux-top to not write any color?

from tmux-top.

TomasTomecek avatar TomasTomecek commented on August 11, 2024

looking at code, this is hardcoded:

https://github.com/TomasTomecek/tmux-top/blob/master/display/display.go#L14

I can easily get rid of the part where formatting is reset. Should it be set to an empty string or removed completely?

from tmux-top.

tommyknows avatar tommyknows commented on August 11, 2024

It would be cleaner to remove the [bg=,fg=] thing completely, but it works just fine with an empty string.

I pulled your fix-10 branch, it works fine like that.

My new tmux-conf:

$ cat ~/.tmux-top                                                                                                                                                                               
{
  "net": {
    "interfaces": {
      "enp0s31f6": {
        "alias": "",
        "label_color_fg": "black",
        "address_color_fg": "black"
      },
      "wlp4s0": {
        "alias": "",
        "label_color_fg": "black",
        "address_color_fg": "black"
      }
    }
  },
  "sensors": {
    "template": "{{range $i, $device := .Devices}}{{if eq .Name \"coretemp\"}}CPU: {{range $j, $e := $device.Stats}}{{if eq $e.Label \"Package id 0\"}}{{$e.CurrentTemp}}{{end}}{{end}}{{end}}{{end}}"
  }
}

(I thought, managing the font-colors in the config makes sense, as tmux-top m sets the font color depending on what percentage of RAM is used)

But, regarding memory, it sets the colors automatically (whereas the network does not). I want the background of tmux-top m transparent as well, so how can I remove those?

Thanks 👍

from tmux-top.

TomasTomecek avatar TomasTomecek commented on August 11, 2024

But, regarding memory, it sets the colors automatically (whereas the network does not). I want the background of tmux-top m transparent as well, so how can I remove those?

You mean to remove the functionality which changes background based on amount of missing memory? This is the config tmux-top uses by default for memory:

	"mem": {
		"intervals": [{
			"to": "50%",
			"bg_color": "default",
			"fg_color": "colour10"
		}, {
			"from": "50%",
			"to": "75%",
			"bg_color": "default",
			"fg_color": "green"
		}, {
			"from": "75%",
			"to": "85%",
			"bg_color": "default",
			"fg_color": "colour166"
		}, {
			"from": "85%",
			"to": "93%",
			"bg_color": "default",
			"fg_color": "colour1"
		}, {
			"from": "93%",
			"to": "97%",
			"bg_color": "colour166",
			"fg_color": "white"
		}, {
			"from": "97%",
			"bg_color": "colour1",
			"fg_color": "white"
		}],
		"separator": "/",
		"separator_bg": "default",
		"separator_fg": "white",
		"total_bg": "default",
		"total_fg": "colour14"
	},

You can change it as you wish.

from tmux-top.

Related Issues (14)

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.