From aef9a14cf996e2e3bf2565eb1f2726bebe674bc1 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 5 Feb 2025 13:08:44 +0800 Subject: [PATCH] optimize: change to general waybar --- README.md | 7 ------- main.c | 45 ++++++++++++++++++--------------------------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 2ede224..13d4400 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,6 @@ sudo ninja -C build install ``` yay -S wofi foot -``` -# waybar (must use this waybar) -``` -git clone https://gitee.com/DreamMaoMao/Waybar.git -cd Waybar -meson build -Dprefix=/usr -sudo ninja -C build install ``` # thanks for some refer repo diff --git a/main.c b/main.c index 3ff7a75..14ec74f 100644 --- a/main.c +++ b/main.c @@ -2337,33 +2337,24 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) { focused = focustop(monitor); zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon); - if ((monitor->tagset[monitor->seltags] & TAGMASK) == TAGMASK) { - state = 0; - state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; - zdwl_ipc_output_v2_send_tag(ipc_output->resource, ~0, state, 1, 1); - } else { - for ( tag = 0 ; tag < LENGTH(tags); tag++) { - numclients = state = focused_client = 0; - tagmask = 1 << tag; - if ((tagmask & monitor->tagset[monitor->seltags]) != 0) - state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; - - wl_list_for_each(c, &clients, link) { - if (c->mon != monitor) - continue; - if (!(c->tags & tagmask)) - continue; - if (c == focused) - focused_client = 1; - if (c->isurgent) - state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT; - - numclients++; - } - zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, numclients, focused_client); - } - } - + for ( tag = 0 ; tag < LENGTH(tags); tag++) { + numclients = state = focused_client = 0; + tagmask = 1 << tag; + if ((tagmask & monitor->tagset[monitor->seltags]) != 0) + state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; + wl_list_for_each(c, &clients, link) { + if (c->mon != monitor) + continue; + if (!(c->tags & tagmask)) + continue; + if (c == focused) + focused_client = 1; + if (c->isurgent) + state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT; + numclients++; + } + zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, numclients, focused_client); + } title = focused ? client_get_title(focused) : ""; appid = focused ? client_get_appid(focused) : "";