commit 13ad6835a22c82e8578ba194242bb071a6e4ab22
parent 48dce54b756ce2e329d918a60a2d6b5b15cb9369
Author: Thore Bödecker <me@foxxx0.de>
Date: Tue, 21 Aug 2018 09:09:25 -0400
make history length configurable through env var
Signed-off-by: Thore Bödecker <me@foxxx0.de>
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/clipmenu b/clipmenu
@@ -2,6 +2,7 @@
: "${CM_LAUNCHER=dmenu}"
: "${CM_DIR="${XDG_RUNTIME_DIR-"${TMPDIR-/tmp}"}"}"
+: "${CM_HISTLENGTH=8}"
major_version=5
@@ -44,12 +45,8 @@ if [[ "$CM_LAUNCHER" == rofi-script ]]; then
chosen_line="${@: -1}"
fi
else
- # It's okay to hardcode `-l 8` here as a sensible default without checking
- # whether `-l` is also in "$@", because the way that dmenu works allows a later
- # argument to override an earlier one. That is, if the user passes in `-l`, our
- # one will be ignored.
chosen_line=$(
- list_clips | "$CM_LAUNCHER" -l 8 "$@"
+ list_clips | "$CM_LAUNCHER" -l "${CM_HISTLENGTH}" "$@"
)
fi