Kraken ticker i3block

This commit is contained in:
2023-03-30 08:33:32 -04:00
parent e2a9e753ff
commit 1afe9d05a4
15 changed files with 112 additions and 95 deletions

8
scripts/executable_kraken Executable file
View File

@@ -0,0 +1,8 @@
price=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1" | jq -r ".result.$1.b[0]")
# echo $price
if (( $(echo "$price < 10" | bc -l) )); then
printf "%0.3f\n" "$price" | cut -c 3-
# printf "%0.3f\n" "$price"
elif (( $(echo "$price < 10000" | bc -l) )); then
printf "%'0.0f\n" "$price" | sed 's/,//'
fi