hbspbar

[WIP] bspwm status bar
git clone https://hhvn.uk/hbspbar
git clone git://hhvn.uk/hbspbar
Log | Files | Refs

commit feffd883dce08ada407c67810f522bd2790cb6b0
parent 049e9d9f5265c20e6a43d69327981d32f00ecd54
Author: hhvn <dev@hhvn.uk>
Date:   Thu, 16 Nov 2023 18:44:30 +0000

If a bar's Mon is nil, then don't segfault

Diffstat:
Mbar/bar.go | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bar/bar.go b/bar/bar.go @@ -162,7 +162,9 @@ func (b *bar) draw() { } func (b *bar) destroy() { - b.Mon.TopPadding(0) + if (b.Mon != nil) { + b.Mon.TopPadding(0) + } xproto.DestroyWindow(b.X, b.w) } @@ -274,7 +276,9 @@ func init() { case state = <- Handle.NewState: for _, b := range bars { b.Mon = state.GetMon(b.Mon.ID) - go b.draw() + if b.Mon != nil { + go b.draw() + } } case <- stoploop: return