An exchange rate monitoring widget for awesome wm.
- Quickly check what your money is worth in other countries (useful if you shop online a lot)
- Keep track of what your stash of (whatever supported currency) is worth in terms of your money
- Simple and easy to use
- Adjust layout easily to find a format you like
Here's what NZD to USD looks like today.
Here's an example of the widget jammed into an existing layout.
Here's what a fictional quantity of BTC is worth in NZD today.
- this depends on
requests, json
inpython3
- this also depends on
awful, wibox
modules in lua (I think these are both packaged with awesomewm) - Get an api key from openexchangerates.org so you can use their api.
- clone this repo into .config/awesome/
- edit the config.py (see below)
- include and add the widget in your rc.lua file
- Set your base currency (BASE) and your target currency (TARGET) to whatever you use in daily life. For me, that would be NZD (my currency) and USD (what 90% of my purchases are).
- Adjust the decimal places for the main, extra, and condensed modes if you feel like it
- If you want a bulkier layout, like
1 NZD = 0.2 EUR
, then change mode fromSQUEEZE
toFULL
- Add all the currencies you care about in EXTRA as a list of 1/2/3-tuples
- Add in your appid
Note that
- 1-tuples here are just "what's 1 (my currency) worth"
- 2-tuples are "what's 'X target currency' worth in my currency"
- 3-tuples just add a format modifer
This is subject to change, and might be different for you than it is for me.
- open rc.lua
- import exchangeRates somewhere near the top of your file
local exchangeRates = require("awesomewm-exchange-rates.rates")
- call the function somewhere in your layout when the wibar is being created. For me, this looks like:
volumebar_widget({
main_color = '#dcdccc',
mute_color = '#ff0000',
width = 80,
shape = 'powerline',
margins = 8
}),
rateWidget(),
Exactly what openexchangerates supports. This includes a few cryptocurrencies. For more info, see https://docs.openexchangerates.org/docs/alternative-currencies.
Note that these values only update hourly (to avoid hitting the api rate limits). This is not suitable for trading purposes
While not directly following any guides, I did pull from some of the material that Pavel Makhov authored. Check him out at https://github.com/streetturtle/ or https://pavelmakhov.com/.