summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar.hs
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2012-05-05 22:13:34 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2012-05-05 22:13:34 +0200
commitca907c115fe6b4ce4cb3362d2d6f5d6d4abe6174 (patch)
tree9e747ee2e179d18871f7de2dd7884336dae19e98 /src/Xmobar.hs
parentc8346ee3e40056736fd77d7bb7fd8504ed411455 (diff)
downloadxmobar-ca907c115fe6b4ce4cb3362d2d6f5d6d4abe6174.tar.gz
xmobar-ca907c115fe6b4ce4cb3362d2d6f5d6d4abe6174.tar.bz2
Linting
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r--src/Xmobar.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index ab8de0a..2358a20 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -82,8 +82,10 @@ startLoop :: XConf -> [[(Maybe ThreadId, TVar String)]] -> IO ()
startLoop xcfg@(XConf _ _ w _ _) vs = do
tv <- atomically $ newTVar []
sig <- setupSignalHandler
- _ <- forkIO (checker tv [] vs sig `catch` \(SomeException _) -> putStrLn "Thread checker failed" >> return ())
- _ <- forkIO (eventer sig `catch` \(SomeException _) -> putStrLn "Thread eventer failed" >> return ())
+ _ <- forkIO (checker tv [] vs sig `catch`
+ \(SomeException _) -> void (putStrLn "Thread checker failed"))
+ _ <- forkIO (eventer sig `catch`
+ \(SomeException _) -> void (putStrLn "Thread eventer failed"))
eventLoop tv xcfg sig
where
-- Reacts on events from X
@@ -104,7 +106,11 @@ startLoop xcfg@(XConf _ _ w _ _) vs = do
_ -> return ()
-- | Send signal to eventLoop every time a var is updated
-checker :: TVar [String] -> [String] -> [[(Maybe ThreadId, TVar String)]] -> MVar SignalType -> IO ()
+checker :: TVar [String]
+ -> [String]
+ -> [[(Maybe ThreadId, TVar String)]]
+ -> MVar SignalType
+ -> IO ()
checker tvar ov vs signal = do
nval <- atomically $ do
nv <- mapM concatV vs
@@ -233,7 +239,7 @@ setPosition p rs ht =
ax L = const rx
ax R = right
ax C = center
- pw i = rw * (min 100 i) `div` 100
+ pw i = rw * min 100 i `div` 100
nw = fi . pw . fi
h = fi ht
mh h' = max (fi h') h
@@ -273,7 +279,7 @@ getStrutValues r@(Rectangle x y w h) p rwh =
Bottom -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
BottomW _ _ -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
BottomSize {} -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
- Static _ _ _ _ -> getStaticStrutValues p rwh
+ Static {} -> getStaticStrutValues p rwh
where st = fi y + fi h
sb = rwh - fi y
nx = fi x