blob: 46ba1a1d8ae0b4d018602058d01f994849fc7e6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
------------------------------------------------------------------------------
-- |
-- Module : Plugins.Monitors.Uptime.Linux
-- Copyright : (c) 2010 Jose Antonio Ortega Ruiz
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : jao@gnu.org
-- Stability : unstable
-- Portability : unportable
-- Created: Sun Dec 12, 2010 20:26
--
--
-- Uptime
--
------------------------------------------------------------------------------
module Xmobar.Plugins.Monitors.Uptime.Linux (readUptime) where
import qualified Data.ByteString.Lazy.Char8 as B
readUptime :: IO Float
readUptime =
fmap (read . B.unpack . head . B.words) (B.readFile "/proc/uptime")
|