make history length configurable through env var
Signed-off-by: Thore Bödecker <me@foxxx0.de>
This commit is contained in:
parent
48dce54b75
commit
13ad6835a2
7
clipmenu
7
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue