polybar: nightscout
This commit is contained in:
parent
60f2838dee
commit
20c90062ef
1 changed files with 20 additions and 2 deletions
|
@ -1,7 +1,25 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
curl -s -X GET "https://nightscout.mgrote.net/api/v1/entries/sgv?count=1&token=polybar-ae6fe2720f2c30f4" > /dev/null
|
api_url=$(curl -s -X GET "https://nightscout.mgrote.net/api/v1/entries/sgv?count=1&token=polybar-ae6fe2720f2c30f4")
|
||||||
|
#echo $api_url
|
||||||
|
symbol=$(echo $api_url | awk '{print $4}')
|
||||||
|
#echo $symbol
|
||||||
|
wert=$(echo $api_url | awk '{printf "%.1f\n",$3*0.0555}')
|
||||||
|
#echo $wert
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "---"
|
echo "---"
|
||||||
else
|
else
|
||||||
curl -s -X GET "https://nightscout.mgrote.net/api/v1/entries/sgv?count=1&token=polybar-ae6fe2720f2c30f4" | awk '{printf "%.1f\n",$3*0.0555}'
|
case $symbol in
|
||||||
|
'"Flat"')
|
||||||
|
echo $wert "="
|
||||||
|
;;
|
||||||
|
'"FortyFiveDown"')
|
||||||
|
echo $wert "-"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo $symbol
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue