mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-09-09 12:45:00 +00:00
bar: 2024-05-28
This commit is contained in:
parent
3ebb0248f3
commit
a86c3b9239
@ -14,7 +14,7 @@ slstatus -s | dwl
|
|||||||
|
|
||||||
### Download
|
### Download
|
||||||
- [git branch](https://codeberg.org/sewn/dwl/src/branch/bar)
|
- [git branch](https://codeberg.org/sewn/dwl/src/branch/bar)
|
||||||
- [2024-04-25](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/bar/bar.patch)
|
- [2024-05-28](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/bar/bar.patch)
|
||||||
|
|
||||||
Below is a preview of the barpadding and barborder patches applied.
|
Below is a preview of the barpadding and barborder patches applied.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
From 593e4ce9d4695d48c4da10560fca15251ec265ac Mon Sep 17 00:00:00 2001
|
From a53e23e1fe72e46eac00c428360b7ce679eadb4b Mon Sep 17 00:00:00 2001
|
||||||
From: sewn <sewn@disroot.org>
|
From: sewn <sewn@disroot.org>
|
||||||
Date: Thu, 25 Apr 2024 17:51:28 +0300
|
Date: Tue, 28 May 2024 13:25:00 +0300
|
||||||
Subject: [PATCH] Implement dwm bar clone
|
Subject: [PATCH] Implement dwm bar clone
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -295,7 +295,7 @@ index 0000000..613551e
|
|||||||
+ return x + (render ? w : 0);
|
+ return x + (render ? w : 0);
|
||||||
+}
|
+}
|
||||||
diff --git a/dwl.c b/dwl.c
|
diff --git a/dwl.c b/dwl.c
|
||||||
index bf763df..2145e55 100644
|
index bf763df..0268772 100644
|
||||||
--- a/dwl.c
|
--- a/dwl.c
|
||||||
+++ b/dwl.c
|
+++ b/dwl.c
|
||||||
@@ -4,6 +4,7 @@
|
@@ -4,6 +4,7 @@
|
||||||
@ -596,7 +596,7 @@ index bf763df..2145e55 100644
|
|||||||
|
|
||||||
/* The xdg-protocol specifies:
|
/* The xdg-protocol specifies:
|
||||||
*
|
*
|
||||||
@@ -1233,6 +1341,99 @@ dirtomon(enum wlr_direction dir)
|
@@ -1233,6 +1341,98 @@ dirtomon(enum wlr_direction dir)
|
||||||
return selmon;
|
return selmon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,15 +666,14 @@ index bf763df..2145e55 100644
|
|||||||
+ if ((w = mon->b.width - tw - x) > mon->b.height) {
|
+ if ((w = mon->b.width - tw - x) > mon->b.height) {
|
||||||
+ if (c != NULL) {
|
+ if (c != NULL) {
|
||||||
+ drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2,
|
+ drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2,
|
||||||
+ c ? client_get_title(c) : NULL,
|
+ client_get_title(c),
|
||||||
+ mon == selmon ? &selbarfg : &normbarfg,
|
+ mon == selmon ? &selbarfg : &normbarfg,
|
||||||
+ (mon == selmon && c) ? &selbarbg : &normbarbg);
|
+ (mon == selmon && c) ? &selbarbg : &normbarbg);
|
||||||
+ if (c && c->isfloating)
|
+ if (c && c->isfloating)
|
||||||
+ drwl_rect(pix, x + boxs, boxs, boxw, boxw, 0,
|
+ drwl_rect(pix, x + boxs, boxs, boxw, boxw, 0,
|
||||||
+ mon == selmon ? &selbarfg : &normbarfg);
|
+ mon == selmon ? &selbarfg : &normbarfg);
|
||||||
+ } else {
|
+ } else
|
||||||
+ drwl_rect(pix, x, 0, w, mon->b.height, 1, &normbarbg);
|
+ drwl_rect(pix, x, 0, w, mon->b.height, 1, &normbarbg);
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ pixman_image_unref(pix);
|
+ pixman_image_unref(pix);
|
||||||
@ -696,7 +695,7 @@ index bf763df..2145e55 100644
|
|||||||
void
|
void
|
||||||
focusclient(Client *c, int lift)
|
focusclient(Client *c, int lift)
|
||||||
{
|
{
|
||||||
@@ -1290,7 +1491,7 @@ focusclient(Client *c, int lift)
|
@@ -1290,7 +1490,7 @@ focusclient(Client *c, int lift)
|
||||||
client_activate_surface(old, 0);
|
client_activate_surface(old, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -705,7 +704,7 @@ index bf763df..2145e55 100644
|
|||||||
|
|
||||||
if (!c) {
|
if (!c) {
|
||||||
/* With no client, all we have left is to clear focus */
|
/* With no client, all we have left is to clear focus */
|
||||||
@@ -1618,7 +1819,7 @@ mapnotify(struct wl_listener *listener, void *data)
|
@@ -1618,7 +1818,7 @@ mapnotify(struct wl_listener *listener, void *data)
|
||||||
} else {
|
} else {
|
||||||
applyrules(c);
|
applyrules(c);
|
||||||
}
|
}
|
||||||
@ -714,7 +713,7 @@ index bf763df..2145e55 100644
|
|||||||
|
|
||||||
unset_fullscreen:
|
unset_fullscreen:
|
||||||
m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
|
m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
|
||||||
@@ -1904,46 +2105,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
|
@@ -1904,46 +2104,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
|
||||||
wlr_seat_pointer_notify_motion(seat, time, sx, sy);
|
wlr_seat_pointer_notify_motion(seat, time, sx, sy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -761,7 +760,7 @@ index bf763df..2145e55 100644
|
|||||||
|
|
||||||
void
|
void
|
||||||
quit(const Arg *arg)
|
quit(const Arg *arg)
|
||||||
@@ -2074,23 +2235,14 @@ run(char *startup_cmd)
|
@@ -2074,23 +2234,14 @@ run(char *startup_cmd)
|
||||||
|
|
||||||
/* Now that the socket exists and the backend is started, run the startup command */
|
/* Now that the socket exists and the backend is started, run the startup command */
|
||||||
if (startup_cmd) {
|
if (startup_cmd) {
|
||||||
@ -786,7 +785,7 @@ index bf763df..2145e55 100644
|
|||||||
|
|
||||||
/* At this point the outputs are initialized, choose initial selmon based on
|
/* At this point the outputs are initialized, choose initial selmon based on
|
||||||
* cursor position, and set default cursor image */
|
* cursor position, and set default cursor image */
|
||||||
@@ -2155,7 +2307,7 @@ setfloating(Client *c, int floating)
|
@@ -2155,7 +2306,7 @@ setfloating(Client *c, int floating)
|
||||||
(p && p->isfullscreen) ? LyrFS
|
(p && p->isfullscreen) ? LyrFS
|
||||||
: c->isfloating ? LyrFloat : LyrTile]);
|
: c->isfloating ? LyrFloat : LyrTile]);
|
||||||
arrange(c->mon);
|
arrange(c->mon);
|
||||||
@ -795,7 +794,7 @@ index bf763df..2145e55 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2178,7 +2330,7 @@ setfullscreen(Client *c, int fullscreen)
|
@@ -2178,7 +2329,7 @@ setfullscreen(Client *c, int fullscreen)
|
||||||
resize(c, c->prev, 0);
|
resize(c, c->prev, 0);
|
||||||
}
|
}
|
||||||
arrange(c->mon);
|
arrange(c->mon);
|
||||||
@ -804,7 +803,7 @@ index bf763df..2145e55 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2203,7 +2355,7 @@ setlayout(const Arg *arg)
|
@@ -2203,7 +2354,7 @@ setlayout(const Arg *arg)
|
||||||
selmon->lt[selmon->sellt] = (Layout *)arg->v;
|
selmon->lt[selmon->sellt] = (Layout *)arg->v;
|
||||||
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
|
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
@ -813,11 +812,11 @@ index bf763df..2145e55 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* arg > 1.0 will set mfact absolutely */
|
/* arg > 1.0 will set mfact absolutely */
|
||||||
@@ -2506,6 +2658,17 @@ setup(void)
|
@@ -2506,6 +2657,17 @@ setup(void)
|
||||||
|
|
||||||
wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend));
|
wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend));
|
||||||
|
|
||||||
+ fcft_init(FCFT_LOG_COLORIZE_AUTO, 0, FCFT_LOG_CLASS_DEBUG);
|
+ fcft_init(FCFT_LOG_COLORIZE_AUTO, 0, FCFT_LOG_CLASS_ERROR);
|
||||||
+ fcft_set_scaling_filter(FCFT_SCALING_FILTER_LANCZOS3);
|
+ fcft_set_scaling_filter(FCFT_SCALING_FILTER_LANCZOS3);
|
||||||
+ if (!(font = fcft_from_name(LENGTH(fonts), fonts, fontattrs)))
|
+ if (!(font = fcft_from_name(LENGTH(fonts), fonts, fontattrs)))
|
||||||
+ die("Could not load font");
|
+ die("Could not load font");
|
||||||
@ -831,6 +830,14 @@ index bf763df..2145e55 100644
|
|||||||
/* Make sure XWayland clients don't connect to the parent X server,
|
/* Make sure XWayland clients don't connect to the parent X server,
|
||||||
* e.g when running in the x11 backend or the wayland backend and the
|
* e.g when running in the x11 backend or the wayland backend and the
|
||||||
* compositor has Xwayland support */
|
* compositor has Xwayland support */
|
||||||
|
@@ -2530,6 +2692,7 @@ void
|
||||||
|
spawn(const Arg *arg)
|
||||||
|
{
|
||||||
|
if (fork() == 0) {
|
||||||
|
+ close(STDIN_FILENO);
|
||||||
|
dup2(STDERR_FILENO, STDOUT_FILENO);
|
||||||
|
setsid();
|
||||||
|
execvp(((char **)arg->v)[0], (char **)arg->v);
|
||||||
@@ -2548,6 +2711,30 @@ startdrag(struct wl_listener *listener, void *data)
|
@@ -2548,6 +2711,30 @@ startdrag(struct wl_listener *listener, void *data)
|
||||||
LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon);
|
LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon);
|
||||||
}
|
}
|
||||||
@ -1001,5 +1008,5 @@ index bf763df..2145e55 100644
|
|||||||
if (c->isurgent && surface && surface->mapped)
|
if (c->isurgent && surface && surface->mapped)
|
||||||
client_set_border_color(c, urgentcolor);
|
client_set_border_color(c, urgentcolor);
|
||||||
--
|
--
|
||||||
2.44.0
|
2.45.0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user