Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Bitbar script for Ether/€ pair with currency icon
#!/bin/sh
ethIconBase64='iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAgRJREFUOBFdU71KA0EQvtu7PbmQCDGx0VgpWAQUCUTSXaONaHc+gY1PYGORB7Cz0FPsLGx9AQXfwYBFQPAZJL936/ets0d0YG/mvpnZ+V3PA3U6HU1OiuN4HyzzfX8APsIZi5zFse7i31LpUwqAtdb3YEYp38DJ/MpKeIllaZpGvCVNvcCnQAqC4DXP8wSOOX6nxphY6+BpNssVsFNgI2CRUiooiuI1SZJDnIK+ZWQYjnAIIgs1B2+ura1sQHYYOW0MAjLbsmamPKcC0BQO5BfUC10GgcWmtKEtcIN+2Z5kUvMU4Fyc39kb159erxdD97Hg7IJkHsABFeLM+k2tVjsGJ4VJ0q5SqFSWThgIIoNYO8iclDfBYc0zckzikSAoQgYVcCWc2KNkOJNs6OtNBMwJojnPwA6o+EdHomMPcslmwhENMRaWYkeCUa6iObtwvm42m9uNxjIblVWr8SZ1sOO9cDH0GfLnTxOl22etVmsdEe+gv2q32yvI8hwObgKuibdYXd2lAoZsDrMomF69Xt+BbElrb482wEVvd4T9smOkEbKwc+aSuH345Pi2trwlYF8LExjD3kSRfrC38yO7/cIoOBzRt1x4A25LFMyOLwzDN7cj5UvEXoeynhwpS+JlTNvKDmNk54ze2EdlX1W/31dw4nO2XYfIBeNzZllcmNvFmsXZ/wFsgsQMN51TZwAAAABJRU5ErkJggg=='
ethLast=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=ETHEUR" | tr -d '{}"[]' | tr ':,' '\n' | grep -A1 "^c$" | tail -1)
printf "%.*f | image=%s\n" 2 "$ethLast" "$ethIconBase64"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment