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 if [ $? -ne 0 ]; then
echo "---" echo "---"
else else
symbol=$(echo $api_url | awk '{print $4}') symbol=$(echo $api_url | awk '{print $4}')
#echo $symbol #echo $symbol
wert=$(echo $api_url | awk '{printf "%.1f\n",$3*0.0555}') wert=$(echo $api_url | awk '{printf "%.1f\n",$3*0.0555}')
#echo $wert #echo $wert
case $symbol in case $symbol in
'"SingleDown"') '"SingleDown"')
echo $wert "-" echo $wert "↓"
;; ;;
'"SingleUp"') '"SingleUp"')
echo $wert "+" echo $wert "↑"
;; ;;
'"DoubleDown"') '"DoubleDown"')
echo $wert "--" echo $wert "⇊"
;; ;;
'"DoubleUp"') '"DoubleUp"')
echo $wert "++" echo $wert "⇈"
;; ;;
'"FortyFiveDown"') '"FortyFiveDown"')
echo $wert "\" echo $wert "⇘"
;; ;;
'"FortyFiveUp"') '"FortyFiveUp"')
echo $wert "/" echo $wert "⇗"
;; ;;
'"Flat"') '"Flat"')
echo $wert "=" echo $wert "→"
;; ;;
*) *)
echo $symbol echo $symbol
;; ;;
esac esac
fi fi