Add window title and wm info to Bar
This commit adds the focused window title to the left side of the bar and some WM info (primary count/ratio and # of visible/total windows) to the right side. It also adds new vertical_padding and horizontal_padding config options for the bar.
This commit is contained in:
parent
062748967c
commit
efd0222899
9 changed files with 231 additions and 51 deletions
|
|
@ -188,6 +188,19 @@ fn windowListener(river_window_v1: *river.WindowV1, event: river.WindowV1.Event,
|
|||
utils.gpa.dupe(u8, std.mem.span(t)) catch @panic("Out of memory")
|
||||
else
|
||||
null;
|
||||
|
||||
// Need to update the bar if this window is focused
|
||||
if (window.context.wm.seats.first()) |seat| {
|
||||
if (seat.focused_window) |focused_window| {
|
||||
if (focused_window == window) {
|
||||
if (window.output) |output| {
|
||||
if (output.bar) |*bar| {
|
||||
bar.pending_render.draw = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
.parent => |ev| {
|
||||
// Nothing to do if ev.parent is null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue