From f7e4b2be56f20862191e05fa4509473a1bc92f5a Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 25 Nov 2018 06:28:21 +0000 Subject: Wee refactoring --- src/lib/Xmobar/Commands.hs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/lib/Xmobar/Commands.hs') diff --git a/src/lib/Xmobar/Commands.hs b/src/lib/Xmobar/Commands.hs index 93a9590..5917bb8 100644 --- a/src/lib/Xmobar/Commands.hs +++ b/src/lib/Xmobar/Commands.hs @@ -17,14 +17,9 @@ -- ----------------------------------------------------------------------------- -module Xmobar.Commands - ( Command (..) - , Exec (..) - , tenthSeconds - ) where +module Xmobar.Commands (Command (..), Exec (..)) where import Prelude -import Control.Concurrent import Control.Exception (handle, SomeException(..)) import Data.Char import System.Process @@ -32,7 +27,7 @@ import System.Exit import System.IO (hClose) import Xmobar.System.Signal -import Xmobar.Utils (hGetLineSafe) +import Xmobar.Utils (hGetLineSafe, tenthSeconds) class Show e => Exec e where alias :: e -> String @@ -75,13 +70,3 @@ instance Exec Command where closeHandles cb str _ -> closeHandles >> cb msg - - --- | Work around to the Int max bound: since threadDelay takes an Int, it --- is not possible to set a thread delay grater than about 45 minutes. --- With a little recursion we solve the problem. -tenthSeconds :: Int -> IO () -tenthSeconds s | s >= x = do threadDelay (x * 100000) - tenthSeconds (s - x) - | otherwise = threadDelay (s * 100000) - where x = (maxBound :: Int) `div` 100000 -- cgit v1.2.3