diff options
author | streetturtle <streetturtle@gmail.com> | 2017-01-30 21:38:50 -0500 |
---|---|---|
committer | streetturtle <streetturtle@gmail.com> | 2017-01-30 21:40:01 -0500 |
commit | c4826fd21340d34e3592b0c8ca24fc068e52c6ef (patch) | |
tree | dbbc8fd3df693cfc57cbc1ff5246164f8fc41c01 /RatesWidget | |
parent | a079c79ab81a4bc2f7cf7971db6373fefe1e6110 (diff) |
new widgets added
Diffstat (limited to 'RatesWidget')
-rw-r--r-- | RatesWidget/currency.png | bin | 19289 -> 0 bytes | |||
-rw-r--r-- | RatesWidget/rates.lua | 39 | ||||
-rw-r--r-- | RatesWidget/rates.py | 9 | ||||
-rw-r--r-- | RatesWidget/ratesPopup.py | 11 | ||||
-rw-r--r-- | RatesWidget/readme.md | 8 |
5 files changed, 0 insertions, 67 deletions
diff --git a/RatesWidget/currency.png b/RatesWidget/currency.png Binary files differdeleted file mode 100644 index 4c7dbce..0000000 --- a/RatesWidget/currency.png +++ /dev/null diff --git a/RatesWidget/rates.lua b/RatesWidget/rates.lua deleted file mode 100644 index 6fa2e47..0000000 --- a/RatesWidget/rates.lua +++ /dev/null @@ -1,39 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") - -rateWidget = wibox.widget.textbox() - --- DBus (Command are sent to Dbus, which prevents Awesome from freezŅ) -sleepTimerDbus = timer ({timeout = 1800}) -sleepTimerDbus:connect_signal ("timeout", - function () - awful.util.spawn_with_shell("dbus-send --session --dest=org.naquadah.awesome.awful /com/console/rate com.console.rate.rateWidget string:$(python ~/.config/awesome/rates/rates.py)" ) - end) -sleepTimerDbus:start() -sleepTimerDbus:emit_signal("timeout") - -dbus.request_name("session", "com.console.rate") -dbus.add_match("session", "interface='com.console.rate', member='rateWidget' " ) -dbus.connect_signal("com.console.rate", - function (...) - local data = {...} - local dbustext = data[2] - rateWidget:set_text(dbustext) - end) - --- The notification popup which shows rates for other currencies -function showRatesPopup() - naughty.notify({ - title = "Rates", - text = awful.util.pread("python ~/.config/awesome/rates/ratesPopup.py"), - icon = "/home/username/.config/awesome/rates/currency.png", - icon_size = 100, - timeout = 10, - width = 300, - padding = 100, - fg = "#ffffff", - bg = "#333333aa", - }) -end - -rateWidget:connect_signal("mouse::enter", function() showRatesPopup() end)
\ No newline at end of file diff --git a/RatesWidget/rates.py b/RatesWidget/rates.py deleted file mode 100644 index 9a12462..0000000 --- a/RatesWidget/rates.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/python - -import requests -import json - -r = requests.get("http://api.fixer.io/latest?symbols=CHF,EUR") -resp = json.loads(r.content) - -print resp["rates"]["CHF"]
\ No newline at end of file diff --git a/RatesWidget/ratesPopup.py b/RatesWidget/ratesPopup.py deleted file mode 100644 index 4ac6cce..0000000 --- a/RatesWidget/ratesPopup.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/python - -import requests -import json - -r = requests.get("http://api.fixer.io/latest?symbols=USD,EUR,JPY,GBP,CHF,CAD,RUB") -resp = json.loads(r.content) -rates = resp["rates"] - -for currency, rate in rates.items(): - print currency, rate diff --git a/RatesWidget/readme.md b/RatesWidget/readme.md deleted file mode 100644 index d13bae1..0000000 --- a/RatesWidget/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# Rates Widget
-
-Widget for Awesome WM which displays the currency rate between Swiss Frank and Euro. For the rate API it uses [fixer.io](http://fixer.io/) - JSON API for foreign exchange rates and currency conversion. And a python script which calls this API.
-
-You can read more about it in these posts:
-
- - http://pavelmakhov.com/2016/01/how-to-create-widget/
- - http://pavelmakhov.com/2016/01/how-to-create-widget-part-2/
|