commit 163db4ec45ec3914fba2f18f2be9c534d93f41de parent a108e5f0143d7a4f6b6cf5f913a9453abea07c03 Author: Claudio Alessi <smoppy@gmail.com> Date: Wed, 30 Mar 2016 16:48:18 +0200 Update prompt with target if needed. Diffstat:
M | src/browse | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/browse b/src/browse @@ -4,10 +4,11 @@ target="$1" [ -z "$target" ] && target="$(realpath .)" prompt="$2" -[ -z "$prompt" ] && prompt="$target" while true; do - sel="$(ls -1a "$target" |grep -v '^\.$' | dmenu -p "$prompt" -l 25)" + p="$prompt" + [ -z "$p" ] && p="$target" + sel="$(ls -1a "$target" |grep -v '^\.$' | dmenu -p "$p" -l 25)" ec=$? [ "$ec" -ne 0 ] && exit $ec