about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-28 20:07:44 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-28 20:07:44 +0200
commit97ba997f78e1fe4340875aa44d422618b67a6e32 (patch)
tree03933003c5fd91f2daf4febdc02101584f556bcf
parentmodules/nix: Temporarily switch to cppnix (diff)
downloadnixos-config-97ba997f78e1fe4340875aa44d422618b67a6e32.zip
pkgs/i3bar-river-patched: Base on my branch and rebase the block in middle patch
This should avoid having to update both of the patches in the future, as
the pull request patch fetch is not stable, and changes if I push
something new to the pr.
-rw-r--r--pkgs/by-name/i3/i3bar-river-patched/0001-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch (renamed from pkgs/by-name/i3/i3bar-river-patched/0002-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch)33
-rw-r--r--pkgs/by-name/i3/i3bar-river-patched/package.nix21
2 files changed, 22 insertions, 32 deletions
diff --git a/pkgs/by-name/i3/i3bar-river-patched/0002-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch b/pkgs/by-name/i3/i3bar-river-patched/0001-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch
index 6f4bd528..7bfdd7bc 100644
--- a/pkgs/by-name/i3/i3bar-river-patched/0002-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch
+++ b/pkgs/by-name/i3/i3bar-river-patched/0001-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch
@@ -1,4 +1,4 @@
-From b8568a2b626bd4d5f50ee24c304d19177bda5d4b Mon Sep 17 00:00:00 2001
+From 8ae692a461fad2f23231d50b78bb706408facfe6 Mon Sep 17 00:00:00 2001
 From: Benedikt Peetz <benedikt.peetz@b-peetz.de>
 Date: Tue, 20 May 2025 19:58:57 +0200
 Subject: [PATCH] feat(crate::bar): Put the leftmost block in the middle of the
@@ -7,21 +7,21 @@ Subject: [PATCH] feat(crate::bar): Put the leftmost block in the middle of the
 This is a workaround for the limitation in the i3 blocks protocol, as
 this does not allow for centred blocks.
 ---
- src/bar.rs | 64 ++++++++++++++++++++++++++++++++++++++++++++----------
- 1 file changed, 53 insertions(+), 11 deletions(-)
+ src/bar.rs | 63 ++++++++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 52 insertions(+), 11 deletions(-)
 
 diff --git a/src/bar.rs b/src/bar.rs
-index fb88150..e66c2cf 100644
+index 96533e3..76f8025 100644
 --- a/src/bar.rs
 +++ b/src/bar.rs
-@@ -344,16 +344,56 @@ impl Bar {
+@@ -338,16 +338,55 @@ impl Bar {
          }
  
          // Display the blocks
 -        render_blocks(
 -            &cairo_ctx,
--            ss,
--            &self.output,
+-            &ss.config,
+-            palette,
 -            ss.blocks_cache.get_computed(),
 -            &mut self.blocks_btns,
 -            offset_left,
@@ -36,8 +36,8 @@ index fb88150..e66c2cf 100644
 +
 +                let other_start = render_blocks(
 +                    &cairo_ctx,
-+                    ss,
-+                    &self.output,
++                    &ss.config,
++                    palette,
 +                    blocks,
 +                    &mut self.blocks_btns,
 +                    offset_left,
@@ -49,7 +49,9 @@ index fb88150..e66c2cf 100644
 +                // left, if the others are spanning over the middle.
 +                let mut start = (width_f / 2.0) - (first_block.full.width / 2.0);
 +                if start + first_block.full.width > other_start {
-+                    start = other_start - first_block.full.width - first_block.block.separator_block_width as f64;
++                    start = other_start
++                        - first_block.full.width
++                        - first_block.block.separator_block_width as f64;
 +                }
 +
 +                first_block.full.render(
@@ -57,10 +59,7 @@ index fb88150..e66c2cf 100644
 +                    RenderOptions {
 +                        x_offset: start,
 +                        bar_height: height_f,
-+                        fg_color: first_block
-+                            .block
-+                            .color
-+                            .unwrap_or(sfo!(ss, &self.output, color)),
++                        fg_color: first_block.block.color.unwrap_or(palette.color),
 +                        bg_color: first_block.block.background,
 +                        r_left: ss.config.blocks_r,
 +                        r_right: ss.config.blocks_r,
@@ -81,7 +80,7 @@ index fb88150..e66c2cf 100644
  
          self.viewport
              .set_destination(conn, self.width as i32, self.height as i32);
-@@ -428,7 +468,7 @@ fn render_blocks(
+@@ -422,7 +461,7 @@ fn render_blocks(
      offset_left: f64,
      full_width: f64,
      full_height: f64,
@@ -90,7 +89,7 @@ index fb88150..e66c2cf 100644
      context.rectangle(offset_left, 0.0, full_width - offset_left, full_height);
      context.clip();
  
-@@ -513,6 +553,7 @@ fn render_blocks(
+@@ -507,6 +546,7 @@ fn render_blocks(
      }
  
      // Render blocks
@@ -98,7 +97,7 @@ index fb88150..e66c2cf 100644
      buttons.clear();
      for series in blocks_computed {
          let s_len = series.blocks.len();
-@@ -560,6 +601,7 @@ fn render_blocks(
+@@ -550,6 +590,7 @@ fn render_blocks(
      }
  
      context.reset_clip();
diff --git a/pkgs/by-name/i3/i3bar-river-patched/package.nix b/pkgs/by-name/i3/i3bar-river-patched/package.nix
index 87f78248..f6c3b5fd 100644
--- a/pkgs/by-name/i3/i3bar-river-patched/package.nix
+++ b/pkgs/by-name/i3/i3bar-river-patched/package.nix
@@ -13,32 +13,23 @@
   rustPlatform,
   pkg-config,
   pango,
-  fetchpatch2,
 }:
 rustPlatform.buildRustPackage {
   pname = "i3bar-river-patched";
   version = "1.1.0-unstable-2025-05-20";
 
   src = fetchFromGitHub {
-    owner = "MaxVerevkin";
+    owner = "bpeetz";
     repo = "i3bar-river";
-    rev = "73446cac559b10adf4beb5567a816d1be5273457";
-    hash = "sha256-NxlFKTnd2erHtSG56aWlZEkWVzBqe2hqQuVAWDdBq2c=";
+    rev = "bdaf362f24c143beeb92b783af15d3b99a0490e4";
+    hash = "sha256-jOv/DmXBpUCV/zbkWSKSYQ+yXcZZQY+T03rNre9hjn8=";
   };
 
-  useFetchCargoVendor = true;
-  cargoHash = "sha256-8sub8cXC/1iDY6v/9opO4FiLAo9CFrGJSDPNQydGvhQ=";
+  cargoHash = "sha256-jIB4XH67FmtPxAatHkuW8v5mNgr/KsyriaBNZ5t2dLo=";
 
   cargoPatches = [
-    # Add a separate theme for unfocused outputs.
-    (fetchpatch2 {
-      name = "Add support for special theme for unfocused outputs";
-      url = "https://patch-diff.githubusercontent.com/raw/MaxVerevkin/i3bar-river/pull/44.patch";
-      hash = "sha256-HMNR/4Q2wDnqbN0ziXrG5DFeWgczOcw5AzLvGbJZKdo=";
-    })
-
-    # TODO(@bpeetz): Open an issues, whether something like that could be upstreamed. <2025-05-20>
-    ./0002-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch
+    # TODO(@bpeetz): Open an issues, whether something like that could be up-streamed. <2025-05-20>
+    ./0001-feat-crate-bar-Put-the-leftmost-block-in-the-middle-.patch
   ];
 
   # Remove the WMs that I don't use.