aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-04-22 18:03:27 -0600
committerJosh Rahm <rahm@google.com>2022-04-22 18:03:27 -0600
commit32a394483e5d8f571b27a70f9a7156cae1ed6180 (patch)
treef2fab1c1edeb5d7de92e7de1ab5f5b85b91fe057 /src
parent7dfbd2e4bc893f7527f9cc4ebf9c474ddfb0dc65 (diff)
downloadrde-32a394483e5d8f571b27a70f9a7156cae1ed6180.tar.gz
rde-32a394483e5d8f571b27a70f9a7156cae1ed6180.tar.bz2
rde-32a394483e5d8f571b27a70f9a7156cae1ed6180.zip
Run hlint
Diffstat (limited to 'src')
-rw-r--r--src/Rahm/Desktop/Common.hs2
-rw-r--r--src/Rahm/Desktop/Keys.hs10
-rw-r--r--src/Rahm/Desktop/Keys/Dsl.hs6
-rw-r--r--src/Rahm/Desktop/Layout/Draw.hs4
-rw-r--r--src/Rahm/Desktop/Marking.hs7
-rw-r--r--src/Rahm/Desktop/XMobarLog.hs15
6 files changed, 22 insertions, 22 deletions
diff --git a/src/Rahm/Desktop/Common.hs b/src/Rahm/Desktop/Common.hs
index 9187edf..6d86c0e 100644
--- a/src/Rahm/Desktop/Common.hs
+++ b/src/Rahm/Desktop/Common.hs
@@ -75,7 +75,7 @@ askWindowId = do
runDMenuPromptWithMap "Window" (Just "#f542f5") windowTitlesToWinId
windowJump :: X ()
-windowJump = (mapM_ (focus . head)) =<< askWindowId
+windowJump = mapM_ (focus . head) =<< askWindowId
-- Temporarily set the border color of the given windows.
withBorderColor :: String -> [Window] -> X a -> X a
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs
index d0305b3..728db52 100644
--- a/src/Rahm/Desktop/Keys.hs
+++ b/src/Rahm/Desktop/Keys.hs
@@ -187,7 +187,7 @@ keymap = runKeys $ do
bind xK_F7 $
justMod $
- doc "Print this documentation." $
+ doc "Print this documentation."
(logs Info "%s" (documentation (keymap config)) :: X ())
bind xK_F10 $ do
@@ -223,7 +223,7 @@ keymap = runKeys $ do
doc ("Move the current window to screne " ++ show idx) $
withScreen W.shift idx
- altgrMod $
+ altgrMod
(logs Info "Test altgr" :: X ())
bind xK_bracketright $ do
@@ -519,7 +519,7 @@ keymap = runKeys $ do
doc "Go to the prior window in the history" historyBack
bind xK_t $ do
- (justMod -|- noMod) $ (logs Info "Test Log" :: X ())
+ (justMod -|- noMod) (logs Info "Test Log" :: X ())
-- bind xK_n $ do
-- (justMod -|- noMod) $
@@ -612,7 +612,7 @@ keymap = runKeys $ do
["-t", "2000", printf "LogLevel set to %s" (show next)]
setLogLevel next
logs next "LogLevel set to %s." (show next)
-
+
bind xF86XK_Calculator $ do
noMod $ spawnX $ terminal config ++ " -t Floating\\ Term -e /usr/bin/env python3"
@@ -859,7 +859,7 @@ windowSpecificBindings config = do
bind xK_F2 $
-- Experimental.
- noMod $ (logs Info "This is a test" :: X ())
+ noMod (logs Info "This is a test" :: X ())
-- Add a binding to xev as a test.
configureIf (title =? "Event Tester") $
diff --git a/src/Rahm/Desktop/Keys/Dsl.hs b/src/Rahm/Desktop/Keys/Dsl.hs
index 2c596fc..55912f8 100644
--- a/src/Rahm/Desktop/Keys/Dsl.hs
+++ b/src/Rahm/Desktop/Keys/Dsl.hs
@@ -455,7 +455,7 @@ documentation = execWriter . document' ""
where
document' pref keybindings =
forM_ (sortOn (map (\(a, b) -> (b, a)) . snd . snd) $ Map.toList (keyBindingsToList keybindings)) $ \(doc, (thing, keys)) -> do
- when ((not $ null doc) || hasSubmap thing) $
+ when (not (null doc) || hasSubmap thing) $
tell $ printf "%s%s: %s\n" pref (intercalate " or " $ map prettyShow keys) doc
case thing of
Action _ -> return ()
@@ -467,7 +467,7 @@ documentation = execWriter . document' ""
keyBindingsToList :: KeyBindings -> Map String (KeyBinding, [(KeyMask, KeySym)])
keyBindingsToList b =
- fmap (\list -> ((\(_, Documented _ t) -> t) (head list), map fst list)) $
+ (\list -> ((\(_, Documented _ t) -> t) (head list), map fst list)) <$>
group (\(_, Documented doc _) -> doc) (sortOn (snd . fst) $ Map.toList b)
prettyShow :: (KeyMask, KeySym) -> String
@@ -490,7 +490,7 @@ documentation = execWriter . document' ""
concatMap ((++"-") . snd) $ filter ((/=0) . (.&.mask) . fst) masks
- group :: (Ord b) => (a -> b) -> [a] -> (Map b [a])
+ group :: (Ord b) => (a -> b) -> [a] -> Map b [a]
group fn = Map.fromListWith (++) . map (first fn . (\a -> (a, [a])))
diff --git a/src/Rahm/Desktop/Layout/Draw.hs b/src/Rahm/Desktop/Layout/Draw.hs
index 8380e98..165af75 100644
--- a/src/Rahm/Desktop/Layout/Draw.hs
+++ b/src/Rahm/Desktop/Layout/Draw.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses,
-ScopedTypeVariables, BangPatterns #-}
+{-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, ScopedTypeVariables #-}
+
module Rahm.Desktop.Layout.Draw (drawLayout) where
import Control.Monad
diff --git a/src/Rahm/Desktop/Marking.hs b/src/Rahm/Desktop/Marking.hs
index 1ea9782..3b4873d 100644
--- a/src/Rahm/Desktop/Marking.hs
+++ b/src/Rahm/Desktop/Marking.hs
@@ -14,7 +14,7 @@ module Rahm.Desktop.Marking (
import Prelude hiding (head)
-import Data.Maybe (fromMaybe)
+import Data.Maybe ( fromMaybe, catMaybes )
import Control.Monad.Trans (lift)
import Data.Ord (Down(..))
import Control.Exception
@@ -25,7 +25,6 @@ import Data.IORef
import Data.List (sortOn, sort, sortBy, find)
import Data.List.Safe (head)
import Data.Map (Map)
-import Data.Maybe (catMaybes)
import Data.Sequence (Seq(..))
import Rahm.Desktop.Common
import Rahm.Desktop.History
@@ -76,7 +75,7 @@ getAlternateWorkspace window =
Map.lookup window . alternateWorkspaces <$> XS.get
setAlternateWindows :: [Window] -> X ()
-setAlternateWindows wins = XS.modify (\m -> m { alternateWindows = wins })
+setAlternateWindows wins = XS.modify (\m -> m { alternateWindows = wins })
getAlternateWindows :: X [Window]
getAlternateWindows = alternateWindows <$> XS.get
@@ -94,7 +93,7 @@ markAllLocations mark locs =
markCurrentWindow :: Mark -> X ()
markCurrentWindow mark = do
ws <- getCurrentWorkspace
-
+
withFocused $ \win ->
XS.modify $ \state@MarkState {markStateMap = ms} ->
state {
diff --git a/src/Rahm/Desktop/XMobarLog.hs b/src/Rahm/Desktop/XMobarLog.hs
index 6ec4ac7..629e021 100644
--- a/src/Rahm/Desktop/XMobarLog.hs
+++ b/src/Rahm/Desktop/XMobarLog.hs
@@ -6,6 +6,7 @@ import Control.Monad.Writer (tell, execWriter)
import Data.List (sortBy)
import Data.Maybe (mapMaybe)
import Data.Ord (comparing)
+import Data.Char (isAsciiLower, isAsciiUpper, isDigit)
import Rahm.Desktop.Layout.Draw (drawLayout)
import System.IO (Handle, hSetEncoding, hPutStrLn, utf8)
import XMonad.Util.NamedWindows (getName)
@@ -48,7 +49,7 @@ xMobarLogHook (XMobarLog xmproc) = do
let log = trunc 80 $ execWriter $ do
tell " "
tell layoutXpm
- tell $ " "
+ tell " "
tell $ logLevelToXMobar loglevel
forM_ wss $ \(t, ws) -> do
@@ -60,17 +61,17 @@ xMobarLogHook (XMobarLog xmproc) = do
tell $ toAction $ S.tag ws
tell " </fc></fn>"
- tell $ " <fc=#ff8888><fn=3>"
- tell $ title
- tell $ "</fn></fc>"
+ tell " <fc=#ff8888><fn=3>"
+ tell title
+ tell "</fn></fc>"
logs Trace "XMobar: %s" log
X.io $ hPutStrLn xmproc log
where
- toAction [ch] | (ch >= 'A' && ch <= 'Z') ||
- (ch >= 'a' && ch <= 'z') ||
- (ch >= '0' && ch <= '9') =
+ toAction [ch] | (isAsciiUpper ch) ||
+ (isAsciiLower ch) ||
+ (isDigit ch) =
printf "<action=`xdotool key 'Hyper_L+g' '%s'` button=1><action=`xdotool key 'Hyper_L+Shift_L+g' '%s'` button=3>%s</action></action>" [ch] [ch] [ch]
toAction ch = ch