diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-06 19:16:12 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-06 19:16:12 +0100 |
commit | a22ce9d153aed16fc91781ac096758236b238795 (patch) | |
tree | 03ee880eb7d48919c69bf5383dc024de84571171 /examples | |
parent | add KB/s to network speed in moderate example (diff) | |
download | xpybar-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 'examples')
-rw-r--r-- | examples/plugin-test | 17 |
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) |