xmobar 0.24 → 0.24.1
raw patch · 7 files changed
+27/−10 lines, 7 files
Files
- news.md +9/−1
- readme.md +2/−2
- src/Environment.hs +2/−1
- src/Plugins/MarqueePipeReader.hs +5/−4
- src/Plugins/Monitors/Batt.hs +7/−1
- src/Plugins/PipeReader.hs +1/−0
- xmobar.cabal +1/−1
news.md view
@@ -1,6 +1,14 @@ % xmobar - Release notes -## Version 0.24+## Version 0.24.1 (Jul 28, 2016)++_Bug fixes_++ - Restoring compatibility with GHC 7.6, (see [issue #269]).++[issue #268]: https://github.com/jaor/xmobar/issues/269++## Version 0.24 (Jul 26, 2016) _New features_
readme.md view
@@ -10,7 +10,7 @@ features, like dynamic color management, icons, output templates, and extensibility through plugins. -This page documents xmobar 0.24 (see [release notes]).+This page documents xmobar 0.24.1 (see [release notes]). [This screenshot] shows xmobar running under [sawfish], with antialiased fonts. And [this one] is my desktop with [xmonad] and two@@ -1602,7 +1602,7 @@ This software is released under a BSD-style license. See [LICENSE] for more details. -Copyright © 2010-2014 Jose Antonio Ortega Ruiz+Copyright © 2010-2016 Jose Antonio Ortega Ruiz Copyright © 2007-2010 Andrea Rossato
src/Environment.hs view
@@ -13,6 +13,7 @@ ----------------------------------------------------------------------------- module Environment where +import Control.Applicative ((<$>)) import Data.Maybe (fromMaybe) import System.Environment (lookupEnv) @@ -36,7 +37,7 @@ False -> do remainder <- expandEnv $ drop 1 s return $ escString s ++ remainder- where escString s' = let (cc:ss) = s' in+ where escString s' = let (cc:_) = s' in case cc of 't' -> "\t" 'n' -> "\n"
src/Plugins/MarqueePipeReader.hs view
@@ -22,9 +22,10 @@ import Control.Concurrent.STM (TChan, atomically, writeTChan, tryReadTChan, newTChan) import Control.Exception import Control.Monad(forever, unless)+import Control.Applicative ((<$>)) type Length = Int -- length of the text to display-type Rate = Int -- delay in tenth seconds +type Rate = Int -- delay in tenth seconds type Separator = String -- if text wraps around, use separator data MarqueePipeReader = MarqueePipeReader String (Length, Rate, Separator) String@@ -48,16 +49,16 @@ pipeToChan :: Handle -> TChan String -> IO () pipeToChan h chan = do- line <- hGetLineSafe h + line <- hGetLineSafe h atomically $ writeTChan chan line writer :: String -> Separator -> Length -> Rate -> TChan String -> (String -> IO ()) -> IO ()-writer txt sep len rate chan cb = do +writer txt sep len rate chan cb = do cb (take len txt) mbnext <- atomically $ tryReadTChan chan case mbnext of Just new -> writer (toInfTxt new sep) sep len rate chan cb- Nothing -> tenthSeconds rate >> writer (drop 1 txt) sep len rate chan cb + Nothing -> tenthSeconds rate >> writer (drop 1 txt) sep len rate chan cb toInfTxt :: String -> String -> String toInfTxt line sep = concat (repeat $ line ++ " " ++ sep ++ " ")
src/Plugins/Monitors/Batt.hs view
@@ -21,8 +21,9 @@ import System.IO (IOMode(ReadMode), hGetLine, withFile) import System.Posix.Files (fileExist) import System.Console.GetOpt-import Data.List (sort, sortOn, group)+import Data.List (sort, sortBy, group) import Data.Maybe (fromMaybe)+import Data.Ord (comparing) import Text.Read (readMaybe) data BattOpts = BattOpts@@ -162,6 +163,11 @@ onError = const (return (-1)) :: SomeException -> IO Float grabs f = handle onError' $ withFile f ReadMode hGetLine onError' = const (return "Idle") :: SomeException -> IO String++-- sortOn is only available starting at ghc 7.10+sortOn :: Ord b => (a -> b) -> [a] -> [a]+sortOn f =+ map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x)) readBatteries :: BattOpts -> [Files] -> IO Result readBatteries opts bfs =
src/Plugins/PipeReader.hs view
@@ -21,6 +21,7 @@ import Control.Concurrent(threadDelay) import Control.Exception import Control.Monad(forever, unless)+import Control.Applicative ((<$>)) data PipeReader = PipeReader String String deriving (Read, Show)
xmobar.cabal view
@@ -1,5 +1,5 @@ name: xmobar-version: 0.24+version: 0.24.1 homepage: http://xmobar.org synopsis: A Minimalistic Text Based Status Bar description: Xmobar is a minimalistic text based status bar.