aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-06 19:16:12 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-06 19:16:12 +0100
commita22ce9d153aed16fc91781ac096758236b238795 (patch)
tree03ee880eb7d48919c69bf5383dc024de84571171 /examples
parentadd KB/s to network speed in moderate example (diff)
downloadxpybar-a22ce9d153aed16fc91781ac096758236b238795.tar.gz
xpybar-a22ce9d153aed16fc91781ac096758236b238795.tar.bz2
xpybar-a22ce9d153aed16fc91781ac096758236b238795.tar.xz
add linux-lts detection (since linux 3.13.5 does not work)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--examples/plugin-test17
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/plugin-test b/examples/plugin-test
index 711ef11..486212d 100644
--- a/examples/plugin-test
+++ b/examples/plugin-test
@@ -56,24 +56,23 @@ def redraw():
users = ['%s{%i}' % (colour_user(u) % u, len(users_[u])) for u in users_.keys()]
users = 'Users: %s' % (' '.join(users))
+ uname_ = Uname()
+ nodename = uname_.nodename
+ kernel_release = uname_.kernel_release
+ operating_system = uname_.operating_system
+ lts = '-lts' if kernel_release.lower().endswith('-lts') else ''
have_linux_libre, have_pacman = True, True
linux_installed, linux_latest = None, None
try:
- linux_installed = Pacman('linux-libre', True)
+ linux_installed = Pacman('linux-libre' + lts, True)
except:
have_linux_libre = False
try:
- linux_installed = Pacman('linux', True)
+ linux_installed = Pacman('linux' + lts, True)
except:
have_pacman = False
if have_pacman:
- linux_latest = Pacman('linux-libre' if have_linux_libre else 'linux', False)
-
- uname_ = Uname()
- nodename = uname_.nodename
- kernel_release = uname_.kernel_release
- operating_system = uname_.operating_system
- if have_pacman:
+ linux_latest = Pacman('linux-libre' + lts if have_linux_libre else 'linux' + lts, False)
linux_running = kernel_release.split('-')
linux_running, kernel_release = linux_running[:2], linux_running[2:]
linux_running = '-'.join(linux_running)