diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-29 15:15:42 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-29 15:21:24 +0200 |
commit | f4d8717ff3364cf5f378c53ed6faf53f1cf2e16a (patch) | |
tree | 29d2cf28a8ccf45cda75adc8b129905767666a01 | |
parent | 8ef47f05fdb1afdbe8b488d0d4be4b0cc8c04131 (diff) |
remade dmcalc script
-rwxr-xr-x | bin/guiscripts/dmcalc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/bin/guiscripts/dmcalc b/bin/guiscripts/dmcalc index 46c35c6..80fe853 100755 --- a/bin/guiscripts/dmcalc +++ b/bin/guiscripts/dmcalc @@ -1,12 +1,9 @@ #!/bin/sh -dmenu -p Calculate: < /dev/null | - xargs echo | - bc 2>&1 | - xargs -I {} echo -e "{}\n" | - dmenu -p Answer: -l 1 -g 1 | - xclipp -# TODO -# ask for calculation -# shows answer -# if esc -> quit -# if enter, continue with answer +calc=0 +result="calc:" +while [ "$calc" ] +do + calc="$(echo -n | dmenu -p "$result")" + result="$(echo "$result $calc" | bc)" +done +echo -n "$result" | xclip |