<p>I modified the script and used notify-send to get what I wanted. I run the lightweight notification daemon <code>xfce4-notifyd</code> but most desktop environments (Gnome, KDE, Xfce) should have one preinstalled (for example Gnome's <code>notification-daemon</code>).</p>

<p>It depends on the <code>jq</code> command, so make sure you install it first using your package manager.</p>

<p>Here's the script:</p>

<pre><code>#!/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 &amp;&amp; /bin/bash &lt;SCRIPT_PATH_GOES_HERE&gt; &gt; /dev/null 2&gt;&amp;1
# Change &lt;SCRIPT_PATH_GOES_HERE&gt; 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"
</code></pre>

<p>Also available <a href="https://gist.github.com/ErikBjare/8332113" rel="nofollow">here</a></p>

<p>In order to run it on hourly intervals add the following line to your crontab using <code>crontab -e</code>:  </p>

<pre><code>0 * * * * export DISPLAY=:0.0 &amp;&amp; /bin/bash &lt;SCRIPT_PATH_GOES_HERE&gt; &gt; /dev/null 2&gt;&amp;1
</code></pre>

CC BY-SA 3.0
2014-01-09T18:45:34.980Z
2014-01-09T18:45:34.980Z
erb
<p>Assuming your script is called <code>btce_ticker.sh</code>, the following line would do it:</p>

<pre><code>while true; do btce_ticker.sh; sleep 3600; done
</code></pre>

<p>The <code>sleep 3600</code> sleeps for an hour before looping around and running the script again.</p>

CC BY-SA 3.0
2014-01-09T10:36:44.843Z
I don't want a terminal notification, instead I'd like a desktop notification. I solved it but can't answer my own question yet (apparently a forced 8h delay) since I have <10 rep. The script is here however: https://gist.github.com/ErikBjare/8332113
erb
CC BY-SA 3.0
2014-01-09T20:04:01.603Z
@erb: I note that you didn't actually say "desktop" in your original question.
Greg Hewgill
CC BY-SA 3.0
2014-01-09T20:10:02.777Z
Yeah I forgot to mention that, sorry.
erb
CC BY-SA 3.0
2014-01-09T10:34:07.237Z
2014-01-09T10:34:07.237Z
Greg Hewgill
<p>I'm running Debian &amp; Ubuntu and I've been using <a href="https://gist.github.com/ErikBjare/8332003" rel="nofollow">this script</a> 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.</p>

<p>Is there a simple way to do this?</p>

CC BY-SA 3.0
2014-01-10T00:34:24.563Z
This question appears to be off-topic because it is about some particular script, not crytocurrencies in general
Salvador Dali
CC BY-SA 3.0
2014-01-10T07:15:35.237Z
Agreed, this is technically programming so it might be better suited for http://stackoverflow.com.
Greg Hewgill
CC BY-SA 3.0
2014-01-10T08:53:25.467Z
I was initially looking for a premade solution, the answer became programming-oriented when I couldn't find any. The question was never about the script, it was just some background to my question.
erb
<linux><exchange-rate><tools>
Hourly price notifications on Linux
erb
# Hourly price notifications on Linux

(Asked by: username_0 on 2014-01-09)

I'm running Debian & Ubuntu and I've been using [this script](https://gist.github.com/ErikBjare/8332003) 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?

**Tags:** linux, exchange-rate, tools

> **Comments:**
> **username_1**: This question appears to be off-topic because it is about some particular script, not crytocurrencies in general  
> **username_2**: Agreed, this is technically programming so it might be better suited for http://stackoverflow.com.  
> **username_0**: I was initially looking for a premade solution, the answer became programming-oriented when I couldn't find any. The question was never about the script, it was just some background to my question.  

---

## 2 answers

### Answer by username_0 on 2014-01-09. Score: -1 | Accepted answer

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 `notification-daemon`).

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](https://gist.github.com/ErikBjare/8332113)

In order to run it on hourly intervals add the following line to your crontab using `crontab -e`:

```
0 * * * * export DISPLAY=:0.0 && /bin/bash <SCRIPT_PATH_GOES_HERE> > /dev/null 2>&1

```


---

### Answer by username_2 on 2014-01-09. Score: 0

Assuming your script is called `btce_ticker.sh`, the following line would do it:

```
while true; do btce_ticker.sh; sleep 3600; done

```

The `sleep 3600` sleeps for an hour before looping around and running the script again.

> **Comments:**
> **username_0**: I don't want a terminal notification, instead I'd like a desktop notification. I solved it but can't answer my own question yet (apparently a forced 8h delay) since I have <10 rep. The script is here however: https://gist.github.com/ErikBjare/8332113  
> **username_2**: @username_0: I note that you didn't actually say "desktop" in your original question.  
> **username_0**: Yeah I forgot to mention that, sorry.  

---

