I'm running Debian & Ubuntu and I've been using this script running in a terminal for a while but I find I easily get obsessed with the price. Instead I'd rather get, say hourly, desktop notifications.
Is there a simple way to do this?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
I modified the script and used notify-send to get what I wanted. I run the lightweight notification daemon
xfce4-notifyd but most desktop environments (Gnome, KDE, Xfce) should have one preinstalled (for example Gnome's
It depends on the
jq command, so make sure you install it first using your package manager.
Here's the script:
#!/bin/sh # Requires jq # Remember to chmod +x! # # Add the following cron-job (using "crontab -e") to run at hourly intervals: # 0 * * * * export DISPLAY=:0.0 && /bin/bash <SCRIPT_PATH_GOES_HERE> > /dev/null 2>&1 # Change <SCRIPT_PATH_GOES_HERE> to the appropriate name BTCE_PRICE="$(curl -s https://btc-e.com/api/2/btc_usd/ticker | jq '.ticker.last')" MTGOX_PRICE="$(curl -s http://data.mtgox.com/api/2/BTCUSD/money/ticker_fast | jq '.data.last.display' | cut -d "\"" -f 2)" notify-send "MtGox: $MTGOX_PRICE BTC-e: \$$BTCE_PRICE"
Also available here
In order to run it on hourly intervals add the following line to your crontab using
0 * * * * export DISPLAY=:0.0 && /bin/bash <SCRIPT_PATH_GOES_HERE> > /dev/null 2>&1