From 0a283817f07161e06d75427d06397868a082b29d Mon Sep 17 00:00:00 2001 From: Arne Schauf Date: Sat, 30 Jan 2016 14:10:29 +0100 Subject: [PATCH] show external IP in infobar --- qtile_config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qtile_config.py b/qtile_config.py index 4e70b96..9b33533 100644 --- a/qtile_config.py +++ b/qtile_config.py @@ -110,6 +110,12 @@ widget_defaults = dict( padding=3, ) + +def getIp(): + import requests + r = requests.get("http://ipv4.nsupdate.info/myip") + return r.text + screens = [ Screen( top=bar.Bar( @@ -126,6 +132,7 @@ screens = [ [ widget.WindowName(), widget.Notify(), + widget.GenPollText(func=getIp), widget.Sep(), widget.ThermalSensor(tag_sensor='Core 0'), widget.ThermalSensor(tag_sensor='temp1'),