summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/App/EventLoop.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-01-28 02:45:00 +0000
committerjao <jao@gnu.org>2022-01-29 06:42:29 +0000
commita5c35003c88c4b050e56cfb5d93a0e0d77d9c223 (patch)
tree6d8ba586dec5cb5154291cebc52658ac119eb7b6 /src/Xmobar/App/EventLoop.hs
parent1e2c4f20d095c7dbaf0c8d2cf9a8b095388a10d4 (diff)
downloadxmobar-a5c35003c88c4b050e56cfb5d93a0e0d77d9c223.tar.gz
xmobar-a5c35003c88c4b050e56cfb5d93a0e0d77d9c223.tar.bz2
Whitespace
Diffstat (limited to 'src/Xmobar/App/EventLoop.hs')
-rw-r--r--src/Xmobar/App/EventLoop.hs21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/Xmobar/App/EventLoop.hs b/src/Xmobar/App/EventLoop.hs
index ae68e96..f046647 100644
--- a/src/Xmobar/App/EventLoop.hs
+++ b/src/Xmobar/App/EventLoop.hs
@@ -2,8 +2,8 @@
------------------------------------------------------------------------------
-- |
--- Module: Xmobar.X11.EventLoop
--- Copyright: (c) 2018, 2020 Jose Antonio Ortega Ruiz
+-- Module: Xmobar.App.EventLoop
+-- Copyright: (c) 2018, 2020, 2022 Jose Antonio Ortega Ruiz
-- License: BSD3-style (see LICENSE)
--
-- Maintainer: jao@gnu.org
@@ -249,21 +249,26 @@ startCommand sig (com,s,ss)
return ([a1, a2], var)
where is = s ++ "Updating..." ++ ss
-updateString :: Config -> TVar [String]
- -> IO [[(Widget, TextRenderInfo, Int, Maybe [Action])]]
+updateString :: Config
+ -> TVar [String]
+ -> IO [[(Widget, TextRenderInfo, Int, Maybe [Action])]]
updateString conf v = do
s <- readTVarIO v
let l:c:r:_ = s ++ repeat ""
liftIO $ mapM (parseString conf) [l, c, r]
-updateActions :: XConf -> Rectangle -> [[(Widget, TextRenderInfo, Int, Maybe [Action])]]
- -> IO [([Action], Position, Position)]
+updateActions :: XConf
+ -> Rectangle
+ -> [[(Widget, TextRenderInfo, Int, Maybe [Action])]]
+ -> IO [([Action], Position, Position)]
updateActions conf (Rectangle _ _ wid _) ~[left,center,right] = do
let (d,fs) = (display &&& fontListS) conf
- strLn :: [(Widget, TextRenderInfo, Int, Maybe [Action])] -> IO [(Maybe [Action], Position, Position)]
+ strLn :: [(Widget, TextRenderInfo, Int, Maybe [Action])]
+ -> IO [(Maybe [Action], Position, Position)]
strLn = liftIO . mapM getCoords
iconW i = maybe 0 Bitmap.width (lookup i $ iconS conf)
- getCoords (Text s,_,i,a) = textWidth d (safeIndex fs i) s >>= \tw -> return (a, 0, fi tw)
+ getCoords (Text s,_,i,a) =
+ textWidth d (safeIndex fs i) s >>= \tw -> return (a, 0, fi tw)
getCoords (Icon s,_,_,a) = return (a, 0, fi $ iconW s)
getCoords (Hspace w,_,_,a) = return (a, 0, fi w)
partCoord off xs = map (\(a, x, x') -> (fromJust a, x, x')) $