Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting bg=default instead of displaying color #10

Closed
AnthonyWC opened this issue Apr 4, 2017 · 6 comments
Closed

Getting bg=default instead of displaying color #10

AnthonyWC opened this issue Apr 4, 2017 · 6 comments

Comments

@AnthonyWC
Copy link

I have powerline9k theme; not sure if there's compatible

tmux-top net
#[bg=default,fg=white]W#[bg=default,fg=default] #[bg=default,fg=green]192.168.20.171/24#[bg=default,fg=default]

tmux -V
tmux 2.1
@TomasTomecek
Copy link
Owner

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?

@TomasTomecek
Copy link
Owner

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

@tommyknows
Copy link

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?

@TomasTomecek TomasTomecek reopened this Feb 22, 2018
TomasTomecek added a commit that referenced this issue Feb 22, 2018
Fixes #10

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
@TomasTomecek
Copy link
Owner

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?

@tommyknows
Copy link

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 👍

@TomasTomecek
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants