tgraf / bmon

bandwidth monitor and rate estimator
Other
1.18k stars 96 forks source link

Allow numeric colors in bmonrc #62

Closed afh closed 6 years ago

afh commented 6 years ago

Hi, I'm using a $TERM that supports 256 colors and I'd love to be able to style bmon accordingly. Unfortunately I found that only the eight standard ASCII color names are available; the proposed changes allow numerical values (e.g. 123) to be specified for the color_pair directive.

I look forward to feedback regarding:

Here's an example ~/.bmonrc

layout colors {
    color default {
       color_pair  = {"white", "black"}
    }
    color statusbar {
        color_pair = {"green", "white"}
    }
    color header {
        color_pair = {"black", "white"}
    }
    color list {
        color_pair = {"15", "black", "reverse"}
    }
    color selected {
        color_pair = {"white", "black", "reverse"}
    }
    color RX_graph {
        color_pair = {"150", "black", "reverse"}
    }
    color TX_graph {
        color_pair = {"203", "black", "reverse"}
    }
}

… and the resulting bmon:

bmon-numeric-colors
tgraf commented 6 years ago

Look great, nice colors 👍

afh commented 6 years ago

Thanks for merging so quickly!

The colors are Than Schoonover's solarized colors; here's an updated version of ~/.bmonrc that includes further improvements

layout colors {
    color default {
       color_pair  = {"8", "15"}
    }
    color statusbar {
        color_pair = {"green", "white"}
    }
    color header {
        color_pair = {"8", "white"}
    }
    color list {
        color_pair = {"15", "8", "reverse"}
    }
    color selected {
        color_pair = {"white", "8", "reverse"}
    }
    color RX_graph {
        color_pair = {"150", "15", "reverse"}
    }
    color TX_graph {
        color_pair = {"203", "15", "reverse"}
    }
}