aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-03 23:40:59 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-03 23:40:59 +0100
commitcf19015c665fa067034e94be1fdc315e94bb2b04 (patch)
tree706f660a60243100b282437c77cc8b1e56e46250 /examples
parentadd chase (diff)
downloadxpybar-cf19015c665fa067034e94be1fdc315e94bb2b04.tar.gz
xpybar-cf19015c665fa067034e94be1fdc315e94bb2b04.tar.bz2
xpybar-cf19015c665fa067034e94be1fdc315e94bb2b04.tar.xz
add solar information
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/moderate11
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/moderate b/examples/moderate
index e7407e5..5a2cfab 100644
--- a/examples/moderate
+++ b/examples/moderate
@@ -2,6 +2,7 @@
# A moderate xpybar configuration example that has a few monitors that are updates continuously
+import os
import time
from plugins.clock import Clock
@@ -13,6 +14,7 @@ from plugins.pacman import Pacman
from plugins.uname import Uname
from plugins.weather import Weather
from plugins.chase import Chase
+from plugins.solar import Solar
OUTPUT, YPOS, TOP = 0, 24, True
@@ -191,18 +193,25 @@ def chase():
return '\033[%smChase\033[0m' % status
+solar_ = os.environ['HOME'] + '/.xpybar.sun'
+def sun():
+ try:
+ return Solar(solar_).output
+ except:
+ return '¿Cannot get solar information?'
functions = [ Sometimes(lambda : clock_.read(), 1 * 2),
lambda : time.time() % 1,
Sometimes(users, 1 * 2),
weather,
chase,
+ Sometimes(sun, 1 * 2),
cpu,
memory,
network,
Sometimes(uname, 30 * 60 * 2),
]
-pattern = [ '%s │ %.2f │ %s │ %s │ %s }{ %s │ %s │ %s │ %s'
+pattern = [ '%s │ %.2f │ %s │ %s │ %s │ %s }{ %s │ %s │ %s │ %s'
]