Swap i3blocks with polybar

This commit is contained in:
2017-11-16 16:28:12 +00:00
parent b60cddc4a9
commit 511e029ec2
13 changed files with 523 additions and 162 deletions

15
polybar/scripts/ipaddr.py Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/python
from urllib.request import urlopen
from xml.etree import ElementTree as ET
url = 'http://freegeoip.net/xml/'
with urlopen(url) as res:
s = res.read()
root = ET.fromstring(s)
ip = root.find('IP').text
country = root.find('CountryName').text
print('%s (%s)' % (ip, country))