From 5768d5dda94bad53ae007e0268cffe2c71e16fcc Mon Sep 17 00:00:00 2001 From: shmibs Date: Fri, 4 Jul 2014 09:50:30 -0700 Subject: fixed dmenu scripts i'm not sure how they ended up broken... --- .config/herbstluftwm/calc.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to '.config/herbstluftwm/calc.sh') diff --git a/.config/herbstluftwm/calc.sh b/.config/herbstluftwm/calc.sh index 88d31df..3a7faba 100755 --- a/.config/herbstluftwm/calc.sh +++ b/.config/herbstluftwm/calc.sh @@ -29,14 +29,12 @@ command_check() { while [ "$in" != "" ]; do in=$(echo "" | dmenu -fn $efont -q -h $bheight \ -nb $bg_normal -nf $fg_normal \ - -sb $bg_focus -sf $fg_focus -p "$prompt") + -sb $bg_focus -sf $fg_focus -p "$prompt" | \ + sed -e "s/ans/$acc/g") if [[ $(command_check "$in" "$acc") -eq 1 ]]; then break fi - # replace "ans" with the previous value - in=$(echo $in | sed -e "s/ans/$acc/g") - out=$(echo "pi=$pi; e=$e; $acc $in" | calc -p 2>&1) if [ "${?#0}" != "" ]; then @@ -54,6 +52,9 @@ while [ "$in" != "" ]; do out=$(echo "$out" | tr -d "\n") prompt="calc: ($acc) err: $out" fi + else + acc=$out + prompt="calc: ($acc)" fi done -- cgit v1.2.3