Cryptocurrency widget

Questions about applications and software
Forum rules
Before you post please read how to get help
yamahama
Level 1
Level 1
Posts: 14
Joined: Mon Nov 06, 2017 7:08 am

Cryptocurrency widget

Postby yamahama » Mon Nov 06, 2017 8:01 am

is there some kind of cryptocurrency price monitor widget for mint?

User avatar
xenopeek
Level 24
Level 24
Posts: 21382
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Cryptocurrency widget

Postby xenopeek » Tue Nov 07, 2017 1:11 pm

I don't know of such a widget. Googling around I did find this program for monitoring prices of bitcoin, ethereum, and litecoin in a terminal window: https://github.com/alexanderepstein/cryptowatch. If those are the cryptocurrencies you use that might be useful till you find something better suited.

As widgets are generally desktop environment specific, it's useful to include context with your question. Are you using Cinnamon, MATE, KDE or Xfce? Perhaps with your answer somebody can suggest something more specific.
Image

User avatar
phd21
Level 13
Level 13
Posts: 4911
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Cryptocurrency widget

Postby phd21 » Tue Nov 07, 2017 1:57 pm

Hi "yamahama"

Welcome to the wonderful world of Linux Mint and its excellent forum !

I just read your post and the good reply to it. Here are my thoughts on this as well.

It would help to know more about your system setup, like which edition and version of Linux Mint you are running (Cinnamon, Mate, KDE, or Xfce). If you run "inxi -Fxzd" from the console terminal prompt, highlight the results, copy and paste them back here, that should provide enough information.

"Donut" - Cross platform cryptocurrency tracker.
https://github.com/harshjv/donut

Downloads - - Installation options include an AppImage, 64-bit easy to install Linux deb file, & source code.
https://github.com/harshjv/donut/releases



FYI: Cryptocurrency Wallet Guide: A Step-By-Step Tutorial
https://blockgeeks.com/guides/cryptocurrency-wallet-guide/


Hope this helps ...


A quick search in my Linux Mint KDE 17.3 system shows these Plasma Widgets for bitcoin
BitCoin_KDE17x_widgets1.jpg
Phd21: Mint KDE 17.3 & 18.2, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,3gb Ram,160gb hdd, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

yamahama
Level 1
Level 1
Posts: 14
Joined: Mon Nov 06, 2017 7:08 am

Re: Cryptocurrency widget

Postby yamahama » Tue Nov 07, 2017 3:59 pm

xenopeek wrote:I don't know of such a widget. Googling around I did find this program for monitoring prices of bitcoin, ethereum, and litecoin in a terminal window: https://github.com/alexanderepstein/cryptowatch. If those are the cryptocurrencies you use that might be useful till you find something better suited.

As widgets are generally desktop environment specific, it's useful to include context with your question. Are you using Cinnamon, MATE, KDE or Xfce? Perhaps with your answer somebody can suggest something more specific.


Hi xenopeek,

Apologies I forget how important that info is. I'm running a Desktop using Mint 18.2 Cinnamon x64 with the latest kernel (4.10 something i believe). Thanks for the cryptowatch link- I'll be sure to test it out.

But really all I'm looking for is a widget that can pull json results.

e.g. if you go to https://www.bitstamp.net/api/ticker/ and use the json key "last" you get the current price of bitcoin.

yamahama
Level 1
Level 1
Posts: 14
Joined: Mon Nov 06, 2017 7:08 am

Re: Cryptocurrency widget

Postby yamahama » Tue Nov 07, 2017 4:06 pm

phd21 wrote:Hi "yamahama"

Welcome to the wonderful world of Linux Mint and its excellent forum !

I just read your post and the good reply to it. Here are my thoughts on this as well.



Hi phd21,

Thanks I really do love Mint. Just trying to learn as much as possible about it so I can give up windows for good.

As I stated in the reply to xenopeak i'm running Desktop 18.2 Cinnamon x64 with kernel 4.10...so not entirely sure if there's a workaround to run kde or gnome widgets on cinnamon. will definitley be checking out donut though, thank you!

User avatar
phd21
Level 13
Level 13
Posts: 4911
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Cryptocurrency widget

Postby phd21 » Tue Nov 07, 2017 4:26 pm

Hi "yamahama",

You are welcome ...

"Donut" looks perfect for what you wanted, checking Cryptocurrencies. I happen to be in Linux Mint KDE 17.3 at the moment, and the donut appimage and deb installation files worked perfectly.

I doubt you can run KDE widgets in Cinnamon, but if you go to your applets, desklets, or screenlets, you can look for bitcoin, or currency, to see if anything in there will work for you regarding this.

FYI: Widgets is a term used on the KDE desktops, whereas applets, desklets, or screenlets, are used for Cinnamon, Mate, and Xfce desktops...

If you tell us what applications you are still using MS windows for, I am sure the good people in this forum can recommend alternatives.
Last edited by phd21 on Tue Nov 07, 2017 5:29 pm, edited 2 times in total.
Phd21: Mint KDE 17.3 & 18.2, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,3gb Ram,160gb hdd, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
xenopeek
Level 24
Level 24
Posts: 21382
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Cryptocurrency widget

Postby xenopeek » Tue Nov 07, 2017 4:43 pm

Ah, JSON 8) Now we're talking!

You can do this easily by first installing the package jq (from Software Manager or from the terminal with command apt install jq) and then in Cinnamon Settings open Applets and install the Bash Sensors applet from the Available applets tab. Then go back to the Installed applets tab and add Bash Sensors to the panel from there and then configure it. It's not perfect but it works.

Set the configuration for the Bash Status like this (click to enlarge):
Image
Put this in Command 1:
curl -sS https://www.bitstamp.net/api/ticker/ | jq -Mr '.last'

jq is the tool that allows for working easily with JSON data on the terminal. Bash Status is intended I think for temperature sensors but it works as a general applet that can poll the output of a command periodically. Perhaps somebody more into Cinnamon applets will know of a better applet for this.
Image

yamahama
Level 1
Level 1
Posts: 14
Joined: Mon Nov 06, 2017 7:08 am

Re: Cryptocurrency widget

Postby yamahama » Thu Nov 09, 2017 2:32 am

xenopeek wrote:Ah, JSON 8) Now we're talking!


That is so cool that you can do something like that!!! But it looks like i can only run one instance at a time and it's not ideal for monitoring 10 different currencies. but i've been messing around with kde to see their widgets and honestly i don't think I'll be going back to cinnamon!

phd21 wrote:A quick search in my Linux Mint KDE 17.3 system shows these Plasma Widgets for bitcoin


Hey phd21 I've just been experimenting with KDE and don't see the widgets you see in Plasma (on 18.2 x64; no hits for "bitcoin"). Is there some super secret ppa you need to add to get it to show up? I did manage to find the first one in your screenshot on google and it installed and works without a hitch. (it'll take some tinkering to get it to show other currencies/icons but it's the best one i've seen by far.)

User avatar
xenopeek
Level 24
Level 24
Posts: 21382
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Cryptocurrency widget

Postby xenopeek » Thu Nov 09, 2017 4:59 am

If you have more links for where exchange rates can be fetched, I can easily turn it into a script that strings them together. Could make it something like this:
BTC 1000 | LTC 1000 | XDG 1000 | etc
Also on KDE we can use that as you can install the Command Output widget and that does the same thing; show the output of a command on your panel.

Happy to help if you share which cryptocurrencies you want to monitor :wink:

Making a note the page https://github.com/sebaslogen/bitcoin-p ... iders.json which seems to be a starting point for finding links to get exchange rates of other cryptocurrencies.
Image

yamahama
Level 1
Level 1
Posts: 14
Joined: Mon Nov 06, 2017 7:08 am

Re: Cryptocurrency widget

Postby yamahama » Thu Nov 09, 2017 6:48 am

xenopeek wrote:If you have more links for where exchange rates can be fetched, I can easily turn it into a script that strings them together. Could make it something like this:


Damn, linux really is all about choice. consider my mind blown! And thank you for going out of your way to help a noob!!

I've added one entry from each of the major exchanges since it might be more helpful to others who might find this thread (crypto is all the rage these days and hopefully modifying the script to suit me personally shouldn't be too hard). I'm not sure how the script would parse the data so i've left the format similar to the exchange-ticker-list you linked.

Code: Select all

"url":"https://www.bitstamp.net/api/v2/ticker/btcusd/", "jsonPath":["last"]
"url":"https://coinbase.com/api/v1/currencies/exchange_rates", "jsonPath":["btc_to_usd"]
"url":"https://api.gdax.com/products/ETH-USD/ticker", "jsonPath":["price"]
"url":"https://api.kraken.com/0/public/Ticker?pair=LTCXBT", "jsonPath":["result","XLTCXXBT","c",0]
"url":"https://poloniex.com/public?command=returnTicker", "jsonPath":["USDT_XMR","last"]
"url":"https://bittrex.com/api/v1.1/public/getticker?market=btc-grs", "jsonPath":["result","last"]


I have found a somewhat workable solution as well: this kde widget for bitcoin that can be fairly easily modified to show tickers for other coins/exchanges by modifying the config files. it'll still be a bit fiddly since it'll show all coins with a btc symbol, and you'd have to remember which tickers are for which coins, and which coin you assigned to which preset exchange (for e.g. you'd set the preset coinmarketcap to show gdax eth-usd and the preset Bitmarket.pl to show, say kraken's xmr-usd).

I'm no expert but modifying this widget with more coins, icons and exchanges to turn it into a true cryptocurrency widget seems very doable and i'll be taking a crack at it this week.

User avatar
xenopeek
Level 24
Level 24
Posts: 21382
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Cryptocurrency widget

Postby xenopeek » Thu Nov 09, 2017 9:27 am

I found this website that has all the cryptocurrencies https://coinmarketcap.com/. Their ticker has the rates all in one file https://api.coinmarketcap.com/v1/ticker/. It's updated every 5 minutes.

Create a new text file somewhere in your home directory and put the following in it:

Code: Select all

#!/usr/bin/env bash

# Create a temporary file and set up a trap to delete it on exit.
temp="$(mktemp)"
trap "rm -rf '$temp'" EXIT

# Download the ticker file from https://coinmarketcap.com/. It is updated every 5 minutes.
curl -sS https://api.coinmarketcap.com/v1/ticker/ > "$temp"

# Extract all the exchange rates we want.
coins=("Bitcoin" "Ethereum" "Groestlcoin" "Litecoin" "Monero")
output=''
for coin in "${coins[@]}"; do
   symbol_usd=$(jq -Mr ".[] | select(.name == \"$coin\") | .symbol + \" \" +.price_usd" "$temp")
   if [[ -z $output ]]; then
      output=$symbol_usd
   else
      output="$output | $symbol_usd"
   fi
done
echo $output

Using your file manager, right-click the new file and go to properties and set the permissions to allow executing it. Now add the Command Output widget to your panel and set the command to the full path of your script file (e.g., /home/username/filename). Set the update interval as required. I'd say once every 5 minutes is good enough so make it 300000 ms? That should do it.

Here's how it looks (click to enlarge). It probably makes sense to add a second panel to your desktop and use that as a ticker bar.
Image
Image

User avatar
phd21
Level 13
Level 13
Posts: 4911
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Cryptocurrency widget

Postby phd21 » Thu Nov 09, 2017 1:16 pm

Hi "yamahama", "xenopeek", and others,

+1 "xenopeek", that is very cool and clever examples and usage for displaying crypto-currencies.

"yamahama" - Like I stated before those screenshots were for Linux Mint KDE 17.3, here is one from Linux Mint KDE 18.2 searching for "coin" in add new Plasma Widgets. As you pointed out as well, these widgets might be able to be modified as well. FYI: there are also other KDE plasma widgets for displaying web pages and web content that might be useful, webslice, webcut, web browser (display webpage on desktop widget), etc...

I still think "Donut" is the easiest and most complete crypto-currency display list application I have read about and tried. I think if you and others contact the developer, they would be open to suggestions, or it could be "forked". It would be nice to be able to tell it which crypto-currencies that a user is most interested in, like a "Favorites" selection, and those would be listed at the top, or separately; if it can do this already, I have not figured that out yet.

I do not have much experience with crypto-currencies, Bitcoin, etc... and their applications. This is my first time with this. But, I was thinking that maybe some of the crypto currency "wallets" and their associated applications, applets, desklets, widgets, screenlets, etc... might also provide a current list of those crypto-currencies that a user is interested in or using?

2017’s Best Bitcoin Desktop Wallets – 4 Wallets Reviewed (Mac, Windows, Linux)
https://99bitcoins.com/2017s-best-bitcoin-desktop-wallets-4-wallets-reviewed-mac-windows-linux/

FYI: Here are more links that I found:

Bitcoin Wiki
https://en.bitcoin.it/wiki/Software#PC_apps

Widget Wizard Make your own widget - scroll down to see example Java script
https://www.cryptocompare.com/dev/widget/wizard/?type=1&theme=0&fsym=BTC&tsym=USD&period=1D

Code: Select all

<script type="text/javascript">
baseUrl = "https://widgets.cryptocompare.com/";
var scripts = document.getElementsByTagName("script");
var embedder = scripts[ scripts.length - 1 ];
(function (){
var appName = encodeURIComponent(window.location.hostname);
if(appName==""){appName="local";}
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
var theUrl = baseUrl+'serve/v1/coin/chart?fsym=BTC&tsym=USD';
s.src = theUrl + ( theUrl.indexOf("?") >= 0 ? "&" : "?") + "app=" + appName;
embedder.parentNode.appendChild(s);
})();
</script>




Hope this helps ...

KDE18_Bitcoin_Widget.jpg
Phd21: Mint KDE 17.3 & 18.2, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,3gb Ram,160gb hdd, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

yamahama
Level 1
Level 1
Posts: 14
Joined: Mon Nov 06, 2017 7:08 am

Re: Cryptocurrency widget

Postby yamahama » Fri Nov 10, 2017 10:54 am

xenopeek wrote:Here's how it looks (click to enlarge). It probably makes sense to add a second panel to your desktop and use that as a ticker bar.


Thank you! It'll work nicely while i try to learn how to modify your script to list from multiple sources. coinmarketcap is convenient but not great when it comes to large differences between western and asian markets (since it displays an average).

I'm working on a simple widget that displays tickers from customizable api sources. i'm a complete newbie to qt and js so it'll take me a while but should have something functional in a week.

phd21 wrote:I still think "Donut" is the easiest and most complete crypto-currency display list application I have read about and tried. I think if you and others contact the developer, they would be open to suggestions, or it could be "forked". It would be nice to be able to tell it which crypto-currencies that a user is most interested in, like a "Favorites" selection, and those would be listed at the top, or separately; if it can do this already, I have not figured that out yet.


i really did like donut but as you pointed out it is still incomplete as it can't be configured in any way (couldn't find any info anywhere on where they get their prices either- maybe in config files). In its current state it works more like a cryptocurrency price checker than an 'at a glance' price monitor but I'm sure they have plans to add these necessities in the near future.

phd21 wrote:I do not have much experience with crypto-currencies, Bitcoin, etc... and their applications. This is my first time with this. But, I was thinking that maybe some of the crypto currency "wallets" and their associated applications, applets, desklets, widgets, screenlets, etc... might also provide a current list of those crypto-currencies that a user is interested in or using?


I'm not sure I follow. are you suggesting that, for e.g. a bitcoin wallet ought to have maybe a link that says "other coins you may be interested in"?

User avatar
xenopeek
Level 24
Level 24
Posts: 21382
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Cryptocurrency widget

Postby xenopeek » Fri Nov 10, 2017 11:46 am

Sure we can do it from multiple sources easily as well. Though as each uses a different precision (number of decimals for the fractional part) you may want some more processing to make that more uniform.

I picked these sources from the ones you gave earlier:

Code: Select all

"url":"https://www.bitstamp.net/api/v2/ticker/btcusd/", "jsonPath":["last"]
"url":"https://api.gdax.com/products/ETH-USD/ticker", "jsonPath":["price"]
"url":"https://api.kraken.com/0/public/Ticker?pair=LTCXBT", "jsonPath":["result","XLTCXXBT","c",0]
"url":"https://poloniex.com/public?command=returnTicker", "jsonPath":["USDT_XMR","last"]

The JSON path selection with jq is trivial for all of these.

Here's the script example for these:

Code: Select all

#!/usr/bin/env bash

bitcoin=$(curl -sS https://www.bitstamp.net/api/v2/ticker/btcusd/ | jq -Mr '.last')
ethereum=$(curl -sS https://api.gdax.com/products/ETH-USD/ticker | jq -Mr '.price')
litecoin=$(curl -sS https://api.kraken.com/0/public/Ticker?pair=LTCUSD | jq -Mr '.result.XLTCZUSD.c[0]')
monero=$(curl -sS https://poloniex.com/public?command=returnTicker | jq -Mr '.USDT_XMR.last')

echo "BTC $bitcoin | ETH $ethereum | LTC $litecoin | XMR $monero"

This outputs something like this:

Code: Select all

BTC 6824.00 | ETH 304.54000000 | LTC 60.93000 | XMR 106.88521244
Image

User avatar
phd21
Level 13
Level 13
Posts: 4911
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Cryptocurrency widget

Postby phd21 » Fri Nov 10, 2017 12:52 pm

Hi "yamahama",

yamahama wrote:I'm not sure I follow. are you suggesting that, for e.g. a bitcoin wallet ought to have maybe a link that says "other coins you may be interested in"?


As I stated before, I am a "newbie" with regards to the crypto-currency topic. While researching your post on this, it looked like some of the "wallets" in the links provided their own history (of course), and various crypto-currency tracking options. You would have to try them to find out. Obviously, let us know what you find out.
Phd21: Mint KDE 17.3 & 18.2, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,3gb Ram,160gb hdd, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

yamahama
Level 1
Level 1
Posts: 14
Joined: Mon Nov 06, 2017 7:08 am

Re: Cryptocurrency widget

Postby yamahama » Tue Nov 14, 2017 5:20 pm

xenopeek wrote:Sure we can do it from multiple sources easily as well.


Sorry for the late reply but thank you!

Been neck deep in javascript, pulling my hair out while trying to get my plasmoid to work (currently debugging) but am hard pressed to find many (or any) plasmoids that parse json data using js. Hopefully i can get over this last hurdle soon and share the widget with the community.

phd21 wrote: While researching your post on this, it looked like some of the "wallets" in the links provided their own history (of course), and various crypto-currency tracking options. You would have to try them to find out. Obviously, let us know what you find out.


Ah now i see. Yes that would be intriguing to say the least. it's a highly competitive and cut throat market where nrealy everyone is trying to gain the upper hand over everyone else, so an 'enlightened' take on competition (ie promoting competitors within your own platform) would be a breath of fresh air. but ultimately the decision would lie with the devs of the various applications who may or may not find co-existing harmoniously with 'the enemy' appealing.


Return to “Software & Applications”