diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-30 11:06:03 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-30 11:06:03 +0200 |
commit | eb1f44d6c756342b96c671a3f5cca0d12622c898 (patch) | |
tree | 59b3333b3c0e1841e2a7cd2b98215a1e1818b1e2 /bin/guiscripts | |
parent | a6108e4334da7a9e9ce0b5075b03ade3ca33dd14 (diff) | |
parent | f4d8717ff3364cf5f378c53ed6faf53f1cf2e16a (diff) |
Merge remote-tracking branch 'refs/remotes/origin/main'
Diffstat (limited to 'bin/guiscripts')
-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 |