From 944b6e284fa5ce27796e4488cee2bd4567132c21 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 22 Sep 2024 12:42:18 +0200 Subject: [PATCH] feat: add patch to mako --- home/home-configuration.scm | 2 +- .../ruther/home/dwl/mako-keep-style.patch | 54 +++++++++++++++++++ home/modules/ruther/home/dwl/wm.scm | 15 +++++- 3 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 home/modules/ruther/home/dwl/mako-keep-style.patch diff --git a/home/home-configuration.scm b/home/home-configuration.scm index 763f90f..4c9da87 100644 --- a/home/home-configuration.scm +++ b/home/home-configuration.scm @@ -107,7 +107,7 @@ "gnupg" "password-store-wl" "pass-otp" ;; DBus services - "mako" + "mako-mine" ;; Notebook stuff "acpi" "xbacklight" diff --git a/home/modules/ruther/home/dwl/mako-keep-style.patch b/home/modules/ruther/home/dwl/mako-keep-style.patch new file mode 100644 index 0000000..1b3ec0d --- /dev/null +++ b/home/modules/ruther/home/dwl/mako-keep-style.patch @@ -0,0 +1,54 @@ +From 7f98798f30f27cda30282d140bbe3627c71fdd20 Mon Sep 17 00:00:00 2001 +From: Rutherther +Date: Sat, 3 Aug 2024 10:43:08 +0200 +Subject: [PATCH] Do not reapply config for already rendered notifications on + mode + +This removes reapplying config when mode is changing, +and also on rendering, to prevent changing the notification's +settings when it's already displayed. This allows for modes +to change border's only of those notifications that are actually +sent in that mode. +--- + dbus/mako.c | 4 ---- + render.c | 2 +- + 2 files changed, 1 insertion(+), 5 deletions(-) + +diff --git a/dbus/mako.c b/dbus/mako.c +index 4c95881..6030473 100644 +--- a/dbus/mako.c ++++ b/dbus/mako.c +@@ -335,8 +335,6 @@ static int handle_set_mode(sd_bus_message *msg, void *data, + + set_modes(state, &mode, 1); + +- reapply_config(state); +- + return sd_bus_reply_method_return(msg, ""); + } + +@@ -428,8 +426,6 @@ static int handle_set_modes(sd_bus_message *msg, void *data, + + wl_array_release(&modes_arr); + +- reapply_config(state); +- + return sd_bus_reply_method_return(msg, ""); + } + +diff --git a/render.c b/render.c +index 5b68632..e734c15 100644 +--- a/render.c ++++ b/render.c +@@ -355,7 +355,7 @@ void render(struct mako_surface *surface, struct pool_buffer *buffer, int scale, + // Immediately before rendering we need to re-match all of the criteria + // so that matches against the anchor and output work even if the + // output was automatically assigned by the compositor. +- int rematch_count = apply_each_criteria(&state->config.criteria, notif); ++ int rematch_count = 1; + if (rematch_count == -1) { + // We encountered an allocation failure or similar while applying + // criteria. The notification may be partially matched, but the +-- +2.45.2 + diff --git a/home/modules/ruther/home/dwl/wm.scm b/home/modules/ruther/home/dwl/wm.scm index 9812c37..b7c391d 100644 --- a/home/modules/ruther/home/dwl/wm.scm +++ b/home/modules/ruther/home/dwl/wm.scm @@ -24,6 +24,19 @@ #:use-module (guix download) #:use-module (guix git-download)) +;; TODO mako progress bar? + +(define-public mako-mine + (package + (inherit mako) + (name "mako-mine") + (source + (origin + (inherit (package-source mako)) + (patches + (list + (local-file "mako-keep-style.patch"))))))) + (define-public waybar-mine (package (inherit waybar) @@ -31,8 +44,6 @@ (source (origin (inherit (package-source waybar)) - (sha256 - (base32 "0liiyz6212pmyhpsrb6773qf5b9b4kb76nggizygr9abfidbg5gw")) (patches (list (local-file "dwl-ipc-waybar.patch"))))))) -- 2.48.1