aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm/calc.sh
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2017-03-07 13:41:52 -0700
committerkatherine <shmibs@shmibbles.me>2017-03-07 13:41:52 -0700
commit9676f43ffad81ac477ae3989e6b2b1e129f85d98 (patch)
treec08eca44c160f69d5e221ce415e559e0bb265762 /.config/herbstluftwm/calc.sh
parent5aba9de367932be46aa471c71076d9e623d5abce (diff)
downloaddotfiles-9676f43ffad81ac477ae3989e6b2b1e129f85d98.tar.gz
preliminary support for light backgrounds
haven't managed to make one that felt ok yet, but still nice to have the option
Diffstat (limited to '.config/herbstluftwm/calc.sh')
-rwxr-xr-x.config/herbstluftwm/calc.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/.config/herbstluftwm/calc.sh b/.config/herbstluftwm/calc.sh
index e10cfa6..7a1b9b9 100755
--- a/.config/herbstluftwm/calc.sh
+++ b/.config/herbstluftwm/calc.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/zsh
source ~/.config/init/vars
@@ -26,10 +26,10 @@ command_check() {
esac
}
-while [ "$in" != "" ]; do
+while [[ "$in" != "" ]]; do
in=$(dmenu -noinput -fn "${bfont}:size=${bfont_size}" -q -h "$bheight" \
- -nb "$bg_normal" -nf "$fg_normal" \
- -sb "$bg_focus" -sf "$fg_focus" -p "$prompt" | \
+ -nb "$bar_bg" -nf "$fg_normal" \
+ -sb "$bar_fg" -sf "$fg_focus" -p "$prompt" | \
sed -e "s/ans/$acc/g")
if [[ $(command_check "$in" "$acc") -eq 1 ]]; then
break
@@ -37,11 +37,11 @@ while [ "$in" != "" ]; do
out=$(echo "pi=$pi; e=$e; $acc $in" | calc -p 2>&1)
- if [ "${?#0}" != "" ]; then
+ if [[ "${?#0}" != "" ]]; then
out=$(echo "$out" | tr -d "\n")
- if [ "$out" = "Missing operator" ]; then
+ if [[ "$out" = "Missing operator" ]]; then
out=$(echo "pi=$pi; e=$e; $in" | calc -p 2>&1)
- if [ "${?#0}" != "" ]; then
+ if [[ "${?#0}" != "" ]]; then
out=$(echo "$out" | tr -d "\n")
prompt="calc: ($acc) err: $out"
else
@@ -57,4 +57,3 @@ while [ "$in" != "" ]; do
prompt="calc: ($acc)"
fi
done
-