tgraf / bmon

bandwidth monitor and rate estimator
Other
1.2k stars 98 forks source link

How to enable transparent background? #83

Open ghost opened 4 years ago

ghost commented 4 years ago

I try to add this to .bmonrc

layout colors {
    color default {
       color_pair  = {"white", "default"}
    }
    color statusbar {
        color_pair = {"blue", "default", "reverse"}
    }
    color header {
        color_pair = {"yellow", "default"}
    }
    color list {
        color_pair = {"white", "default"}
    }
    color selected {
        color_pair = {"white", "default", "reverse"}
    }
    color RX_graph {
        color_pair = {"green", "default"}
    }
    color TX_graph {
        color_pair = {"red", "default"}
    }
}

but i got this error when run bmon:

Unknown color [bg]: default

When I run bmon -ocurses:nocolors I got the transparent background but other text color is white.

If I modify layout.h here: https://github.com/tgraf/bmon/blob/master/include/bmon/layout.h#L126 to make bg_code = -1, I get the transparent. Not sure why there is a check to prevent bg_code = -1 at line 97.

akblakney commented 1 year ago

I still have this issue. The fix is not to remove the check for bg_code = -1 though. That is there to ensure that a valid color was entered. The problem is that if you look at the valid colors, in parse_color on line 11 of the link you sent, "defualt" is not a valid color, despite the man pages saying that it should be. There seems to be a discrepancy between the man page that allows for "default" as the transparent/background color and the layout.h which does not.