mirror of
https://github.com/FliegendeWurst/nur-packages.git
synced 2024-11-08 18:30:38 +00:00
tmux-thumbs: init at 0.5.1-infdev
This commit is contained in:
parent
f67121fabe
commit
7cb0a0c27f
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
{ pkgs ? import <nixpkgs> { } }:
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
{
|
rec {
|
||||||
# The `lib`, `modules`, and `overlay` names are special
|
# The `lib`, `modules`, and `overlay` names are special
|
||||||
lib = import ./lib { inherit pkgs; }; # functions
|
lib = import ./lib { inherit pkgs; }; # functions
|
||||||
modules = import ./modules; # NixOS modules
|
modules = import ./modules; # NixOS modules
|
||||||
@ -28,4 +28,8 @@
|
|||||||
inherit (pkgs.darwin.apple_sdk.frameworks) Security;
|
inherit (pkgs.darwin.apple_sdk.frameworks) Security;
|
||||||
};
|
};
|
||||||
thumbs = pkgs.callPackage ./pkgs/thumbs { };
|
thumbs = pkgs.callPackage ./pkgs/thumbs { };
|
||||||
|
tmux-thumbs = pkgs.callPackage ./pkgs/tmux-thumbs {
|
||||||
|
inherit (pkgs.tmuxPlugins) mkTmuxPlugin;
|
||||||
|
inherit thumbs;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
29
pkgs/tmux-thumbs/default.nix
Normal file
29
pkgs/tmux-thumbs/default.nix
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{ lib, mkTmuxPlugin, fetchFromGitHub, thumbs, substituteAll }:
|
||||||
|
|
||||||
|
mkTmuxPlugin rec {
|
||||||
|
pluginName = "tmux-thumbs";
|
||||||
|
version = "0.5.1-infdev";
|
||||||
|
rtpFilePath = "tmux-thumbs.tmux";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "FliegendeWurst";
|
||||||
|
repo = pluginName;
|
||||||
|
rev = "60824a826a0f64403fd45ded9be8cf3a130476b2";
|
||||||
|
sha256 = "sha256-3MKhZq2ks2rBYACf1kkfRxxXNexHjnQ6/+s1wCfqHeo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(substituteAll {
|
||||||
|
src = ./fix.patch;
|
||||||
|
tmuxThumbsDir = "${thumbs}/bin";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/FliegendeWurst/tmux-thumbs";
|
||||||
|
description = "tmux-thumbs with color support";
|
||||||
|
license = licenses.mit;
|
||||||
|
platforms = platforms.unix;
|
||||||
|
maintainers = with maintainers; [ fliegendewurst ];
|
||||||
|
};
|
||||||
|
}
|
39
pkgs/tmux-thumbs/fix.patch
Normal file
39
pkgs/tmux-thumbs/fix.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
diff --git a/tmux-thumbs.sh b/tmux-thumbs.sh
|
||||||
|
index 34dd528..8c05d54 100755
|
||||||
|
--- a/tmux-thumbs.sh
|
||||||
|
+++ b/tmux-thumbs.sh
|
||||||
|
@@ -3,19 +3,6 @@
|
||||||
|
|
||||||
|
# Setup env variables to be compatible with compiled and bundled installations
|
||||||
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
-RELEASE_DIR="${CURRENT_DIR}/target/release"
|
||||||
|
-
|
||||||
|
-THUMBS_BINARY="${RELEASE_DIR}/thumbs"
|
||||||
|
-TMUX_THUMBS_BINARY="${RELEASE_DIR}/tmux-thumbs"
|
||||||
|
-VERSION=$(grep 'version =' "${CURRENT_DIR}/Cargo.toml" | grep -o "\".*\"" | sed 's/"//g')
|
||||||
|
-
|
||||||
|
-if [ ! -f "$THUMBS_BINARY" ]; then
|
||||||
|
- tmux split-window "cd ${CURRENT_DIR} && bash ./tmux-thumbs-install.sh"
|
||||||
|
- exit
|
||||||
|
-elif [[ $(${THUMBS_BINARY} --version) != "thumbs ${VERSION}" ]]; then
|
||||||
|
- tmux split-window "cd ${CURRENT_DIR} && bash ./tmux-thumbs-install.sh update"
|
||||||
|
- exit
|
||||||
|
-fi
|
||||||
|
|
||||||
|
function get-opt-value() {
|
||||||
|
tmux show -vg "@thumbs-${1}" 2> /dev/null
|
||||||
|
@@ -35,7 +22,7 @@
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
-PARAMS=(--dir "${CURRENT_DIR}")
|
||||||
|
+PARAMS=(--dir @tmuxThumbsDir@)
|
||||||
|
|
||||||
|
function add-param() {
|
||||||
|
local type opt arg
|
||||||
|
@@ -50,4 +37,4 @@
|
||||||
|
add-param multi-command string
|
||||||
|
add-param osc52 boolean
|
||||||
|
|
||||||
|
-"${TMUX_THUMBS_BINARY}" "${PARAMS[@]}" || true
|
||||||
|
+@tmuxThumbsDir@/tmux-thumbs "${PARAMS[@]}" || true
|
Loading…
Reference in New Issue
Block a user