summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@imladris>2014-05-04 13:43:47 +0200
committerJose Antonio Ortega Ruiz <jao@imladris>2014-05-04 13:43:47 +0200
commit2fe068efbe6cead812630e0c426c2247f5431ce7 (patch)
treea048948065409767ade3996edd7c0969cd6a26e0 /src
parentccd376c7f1c148df078d5ff283a9dcb8045d29bf (diff)
downloadxmobar-2fe068efbe6cead812630e0c426c2247f5431ce7.tar.gz
xmobar-2fe068efbe6cead812630e0c426c2247f5431ce7.tar.bz2
Accepting "unknown" as network device state
Cf. discussion of issue #98
Diffstat (limited to 'src')
-rw-r--r--src/Plugins/Monitors/Net.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Plugins/Monitors/Net.hs b/src/Plugins/Monitors/Net.hs
index c2e1cf2..e49d1aa 100644
--- a/src/Plugins/Monitors/Net.hs
+++ b/src/Plugins/Monitors/Net.hs
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Plugins.Monitors.Net
--- Copyright : (c) 2011, 2012, 2013 Jose Antonio Ortega Ruiz
+-- Copyright : (c) 2011, 2012, 2013, 2014 Jose Antonio Ortega Ruiz
-- (c) 2007-2010 Andrea Rossato
-- License : BSD-style (see LICENSE)
--
@@ -67,7 +67,7 @@ existingDevs = getDirectoryContents "/sys/class/net" >>= filterM isDev
isUp :: String -> IO Bool
isUp d = do
operstate <- B.readFile (operstateDir d)
- return $ "up" == (B.unpack . head . B.lines) operstate
+ return $ (B.unpack . head . B.lines) operstate `elem` ["up", "unknown"]
readNetDev :: [String] -> IO NetDev
readNetDev (d:x:y:_) = do