aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/LayoutDraw.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-03-28 23:27:45 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-03-28 23:27:45 -0600
commit685d67d19d2e94fc94ed7334e5e7ab19454426d7 (patch)
treea4df88d0c9d98d3ba7513bc6c679c80a96c112e0 /src/Internal/LayoutDraw.hs
parentefe9e1a5f8474a865e2762d3a795dbe43763985b (diff)
downloadrde-685d67d19d2e94fc94ed7334e5e7ab19454426d7.tar.gz
rde-685d67d19d2e94fc94ed7334e5e7ab19454426d7.tar.bz2
rde-685d67d19d2e94fc94ed7334e5e7ab19454426d7.zip
Fix things that Hlint is complaining about.
Diffstat (limited to 'src/Internal/LayoutDraw.hs')
-rw-r--r--src/Internal/LayoutDraw.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Internal/LayoutDraw.hs b/src/Internal/LayoutDraw.hs
index 8b029bd..131b32b 100644
--- a/src/Internal/LayoutDraw.hs
+++ b/src/Internal/LayoutDraw.hs
@@ -43,17 +43,17 @@ import qualified XMonad.StackSet as S
drawLayout :: X (Bool, String, String)
drawLayout = do
winset <- X.gets X.windowset
- let layout = S.layout $ S.workspace $ S.current $ winset
+ let layout = S.layout $ S.workspace $ S.current winset
-- Gotta reset the layout to a consistent state.
- layout' <- foldM (flip ($)) layout $ [
+ layout' <- foldM (flip ($)) layout [
handleMessage' $ ModifyWindowBorder $ const $ Border 0 0 0 0,
- handleMessage' $ Unzoom
+ handleMessage' Unzoom
]
(cached, xpm) <- drawXpmIO layout'
- return $ (cached, X.description layout, printf "<icon=%s/>" xpm)
+ return (cached , X.description layout, printf "<icon=%s/>" xpm)
-- Returns true if a point is inside a rectangle (inclusive).
pointInRect :: (Dimension, Dimension) -> Rectangle -> Bool
@@ -98,14 +98,14 @@ drawXpmIO l = do
(S.Workspace "0" l (S.differentiate [1 .. 5]))
(Rectangle 0 0 ((w + shrinkAmt) * sf) ((h + shrinkAmt) * sf))
- let rects = flip map rects' $ \(_, (Rectangle x y w h)) ->
+ let rects = flip map rects' $ \(_, Rectangle x y w h) ->
Rectangle (x `div` sf) (y `div` sf) (w `div` sf) (h `div` sf)
X.liftIO $ do
exists <- doesFileExist iconPath
createDirectoryIfMissing True iconCacheDir
- when (not exists) $ do
+ unless exists $ do
let xpmText = drawXpm (w, h) (zip (cycle colors) rects) 4
writeFile iconPath xpmText