aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-04-16 00:20:03 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-04-16 00:20:03 -0600
commitd1a00e6e42b4b513f7de66a9e710f62faca2ef00 (patch)
treedd16af5c820d5567df7f1bb8a7a2ca2ac0950d47 /src
parent7a5051f7955a8b4e69b2c28b5a9b34f9730e21f0 (diff)
downloadrde-d1a00e6e42b4b513f7de66a9e710f62faca2ef00.tar.gz
rde-d1a00e6e42b4b513f7de66a9e710f62faca2ef00.tar.bz2
rde-d1a00e6e42b4b513f7de66a9e710f62faca2ef00.zip
fix some hlint warnings
Diffstat (limited to 'src')
-rw-r--r--src/Rahm/Desktop/History.hs2
-rw-r--r--src/Rahm/Desktop/Keys.hs16
-rw-r--r--src/Rahm/Desktop/Layout.hs4
-rw-r--r--src/Rahm/Desktop/Layout/ConsistentMosaic.hs4
-rw-r--r--src/Rahm/Desktop/Layout/Flip.hs2
-rw-r--r--src/Rahm/Desktop/Layout/Hole.hs4
-rw-r--r--src/Rahm/Desktop/Layout/List.hs4
-rw-r--r--src/Rahm/Desktop/Layout/Pop.hs4
-rw-r--r--src/Rahm/Desktop/Layout/Redescribe.hs2
-rw-r--r--src/Rahm/Desktop/Layout/ReinterpretMessage.hs2
-rw-r--r--src/Rahm/Desktop/Marking.hs4
-rw-r--r--src/Rahm/Desktop/Submap.hs4
-rw-r--r--src/Rahm/Desktop/Workspaces.hs6
-rw-r--r--src/Rahm/Desktop/XMobarLog.hs2
14 files changed, 31 insertions, 29 deletions
diff --git a/src/Rahm/Desktop/History.hs b/src/Rahm/Desktop/History.hs
index dfecc63..5e15fe6 100644
--- a/src/Rahm/Desktop/History.hs
+++ b/src/Rahm/Desktop/History.hs
@@ -79,7 +79,7 @@ lastWindow = getZipper . zipperBack . currentZipper <$> XS.get
jumpToLastLocation :: X ()
jumpToLastLocation = mapM_ focusLocation =<< lastWindow
-
+
historyHook :: Location -> Location -> X ()
historyHook (Location ws _) l@(Location ws' _) | ws /= ws' = do
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index ebc8b7f..3e660b5 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -292,7 +292,7 @@ keymap = runKeys $ do
(MaybeT . workspaceWithWindow) =<< MaybeT askWindowId)
(_, " ") -> Just $ accompaningWorkspace <$> getCurrentWorkspace
_ -> Nothing
-
+
justMod $
doc "Goto/Send/Etc To a workspace\n\n\t\
@@ -319,7 +319,7 @@ keymap = runKeys $ do
(_, Just w) -> gotoWorkspace =<< w
-- Test binding. Tests that I can still submap keysyms alone (keys
-- where XLookupString won't return anything helpful.)
- ((f, _), _) | f == xK_F1 ->
+ ((f, _), _) | f == xK_F1 ->
(safeSpawn "gxmessage" [
"-fn", "Source Code Pro",
documentation (keymap config)] :: X ())
@@ -456,7 +456,7 @@ keymap = runKeys $ do
bind xK_space $ do
justMod $ doc "Layout-related bindings" $ subkeys $ do
-
+
bind xK_n $
(noMod -|- justMod) $ doc "Use the next layout in the layout list." $
sendMessage toNextLayout
@@ -616,8 +616,10 @@ keymap = runKeys $ do
noMod $
doc "Move backward in location history" historyBack
- bind xK_bracketleft $ noMod navigateHistory
- bind xK_bracketright $ noMod navigateHistory
+ bind xK_bracketleft $ noMod $
+ doc "Move forward in location history" navigateHistory
+ bind xK_bracketright $ noMod $
+ doc "Move backward in location history" navigateHistory
-- Double-tap Z to toggle zoom.
bind xK_z $ do
@@ -756,7 +758,7 @@ mouseMap = runButtons $ do
]
forM_ (map fst swapButtons) $ \b ->
- bind b $ noMod $ \w -> click >> (continuous swapButtons b) w
+ bind b $ noMod $ \w -> click >> continuous swapButtons b w
bind button13 $ noMod $ subMouse $ do
bind button13 $ noMod $ subMouse $ do
@@ -770,7 +772,7 @@ mouseMap = runButtons $ do
bind button13 $
noMod $
noWindow $
- gotoWorkspace =<< (accompaningWorkspace <$> getCurrentWorkspace)
+ gotoWorkspace . accompaningWorkspace =<< getCurrentWorkspace
bind button15 $ do
noMod $ noWindow jumpToLastLocation
diff --git a/src/Rahm/Desktop/Layout.hs b/src/Rahm/Desktop/Layout.hs
index d8c3442..f6e714c 100644
--- a/src/Rahm/Desktop/Layout.hs
+++ b/src/Rahm/Desktop/Layout.hs
@@ -70,14 +70,14 @@ nLayouts = layoutListLength myLayoutList
-- "ForMosaic" is an instance of the Symbol kind. This is some neat type-system
-- hacking one can do in Haskell.
instance DoReinterpret "ForMosaic" where
-
+
-- IncMaster message
reinterpretMessage _ (fromMessage -> Just (IncMasterN n)) = do
Just . SomeMessage <$> (
if n > 0
then expandPositionAlt
else shrinkPositionAlt)
-
+
-- ResizeMaster message
reinterpretMessage _ (fromMessage -> Just m) = do
Just . SomeMessage <$>
diff --git a/src/Rahm/Desktop/Layout/ConsistentMosaic.hs b/src/Rahm/Desktop/Layout/ConsistentMosaic.hs
index db1ce4e..a84a2f1 100644
--- a/src/Rahm/Desktop/Layout/ConsistentMosaic.hs
+++ b/src/Rahm/Desktop/Layout/ConsistentMosaic.hs
@@ -37,7 +37,7 @@ shrinkPositionAlt = doAlt shrinkWindowAlt
instance (LayoutClass l a, Show a, Ord a, Enum a, Num a) => LayoutClass (MosaicWrap l) a where
-
+
runLayout (W.Workspace t (MosaicWrap l) (id -> Just s)) rect = do
let zs = zipStack [100..] s
s' = mapStack fst zs
@@ -59,7 +59,7 @@ instance (LayoutClass l a, Show a, Ord a, Enum a, Num a) => LayoutClass (MosaicW
runLayout (W.Workspace t (MosaicWrap l) a) rect = do
(rects, maybeNewLayout) <- runLayout (W.Workspace t l a) rect
return (rects, MosaicWrap <$> maybeNewLayout)
-
+
-- By default just pass the message to the underlying layout.
handleMessage (MosaicWrap l) mess = do
diff --git a/src/Rahm/Desktop/Layout/Flip.hs b/src/Rahm/Desktop/Layout/Flip.hs
index e0d3abc..fe425e9 100644
--- a/src/Rahm/Desktop/Layout/Flip.hs
+++ b/src/Rahm/Desktop/Layout/Flip.hs
@@ -69,7 +69,7 @@ instance LayoutModifier Flip a where
Rectangle ((sx + fromIntegral sw) - x - fromIntegral w + sx) y w h
flipHoriz (Rectangle x y w h) =
Rectangle x ((sy + fromIntegral sh) - y - fromIntegral h + sy) w h
-
+
-- Handle DoFlip messages.
pureMess flip (fromMessage -> Just (DoFlip f)) = Just (f flip)
pureMess _ _ = Nothing
diff --git a/src/Rahm/Desktop/Layout/Hole.hs b/src/Rahm/Desktop/Layout/Hole.hs
index ee59726..3f7c9b7 100644
--- a/src/Rahm/Desktop/Layout/Hole.hs
+++ b/src/Rahm/Desktop/Layout/Hole.hs
@@ -32,11 +32,11 @@ instance (LayoutClass l a, Eq a, Num a) => LayoutClass (Hole l) a where
app x w | not enabled = w
app x (W.Workspace t l s) =
case s of
- Nothing ->
+ Nothing ->
W.Workspace t l (Just $ W.Stack x [] [])
Just (W.Stack h c e) ->
W.Workspace t l (Just $ W.Stack h c (e ++ [x]))
-
+
handleMessage h (fromMessage -> Just (ManageHole f)) =
return $ Just $ f h
handleMessage (Hole e l) a = do
diff --git a/src/Rahm/Desktop/Layout/List.hs b/src/Rahm/Desktop/Layout/List.hs
index f533ea2..77b53c9 100644
--- a/src/Rahm/Desktop/Layout/List.hs
+++ b/src/Rahm/Desktop/Layout/List.hs
@@ -102,7 +102,7 @@ instance (Selector t) => Selector (Sel t) where
increment (Skip l) = Skip <$> increment l
-- If the current element is selected, the increment is just the initial of
-- the tail.
- increment Sel = Skip <$> initial
+ increment Sel = Skip <$> initial
-- For a selection, the initial is just this in the Sel state.
initial = Just Sel
@@ -178,7 +178,7 @@ layoutListLengthProxy _ = Proxy
(|:) :: (LayoutSelect t a, LayoutClass l a) => l a -> t a -> LCons l t a
(|:) = LCons
-infixr 5 |:
+infixr 5 |:
-- Constructs a LayoutList. This function enforces that the SelectorFor l
-- is a 'Sel' type. Essentially this enforces that there must be at least one
diff --git a/src/Rahm/Desktop/Layout/Pop.hs b/src/Rahm/Desktop/Layout/Pop.hs
index 7e3dbd1..e06ff25 100644
--- a/src/Rahm/Desktop/Layout/Pop.hs
+++ b/src/Rahm/Desktop/Layout/Pop.hs
@@ -37,7 +37,7 @@ data PopMessage where
deriving (Message)
resizePop :: Float -> PopMessage
-resizePop f = PopMessage $ \(Poppable b x y l) ->
+resizePop f = PopMessage $ \(Poppable b x y l) ->
Poppable b (g $ x + f) (g $ y + f) l
where
g = max 0 . min 0.45
@@ -52,7 +52,7 @@ poppable :: l a -> Poppable l a
poppable = Poppable False 0.05 0.05
instance (LayoutClass l a, Eq a) => LayoutClass (Poppable l) a where
-
+
-- If the current layout is not popped, then just return what the underlying
-- layout returned.
diff --git a/src/Rahm/Desktop/Layout/Redescribe.hs b/src/Rahm/Desktop/Layout/Redescribe.hs
index c5c7472..036bc88 100644
--- a/src/Rahm/Desktop/Layout/Redescribe.hs
+++ b/src/Rahm/Desktop/Layout/Redescribe.hs
@@ -11,7 +11,7 @@ import Data.Typeable (Typeable)
-- Type-class to modify the description of a layout.
class Describer m l where
-
+
-- Returns the new description from the given description modifier, the layout
-- and the existing description.
newDescription :: m -> l a -> String -> String
diff --git a/src/Rahm/Desktop/Layout/ReinterpretMessage.hs b/src/Rahm/Desktop/Layout/ReinterpretMessage.hs
index 8f6a78d..e3434b1 100644
--- a/src/Rahm/Desktop/Layout/ReinterpretMessage.hs
+++ b/src/Rahm/Desktop/Layout/ReinterpretMessage.hs
@@ -31,7 +31,7 @@ data ReinterpretMessage k a = ReinterpretMessage
-- Instance for ReinterpretMessage as a Layout modifier.
instance (DoReinterpret k) =>
- LayoutModifier (ReinterpretMessage k) a where
+ LayoutModifier (ReinterpretMessage k) a where
handleMessOrMaybeModifyIt self message = do
diff --git a/src/Rahm/Desktop/Marking.hs b/src/Rahm/Desktop/Marking.hs
index 639aae2..b1783cc 100644
--- a/src/Rahm/Desktop/Marking.hs
+++ b/src/Rahm/Desktop/Marking.hs
@@ -1,6 +1,6 @@
module Rahm.Desktop.Marking (
markCurrentWindow,
- jumpToMark,
+ jumpToMark,
swapWithMark, markToWindow
) where
@@ -43,7 +43,7 @@ withMaybeFocused f = withWindowSet $ f . peek
-- greedyFocus win = do
-- ws <- withWindowSet $ \ss ->
-- return $ getLocationWorkspace =<< findWindow ss win
---
+--
-- mapM_ (windows . greedyView . tag) ws
-- focus win
diff --git a/src/Rahm/Desktop/Submap.hs b/src/Rahm/Desktop/Submap.hs
index ad245ab..5db8928 100644
--- a/src/Rahm/Desktop/Submap.hs
+++ b/src/Rahm/Desktop/Submap.hs
@@ -76,12 +76,12 @@ mapNextStringWithKeysym fn = do
Nothing -> return Nothing
io $ ungrabKeyboard d currentTime
- case ret of
+ case ret of
Just (m, str, keysym) -> fn m keysym str
Nothing -> return ()
{- Like submap, but on the character typed rather than the kysym. -}
-mapNextString :: (KeyMask -> String -> X ()) -> X ()
+mapNextString :: (KeyMask -> String -> X ()) -> X ()
mapNextString fn = mapNextStringWithKeysym (\m _ s -> fn m s)
submapDefaultWithKey :: ((KeyMask, KeySym) -> X ()) -> Map (KeyMask, KeySym) (X ()) -> X ()
diff --git a/src/Rahm/Desktop/Workspaces.hs b/src/Rahm/Desktop/Workspaces.hs
index 1349fea..de481ac 100644
--- a/src/Rahm/Desktop/Workspaces.hs
+++ b/src/Rahm/Desktop/Workspaces.hs
@@ -114,7 +114,7 @@ swapWorkspace toWorkspace = do
| otherwise = ws
adjacentWorkspaceNotVisible :: Selector -> WorkspaceId -> X WorkspaceId
-adjacentWorkspaceNotVisible (Selector selector) from =
+adjacentWorkspaceNotVisible (Selector selector) from =
withWindowSet $ \ss ->
let tags = sort $
W.tag . snd <$> filter (\x -> fst x /= Visible) (
@@ -123,7 +123,7 @@ adjacentWorkspaceNotVisible (Selector selector) from =
return $ fromMaybe from $ selector (==from) tags
adjacentWorkspace :: Selector -> WorkspaceId -> X WorkspaceId
-adjacentWorkspace (Selector selector) from =
+adjacentWorkspace (Selector selector) from =
withWindowSet $ \ss ->
let tags = sort $ W.tag . snd <$> getPopulatedWorkspaces ss
in
@@ -154,4 +154,4 @@ workspaceWithWindow wid = withWindowSet $ \(W.StackSet c v h _) ->
W.tag <$>
find (\(W.Workspace _ _ stack) -> wid `elem` W.integrate' stack)
(map W.workspace (c : v) ++ h)
-
+
diff --git a/src/Rahm/Desktop/XMobarLog.hs b/src/Rahm/Desktop/XMobarLog.hs
index 4f8bbb8..f2cccf8 100644
--- a/src/Rahm/Desktop/XMobarLog.hs
+++ b/src/Rahm/Desktop/XMobarLog.hs
@@ -60,7 +60,7 @@ xMobarLogHook (XMobarLog xmproc) = do
tell $ "<fc=#404040>│ </fc><fc=#a0a0a0><fn=3>"
tell $ title
tell $ "</fn></fc>"
-
+
where
toAction [ch] | (ch >= 'A' && ch <= 'Z') ||
(ch >= 'a' && ch <= 'z') ||