Add Ethereum ticker
This commit is contained in:
@@ -28,7 +28,7 @@ font-0 = NotoSans\-Regular:pixelsize=10;2
|
||||
font-1 = FontAwesome:pixelsize=10;2
|
||||
|
||||
modules-left = topmenu pavolume
|
||||
modules-center = cmus
|
||||
modules-center = xwindow
|
||||
modules-right = vpn ping date
|
||||
|
||||
[bar/magnumtop]
|
||||
@@ -66,7 +66,7 @@ font-0 = NotoSans\-Regular:pixelsize=10;2
|
||||
font-1 = FontAwesome:pixelsize=10;2
|
||||
|
||||
modules-left = i3
|
||||
modules-center = xwindow
|
||||
modules-center = cmus
|
||||
modules-right = cpu memory
|
||||
|
||||
[bar/magnumbottom]
|
||||
@@ -106,7 +106,7 @@ module-margin = 4
|
||||
font-0 = fixed:pixelsize=10;2
|
||||
font-1 = FontAwesome:pixelsize=10;2
|
||||
|
||||
modules-left = i3 pacman bitcoin
|
||||
modules-left = i3 pacman bitcoin ethereum
|
||||
modules-right = filesystem
|
||||
|
||||
[module/bspwm]
|
||||
@@ -184,6 +184,13 @@ format = <label>
|
||||
format-prefix = " "
|
||||
exec = ~/.dotfiles/polybar/scripts/bitcoin.py
|
||||
|
||||
[module/ethereum]
|
||||
type = custom/script
|
||||
interval = 300
|
||||
format = <label>
|
||||
format-prefix = "E "
|
||||
exec = ~/.dotfiles/polybar/scripts/ethereum.py
|
||||
|
||||
[module/cmus]
|
||||
type = custom/script
|
||||
interval = 1
|
||||
|
||||
10
polybar/scripts/ethereum.py
Executable file
10
polybar/scripts/ethereum.py
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import requests
|
||||
|
||||
try:
|
||||
r = requests.get('https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=GBP');
|
||||
ticker = r.json()
|
||||
print('£%.2f' % float(ticker['GBP']))
|
||||
except requests.exceptions.RequestException as e:
|
||||
sys.exit(1)
|
||||
Reference in New Issue
Block a user