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

7
polybar/scripts/ping.py Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/python
import subprocess
import re
url = 'google.co.uk'
ps = subprocess.Popen('ping -c 1 %s | tail -1 | awk \'{print $4}\' | cut -d \'/\' -f 2' % url, shell=True, stdout=subprocess.PIPE)
print(re.sub(r'[^0-9.+]', '', str(ps.stdout.read())).split('.')[0])