diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-07 01:55:21 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-07 01:55:21 +0100 |
commit | 7fc6197dcd03a314d99539c2fecfd8702afc5d43 (patch) | |
tree | 061e623df947cf6e016c304dee6c1dc75f4d623a | |
parent | update todo (diff) | |
download | xpybar-7fc6197dcd03a314d99539c2fecfd8702afc5d43.tar.gz xpybar-7fc6197dcd03a314d99539c2fecfd8702afc5d43.tar.bz2 xpybar-7fc6197dcd03a314d99539c2fecfd8702afc5d43.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r-- | examples/moderate | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/examples/moderate b/examples/moderate index f424aa0..f25cbb1 100644 --- a/examples/moderate +++ b/examples/moderate @@ -53,31 +53,34 @@ linux_installed, linux_latest = None, None def uname(): global have_linux_libre, have_pacman, linux_installed, linux_latest + uname_ = Uname() + nodename = uname_.nodename + kernel_release = uname_.kernel_release + operating_system = uname_.operating_system + + lts = '-lts' if kernel_release.lower().endswith('-lts') else '' if have_pacman is None: + have_pacman = True 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: try: - linux_latest = Pacman('linux-libre' if have_linux_libre else 'linux', False) + linux_latest = Pacman(('linux-libre' if have_linux_libre else 'linux') + lts, False) except: have_pacman = None elif have_pacman: try: - linux_installed = Pacman('linux-libre' if have_linux_libre else 'linux', True) - linux_latest = Pacman('linux-libre' if have_linux_libre else 'linux', False) + linux_installed = Pacman(('linux-libre' if have_linux_libre else 'linux') + lts, True) + linux_latest = Pacman(('linux-libre' if have_linux_libre else 'linux') + lts, False) except: have_pacman = None - uname_ = Uname() - nodename = uname_.nodename - kernel_release = uname_.kernel_release - operating_system = uname_.operating_system if (have_pacman is not None) and have_pacman: linux_running = kernel_release.split('-') linux_running, kernel_release = linux_running[:2], linux_running[2:] |