commit 117385015b98004cc359d18e5e3f7892e3aad0f8
parent eecc03171887f4866f12fd011e50c71b4ffabbc9
Author: Chris Down <chris@chrisdown.name>
Date: Sun, 19 Mar 2017 07:40:19 +0000
Add $CM_LAUNCHER env variable
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/clipmenu b/clipmenu
@@ -7,11 +7,13 @@ shopt -s nullglob
cache_dir=/tmp/clipmenu.$major_version.$USER
cache_file=$cache_dir/line_cache
+: "${CM_LAUNCHER:-dmenu}"
+
# 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=$(tac "$cache_file" | awk '!seen[$0]++' | dmenu -l 8 "$@")
+chosen_line=$(tac "$cache_file" | awk '!seen[$0]++' | "$CM_LAUNCHER" -l 8 "$@")
[[ $chosen_line ]] || exit 1