Allow to set background color for each app button, fix couple comments in sample config

This commit is contained in:
eleksir
2024-01-10 23:49:15 +03:00
parent b0b297bc56
commit 202f277eee
3 changed files with 11 additions and 2 deletions

View File

@@ -120,6 +120,7 @@ type MyConfig struct {
Instance string `json:"instance,omitempty"` Instance string `json:"instance,omitempty"`
Class string `json:"class,omitempty"` Class string `json:"class,omitempty"`
Color string `json:"color,omitempty"` Color string `json:"color,omitempty"`
Background string `json:"background,omitempty"`
Border string `json:"border,omitempty"` Border string `json:"border,omitempty"`
BorderActive string `json:"border_active,omitempty"` BorderActive string `json:"border_active,omitempty"`
Separator bool `json:"separator,omitempty"` Separator bool `json:"separator,omitempty"`
@@ -383,6 +384,10 @@ func readConf() (MyConfig, error) {
app.Color = Conf.Color app.Color = Conf.Color
} }
if app.Background == "" {
app.Background = Conf.Background
}
if app.Border == "" { if app.Border == "" {
app.Border = Conf.Color app.Border = Conf.Color
} }

View File

@@ -1,6 +1,8 @@
{ {
// Default text and *block* background colors // Default text and *block* border colors. If not set #3e78fd is used.
"color" : "#3e78fd", "color" : "#3e78fd",
// Default backbround color. If not set value of #edeceb is used.
"background" : "#000000", "background" : "#000000",
// Load Average // Load Average
@@ -156,6 +158,8 @@
"class": "^Thunar$", "class": "^Thunar$",
// text color in html notation // text color in html notation
"color": "#ffa500", "color": "#ffa500",
// background color in html notation
"background" : "#000000",
// border color in html notation // border color in html notation
"border": "#666666", "border": "#666666",
// border color if there is at least one window with given Instance and/or Class exist // border color if there is at least one window with given Instance and/or Class exist

View File

@@ -136,7 +136,7 @@ func main() {
var b I3BarOutBlock var b I3BarOutBlock
b.FullText = app.FullText b.FullText = app.FullText
b.Background = Conf.Background b.Background = app.Background
b.Color = app.Color b.Color = app.Color
b.Instance = app.Instance b.Instance = app.Instance
b.Markup = `pango` b.Markup = `pango`