optimize: change to general waybar

This commit is contained in:
DreamMaoMao 2025-02-05 13:08:44 +08:00
parent 8e3fc9d51c
commit aef9a14cf9
2 changed files with 18 additions and 34 deletions

View file

@ -48,13 +48,6 @@ sudo ninja -C build install
``` ```
yay -S wofi foot 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 # thanks for some refer repo

45
main.c
View file

@ -2337,33 +2337,24 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) {
focused = focustop(monitor); focused = focustop(monitor);
zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon); zdwl_ipc_output_v2_send_active(ipc_output->resource, monitor == selmon);
if ((monitor->tagset[monitor->seltags] & TAGMASK) == TAGMASK) { for ( tag = 0 ; tag < LENGTH(tags); tag++) {
state = 0; numclients = state = focused_client = 0;
state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; tagmask = 1 << tag;
zdwl_ipc_output_v2_send_tag(ipc_output->resource, ~0, state, 1, 1); if ((tagmask & monitor->tagset[monitor->seltags]) != 0)
} else { state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE;
for ( tag = 0 ; tag < LENGTH(tags); tag++) { wl_list_for_each(c, &clients, link) {
numclients = state = focused_client = 0; if (c->mon != monitor)
tagmask = 1 << tag; continue;
if ((tagmask & monitor->tagset[monitor->seltags]) != 0) if (!(c->tags & tagmask))
state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_ACTIVE; continue;
if (c == focused)
wl_list_for_each(c, &clients, link) { focused_client = 1;
if (c->mon != monitor) if (c->isurgent)
continue; state |= ZDWL_IPC_OUTPUT_V2_TAG_STATE_URGENT;
if (!(c->tags & tagmask)) numclients++;
continue; }
if (c == focused) zdwl_ipc_output_v2_send_tag(ipc_output->resource, tag, state, numclients, focused_client);
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) : ""; title = focused ? client_get_title(focused) : "";
appid = focused ? client_get_appid(focused) : ""; appid = focused ? client_get_appid(focused) : "";