Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

5 days ago
5 days ago
5 days ago
5 days ago
  1. # /bin/bash
  2. # curl -s https://api.dexscreener.com/latest/dex/pairs/$1/$2| jq -r '.pairs | .[] | .priceUsd'
  3. raw=$(curl -s "https://api.dexscreener.com/latest/dex/pairs/$1/$2")
  4. price=$(echo "$raw" | jq -r ".pairs | .[] | .priceUsd")
  5. # if (( $(echo "$price < .05" | bc -l) )); then
  6. # printf "%0.4f\n" "$price" | cut -c 4-
  7. # elif (( $(echo "$price < .1" | bc -l) )); then
  8. # printf "%0.3f\n" "$price" | cut -c 4-
  9. #if (( $(echo "$price < .09" | bc -l) )); then
  10. #printf "%0.4f\n" "$price" | cut -c 4-
  11. #elif (( $(echo "$price < .1" | bc -l) )); then
  12. #printf "%0.3f\n" "$price" | cut -c 4-
  13. #elif (( $(echo "$price < 1" | bc -l) )); then
  14. #printf "%0.3f\n" "$price" | cut -c 3-
  15. #elif (( $(echo "$price < 10" | bc -l) )); then
  16. #printf "%0.2f\n" "$price"
  17. #fi
  18. if [ $(echo "$price < 0.09" | bc -l) -eq 1 ]; then
  19. printf "%0.4f\n" "$price" | cut -c 4-
  20. elif [ $(echo "$price < 0.1" | bc -l) -eq 1 ]; then
  21. printf "%0.3f\n" "$price" | cut -c 4-
  22. elif [ $(echo "$price < 1" | bc -l) -eq 1 ]; then
  23. printf "%0.3f\n" "$price" | cut -c 3-
  24. elif [ $(echo "$price < 10" | bc -l) -eq 1 ]; then
  25. printf "%0.2f\n" "$price"
  26. fi