wofi-calc/.aur-scripts/wofi-calc-git/wofi-calc.sh
Zeioth 6b8b47cdc9 Confirmed, AUR daily quota exceeded.
the command  git clone ssh://aur.archlinux.org/wofi-calc-git.git
return 'fatal: could no read from repository. So most likely the daily
quota was exceeded, as no permission file was altered.'
2022-04-11 01:39:08 +02:00

34 lines
721 B
Bash

#!/usr/bin/env bash
RESULT_FILE="$HOME/.config/qalculate/qalc.result.history"
if [ ! -f "$RESULT_FILE" ]; then
touch $RESULT_FILE
fi
LAST_WOFI=""
QALC_RET=""
while :
do
qalc_hist=`tac $RESULT_FILE | head -1000`
WOFI_RET=`wofi --sort-order=default --cache-file=/dev/null -d -p calc <<< "$qalc_hist"`
rtrn=$?
if test "$rtrn" = "0"; then
if [[ "$WOFI_RET" =~ .*=.* ]]; then
RESULT=`echo "$WOFI_RET" | awk {'print $NF'}`
wl-copy "$RESULT"
exit 0
else
QALC_RET=`qalc "$WOFI_RET"`
LAST_WOFI=$WOFI_RET
echo $QALC_RET >> $RESULT_FILE
fi
else
if [ ! -z "$LAST_WOFI" ]; then
RESULT=`qalc -t "$LAST_WOFI"`
wl-copy "$RESULT"
fi
exit 0
fi
done