polybar: nightscout

This commit is contained in:
Michael Grote 2021-07-02 17:11:55 +02:00
parent 8221762605
commit adacb2560d

View file

@ -4,34 +4,34 @@ api_url=$(curl -s -X GET "https://nightscout.mgrote.net/api/v1/entries/sgv?count
if [ $? -ne 0 ]; then
echo "---"
else
symbol=$(echo $api_url | awk '{print $4}')
#echo $symbol
wert=$(echo $api_url | awk '{printf "%.1f\n",$3*0.0555}')
#echo $wert
case $symbol in
'"SingleDown"')
echo $wert "-"
;;
'"SingleUp"')
echo $wert "+"
;;
'"DoubleDown"')
echo $wert "--"
;;
'"DoubleUp"')
echo $wert "++"
;;
'"FortyFiveDown"')
echo $wert "\"
;;
'"FortyFiveUp"')
echo $wert "/"
;;
'"Flat"')
echo $wert "="
;;
*)
echo $symbol
;;
esac
symbol=$(echo $api_url | awk '{print $4}')
#echo $symbol
wert=$(echo $api_url | awk '{printf "%.1f\n",$3*0.0555}')
#echo $wert
case $symbol in
'"SingleDown"')
echo $wert "↓"
;;
'"SingleUp"')
echo $wert "↑"
;;
'"DoubleDown"')
echo $wert "⇊"
;;
'"DoubleUp"')
echo $wert "⇈"
;;
'"FortyFiveDown"')
echo $wert "⇘"
;;
'"FortyFiveUp"')
echo $wert "⇗"
;;
'"Flat"')
echo $wert "→"
;;
*)
echo $symbol
;;
esac
fi