packages feed

nc-indicators 0.1 → 0.2

raw patch · 3 files changed

+14/−5 lines, 3 files

Files

README.md view
@@ -19,3 +19,9 @@ `nc-indicators` uses the standard system tray icon protocol, so it can be used with any system tray-like application, not just `i3bar`. But it was originally created to be used with `i3bar`.++## FAQs++* What's up with the name? Why _nc_ indicators?++  The two authors together make up http://nilcons.com.
nc-indicators.cabal view
@@ -1,5 +1,5 @@ Name: nc-indicators-Version: 0.1+Version: 0.2 License: Apache-2.0 License-File: LICENSE Author: Mihaly Barasz, Gergely Risko@@ -8,7 +8,7 @@ Build-Type: Simple Category: System Stability: experimental-Homepage: https://github.com/nilcons/nc-indicators/issues+Homepage: https://github.com/nilcons/nc-indicators Bug-Reports: https://github.com/nilcons/nc-indicators/issues Synopsis: CPU load and memory usage indicators for i3bar Description:
nc-indicators.hs view
@@ -83,12 +83,15 @@     parseHead :: AP.Parser MEMCounters     parseHead =       wrapResult <$ "MemTotal:" .*> skipSpace <*> decimal <* kb <*-        "MemFree:" .*> skipSpace <*> decimal <* kb <*+        "MemFree:" .*> skipSpace <*> decimal <* kb <*>+        maybeMemAvailable <*         "Buffers:" .*> skipSpace <* (skipWhile isDigit) <* kb <*         "Cached:" .*> skipSpace <*> decimal <* kb     kb = skipSpace *> "kB" .*> skipSpace-    wrapResult total free cached =-      MEMCounters total cached free+    maybeMemAvailable =+      Just <$ "MemAvailable:" .*> skipSpace <*> decimal <* kb <|> pure Nothing+    wrapResult total free mAvailable cached =+      MEMCounters total cached $ maybe free id mAvailable  forceParse :: AP.Parser a -> BS.ByteString -> a forceParse parser = either error id . AP.parseOnly parser