diff --git a/src/bar.cpp b/src/bar.cpp index fab5a8f..4889c1a 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -142,6 +142,16 @@ void Bar::setTag(int tag, int state, int numClients, int focusedClient) t.focusedClient = focusedClient; } +uint32_t Bar::getSelectedTagNumClients() +{ + for (auto &tag : _tags) { + if (tag.state == TagState::Active) { + return tag.numClients; + } + } + return 0; +} + void Bar::setSelected(bool selected) { _selected = selected; @@ -247,11 +257,11 @@ void Bar::renderTags() renderComponent(tag.component); auto indicators = std::min(tag.numClients, static_cast(_bufs->height/2)); for (auto ind = 0; ind < indicators; ind++) { - auto w = ind == tag.focusedClient ? 7 : 1; + auto w = ind == tag.focusedClient ? 7 : 3; cairo_move_to(_painter, tag.component.x, ind*2+0.5); cairo_rel_line_to(_painter, w, 0); cairo_close_path(_painter); - cairo_set_line_width(_painter, 1); + cairo_set_line_width(_painter, 3); cairo_stroke(_painter); } } diff --git a/src/bar.hpp b/src/bar.hpp index 176a1bc..1c8c31e 100644 --- a/src/bar.hpp +++ b/src/bar.hpp @@ -65,6 +65,7 @@ public: void show(wl_output* output); void hide(); void setTag(int tag, int state, int numClients, int focusedClient); + uint32_t getSelectedTagNumClients(); void setSelected(bool selected); void setLayout(const std::string& layout); void setTitle(const std::string& title); diff --git a/src/main.cpp b/src/main.cpp index 01be870..1ceec79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -246,7 +246,16 @@ static const struct znet_tapesoftware_dwl_wm_monitor_v1_listener dwlWmMonitorLis }, .layout = [](void* mv, znet_tapesoftware_dwl_wm_monitor_v1*, uint32_t layout) { auto mon = static_cast(mv); - mon->bar.setLayout(layoutNames[layout]); + if (layout == 2) { + char lout[4] = "[M]"; + uint32_t numc = mon->bar.getSelectedTagNumClients(); + if (numc > 0) { + sprintf(lout, "[%d]", numc); + } + mon->bar.setLayout(lout); + } else { + mon->bar.setLayout(layoutNames[layout]); + } }, .title = [](void* mv, znet_tapesoftware_dwl_wm_monitor_v1*, const char* title) { auto mon = static_cast(mv);