diff --git a/clipmenu b/clipmenu index 08b0774..f22990a 100755 --- 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