-
Notifications
You must be signed in to change notification settings - Fork 9
Add config.go #3
Comments
There are other such values (see: #1), I'll try creating something like this. I'm still not sure what the best format would be, would individual blocks (their colors and such) also be configurable ins such a way? |
Furthermore should it be possible to disable entire blocks from this config file? Example, what if someone doesn't use mpd and wants to disable the music bar (#2). |
I think that'd be the best approach, although it'd be simpler if we change the bar's var blocks = []*Block{
&Block{
txt: "foo",
w: 10,
align: 'r',
xoff: 2,
bg: "#445967",
fg: "#CCCCCC",
actions: map[string]func() error{
"button1": func() error { return foo() },
"button2": func() error { return bar() },
},
},
&Block{
txt: "biz",
w: 15,
align: 'a',
xoff: 0,
bg: "#3C4F5B",
fg: "#CCCCCC",
actions: map[string]func() error{
"button1": func() error { return foo() },
"button2": func() error { return bar() },
},
},
} which then each can be moved around and put together with a simpler |
I've been working on something like this, an example of the "clock block": blocks.Set("clock", &Block{
txt: "?",
w: 799,
align: 'a',
xoff: 0,
bg: xgraphics.BGRA{B: 103, G: 89, R: 68, A: 0xFF},
fg: xgraphics.BGRA{B: 204, G: 204, R: 204, A: 0xFF},
update: func() {
for {
block, _ := blocks.Get("clock")
block.(*Block).txt = time.Now().Format(
"Monday, January 2th 03:04 PM")
// Redraw the block.
bar.redraw <- block.(*Block)
// Update every 45 seconds.
time.Sleep(45 * time.Second)
}
},
}) |
And there's still no config.go. Reality is cruel. |
it's just under a different name: https://github.com/onodera-punpun/melonbar/blob/master/blocks.go |
I'd suggest a file with some customizable values in the same vein of suckless programs, for example:
The text was updated successfully, but these errors were encountered: