thumbs: init at 0.5.1-infdev

This commit is contained in:
FliegendeWurst 2023-11-04 21:27:27 +01:00
parent 8869791cff
commit f67121fabe
3 changed files with 38 additions and 0 deletions

View File

@ -27,4 +27,5 @@
ripgrep-all = pkgs.callPackage ./pkgs/ripgrep-all {
inherit (pkgs.darwin.apple_sdk.frameworks) Security;
};
thumbs = pkgs.callPackage ./pkgs/thumbs { };
}

24
pkgs/thumbs/default.nix Normal file
View File

@ -0,0 +1,24 @@
{ lib, rustPlatform, fetchFromGitHub }:
rustPlatform.buildRustPackage rec {
pname = "thumbs";
version = "0.5.1-infdev";
src = fetchFromGitHub {
owner = "FliegendeWurst";
repo = "tmux-thumbs";
rev = "60824a826a0f64403fd45ded9be8cf3a130476b2";
sha256 = "sha256-3MKhZq2ks2rBYACf1kkfRxxXNexHjnQ6/+s1wCfqHeo=";
};
patches = [ ./fix.patch ];
cargoSha256 = "sha256-iPOEUd6+qPR1vI7khkHXgwR8UFRrCH5irHlL1VZVPyY=";
meta = with lib; {
homepage = "https://github.com/FliegendeWurst/tmux-thumbs";
description = "A lightning fast version copy/pasting like vimium/vimperator";
license = licenses.mit;
maintainers = with maintainers; [ fliegendewurst ];
};
}

13
pkgs/thumbs/fix.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/swapper.rs b/src/swapper.rs
index 6cf1e89..bcb0969 100644
--- a/src/swapper.rs
+++ b/src/swapper.rs
@@ -215,7 +215,7 @@ impl<'a> Swapper<'a> {
};
let pane_command = format!(
- "tmux capture-pane -J -et {active_pane_id} -p{scroll_params} | tail -n {height} | {dir}/target/release/thumbs -f '%U:%H' -t {tmp} {args}; tmux swap-pane -t {active_pane_id}; {zoom_command} tmux wait-for -S {signal}",
+ "tmux capture-pane -J -et {active_pane_id} -p{scroll_params} | tail -n {height} | {dir}/thumbs -f '%U:%H' -t {tmp} {args}; tmux swap-pane -t {active_pane_id}; {zoom_command} tmux wait-for -S {signal}",
active_pane_id = active_pane_id,
scroll_params = scroll_params,
height = self.active_pane_height.unwrap_or(i32::MAX),