diff options
author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-03-25 00:13:33 +0100 |
---|---|---|
committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-03-25 00:13:33 +0100 |
commit | 856a8e6edfbe85f38585cbcca719c7334b3968d1 (patch) | |
tree | 59e1a4ae4d41f96678fe4a8f8a42fcd73b513935 | |
parent | c66caf16ba5a76302e8fe5be87c5f1b4660c2134 (diff) | |
parent | bbdf2a913b72e7a308ee0dfde6518a4285d4a775 (diff) |
Merge branch 'main' of https://github.com/djpohly/dwl
-rw-r--r-- | config.def.h | 1 | ||||
-rw-r--r-- | dwl.c | 13 |
2 files changed, 10 insertions, 4 deletions
diff --git a/config.def.h b/config.def.h index 8313b2a..6ac9a4d 100644 --- a/config.def.h +++ b/config.def.h @@ -2,7 +2,6 @@ static const int sloppyfocus = 1; /* focus follows mouse */ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */ static const unsigned int borderpx = 1; /* border pixel of windows */ -static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0}; static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; /* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ @@ -199,6 +199,7 @@ struct Monitor { unsigned int tagset[2]; double mfact; int nmaster; + char ltsymbol[16]; }; typedef struct { @@ -505,6 +506,8 @@ arrange(Monitor *m) wlr_scene_node_set_enabled(&m->fullscreen_bg->node, (c = focustop(m)) && c->isfullscreen); + if (m) + strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol)); if (m && m->lt[m->sellt]->arrange) m->lt[m->sellt]->arrange(m); motionnotify(0); @@ -1000,6 +1003,7 @@ createmon(struct wl_listener *listener, void *data) wlr_output_layout_add_auto(output_layout, wlr_output); else wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y); + strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol)); } void @@ -1812,12 +1816,16 @@ void monocle(Monitor *m) { Client *c; + int n = 0; wl_list_for_each(c, &clients, link) { if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) continue; resize(c, m->w, 0); + n++; } + if (n) + snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n); if ((c = focustop(m))) wlr_scene_node_raise_to_top(&c->scene->node); } @@ -2071,8 +2079,7 @@ printstatus(void) printf("%s selmon %u\n", m->wlr_output->name, m == selmon); printf("%s tags %u %u %u %u\n", m->wlr_output->name, occ, m->tagset[m->seltags], sel, urg); - printf("%s layout %s\n", m->wlr_output->name, m->lt[m->sellt]->symbol); - dwl_output_printstatus(m); + printf("%s layout %s\n", m->wlr_output->name, m->ltsymbol); } fflush(stdout); } @@ -2265,7 +2272,7 @@ setlayout(const Arg *arg) selmon->sellt ^= 1; if (arg && arg->v) selmon->lt[selmon->sellt] = (Layout *)arg->v; - /* TODO change layout symbol? */ + strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol)); arrange(selmon); printstatus(); } |