Kevin Mok
1 year ago
No known key found for this signature in database
GPG Key ID: 6DEED612B26C08E2
8 changed files with 100 additions and 30 deletions
-
28aliases/key_aliases.tmpl
-
45aliases/key_dirs.tmpl
-
3aliases/key_files.tmpl
-
3dot_config/fish/config.fish.tmpl
-
4dot_config/i3/config.tmpl
-
31dot_config/i3blocks/i3blocks.conf.tmpl
-
3dot_config/i3blocks/scripts/executable_volume
-
13scripts/executable_kraken
@ -1,8 +1,17 @@ |
|||||
price=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1" | jq -r ".result.$1.b[0]") |
|
||||
# echo $price |
|
||||
|
# price=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1" | jq -r ".result.$1.b[0]") |
||||
|
raw=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=$1") |
||||
|
# echo $raw |
||||
|
if [ "$1" = "BTCUSDC" ]; then |
||||
|
price=$(echo "$raw" | jq -r ".result.XBTUSDC.b[0]") |
||||
|
else |
||||
|
price=$(echo "$raw" | jq -r ".result.$1.b[0]") |
||||
|
fi |
||||
|
# echo "$price" |
||||
if (( $(echo "$price < 10" | bc -l) )); then |
if (( $(echo "$price < 10" | bc -l) )); then |
||||
printf "%0.3f\n" "$price" | cut -c 3- |
printf "%0.3f\n" "$price" | cut -c 3- |
||||
# printf "%0.3f\n" "$price" |
# printf "%0.3f\n" "$price" |
||||
elif (( $(echo "$price < 10000" | bc -l) )); then |
elif (( $(echo "$price < 10000" | bc -l) )); then |
||||
printf "%'0.0f\n" "$price" | sed 's/,//' |
printf "%'0.0f\n" "$price" | sed 's/,//' |
||||
|
else |
||||
|
echo "$price" | cut -c -3 |
||||
fi |
fi |
Write
Preview
Loading…
Cancel
Save
Reference in new issue