i thought about, what else could be done in the same way.
Some time ago i came across a little script, that shows the goldprice per oz in terminal by use of a dedicated api.
As i am interested in goldprice, I thought about, to show the actual price within a tooltip showing up by use of the Xfce genmon-plugin.
So i tued it up to show more informations like price/fine/gram e.g. and created this script (may be one could refine it):
Code: Select all
#!/bin/bash # script for Xfce genmon-plugin to show goldprice as tooltip # created by secureIT@forums.linuxmint.com # name: goldprice # version=1.0 # # variables # # set your currency in next varible (USD EUR GBP) e.g. C=EUR # # script # oz=/oz g=/g fine=/fine fef=/585 ttt=/333 title=Goldprice # # get goldprice from api # goldprice=$(wget "https://rate-exchange-1.appspot.com/currency?from=XAU&to=$C" -q -O - | jq .rate) # # conversion to other weights or fineness # goldgram=$(echo "scale=2; $goldprice /31.10" | bc) goldgram585=$(echo "scale=2; $goldgram /1000 *585" | bc) goldgram333=$(echo "scale=2; $goldgram /1000 *333" | bc) # # attend variables with line feed to logwrite # logwrite="$title\n$goldprice $C $oz $fine\n "" "" "" $goldgram $C $g "" $fine\n "" "" "" $goldgram585 $C $g "" $fef\n "" "" "" $goldgram333 $C $g "" $ttt" # # write content from logwrite to the file .gold in home-directory # echo -e "$logwrite" > ~/.gold # # set icon for genmon-plugin # # this is an example how to set icon in LM 19 # icon="/usr/share/icons/gnome/32x32/emblems/emblem-web.png" # you can set your own icon by using the absolute path to it # so do not : ~/bin/PathtoMyicon but:e.g. /home/YourName/bin/icons-genmon/gold.png # note: the icons dimensions may not be greater than the height of the panel, where genmon sits in # # get content from the file .gold for the tooltip and write it to variable # tooltip=$(<~/.gold) # # show tooltip # echo "<img>$icon</img>" echo "<txt> </txt>" echo "<tool>$tooltip</tool>" exit 0
So i set the intervall in genmon-plugin to 1200 sec.
Tested and : works flawlessly ……
May be some of you would have any idea of another api that will refresh the price faster.
Or any ideas to refine the script ?
I'm happy about suggestions and any criticism of the script - or suggested solutions, how to do it better………