From ee9be16599f20aef6d1d3fd15666c00452f85aba Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 21 Nov 2022 12:05:03 -0700 Subject: Format with ormolu. --- src/Main.hs | 162 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 85 insertions(+), 77 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index a98e568..766716c 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1,33 +1,30 @@ -import XMonad - -import XMonad.Hooks.DynamicProperty -import Control.Monad.Trans.Class import Control.Monad.Reader -import XMonad.Hooks.ManageDocks (docks) -import System.Directory (getHomeDirectory) -import System.FilePath (()) -import XMonad.Hooks.EwmhDesktops (ewmh) -import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat) -import XMonad.Layout.Fullscreen (fullscreenEventHook) -import System.Environment (setEnv) -import Data.Monoid +import Control.Monad.Trans.Class import qualified Data.Map as Map -import Text.Printf - -import Rahm.Desktop.Swallow -import Rahm.Desktop.Marking +import Data.Monoid import Rahm.Desktop.Common -import Rahm.Desktop.XMobarLog +import Rahm.Desktop.DMenu (menuCommandString) +import Rahm.Desktop.History +import Rahm.Desktop.Hooks.WindowChange import Rahm.Desktop.Keys import Rahm.Desktop.Layout import Rahm.Desktop.Logger -import Rahm.Desktop.DMenu (menuCommandString) +import Rahm.Desktop.Marking import Rahm.Desktop.RebindKeys -import Rahm.Desktop.Hooks.WindowChange -import Rahm.Desktop.History - -import qualified XMonad as X import qualified Rahm.Desktop.StackSet as W +import Rahm.Desktop.Swallow +import Rahm.Desktop.XMobarLog +import System.Directory (getHomeDirectory) +import System.Environment (setEnv) +import System.FilePath (()) +import Text.Printf +import XMonad +import qualified XMonad as X +import XMonad.Hooks.DynamicProperty +import XMonad.Hooks.EwmhDesktops (ewmh) +import XMonad.Hooks.ManageDocks (docks) +import XMonad.Hooks.ManageHelpers (doFullFloat, isFullscreen) +import XMonad.Layout.Fullscreen (fullscreenEventHook) main = do putStrLn "Welcome To RDE!" @@ -41,49 +38,56 @@ main = do xmobar <- spawnXMobar - (=<<) X.xmonad $ - applyKeys $ withLocationChangeHook historyHook $ ewmh $ docks $ def - { terminal = "alacritty" - , modMask = mod3Mask - , borderWidth = 2 - , keys = const mempty - , focusedBorderColor = "#ff6c00" - , normalBorderColor = "#404040" - , layoutHook = myLayout - , startupHook = spawn fp - , manageHook = composeAll [ - isFullscreen --> doFullFloat - , doLogWindow - , className =? "Tilda" --> doFloat - , className =? "yakuake" --> doFloat - , className =? "MPlayer" --> doFloat - , title =? "Event Tester" --> doFloat - , title =? "Floating Term" --> doCenterFloat - , title =? "Notes" --> doCenterFloat - , title =? "xmessage" --> doCenterFloat - , title =? "gxmessage" --> doCenterFloat - , title =? "Volume Control" --> doCenterFloat - , className =? "mpv" --> doFloat - , className =? "gnubby_ssh_prompt" --> doFloat - ] - -- This config uses dynamic workspaces, but I have to seed XMonad - -- with something. However, this configuration only supports 36 - -- monitors on boot. If you need more than 36 monitors, you'll have to - -- configure those ones after starting XMonad. - , workspaces = map return (['0'..'9'] ++ ['a'..'z']) - , handleEventHook = - composeAll [ - fullscreenEventHook, - remapHook, - swallowHook, - dynamicTitle (composeAll [ - title =? "Spotify" --> doMarkWindow "s" - ])] - , focusFollowsMouse = False - , clickJustFocuses = False - , logHook = xMobarLogHook xmobar - } - + (=<<) X.xmonad $ + applyKeys $ + withLocationChangeHook historyHook $ + ewmh $ + docks $ + def + { terminal = "alacritty", + modMask = mod3Mask, + borderWidth = 2, + keys = const mempty, + focusedBorderColor = "#ff6c00", + normalBorderColor = "#404040", + layoutHook = myLayout, + startupHook = spawn fp, + manageHook = + composeAll + [ isFullscreen --> doFullFloat, + doLogWindow, + className =? "Tilda" --> doFloat, + className =? "yakuake" --> doFloat, + className =? "MPlayer" --> doFloat, + title =? "Event Tester" --> doFloat, + title =? "Floating Term" --> doCenterFloat, + title =? "Notes" --> doCenterFloat, + title =? "xmessage" --> doCenterFloat, + title =? "gxmessage" --> doCenterFloat, + title =? "Volume Control" --> doCenterFloat, + className =? "mpv" --> doFloat, + className =? "gnubby_ssh_prompt" --> doFloat + ], + -- This config uses dynamic workspaces, but I have to seed XMonad + -- with something. However, this configuration only supports 36 + -- monitors on boot. If you need more than 36 monitors, you'll have to + -- configure those ones after starting XMonad. + workspaces = map return (['0' .. '9'] ++ ['a' .. 'z']), + handleEventHook = + composeAll + [ fullscreenEventHook, + remapHook, + swallowHook, + dynamicTitle + ( composeAll + [ title =? "Spotify" --> doMarkWindow "s" + ] + ) + ], + focusFollowsMouse = False, + clickJustFocuses = False, + logHook = xMobarLogHook xmobar + } changeHook :: Location -> Location -> X () changeHook l1 l2 = @@ -98,9 +102,16 @@ doLogWindow = do return (Endo id) doMarkWindow :: Mark -> ManageHook -doMarkWindow m = ask >>= (\w -> liftX (do - ws <- getCurrentWorkspace - markAllLocations m [Location ws (Just w)]) >> return (Endo id)) +doMarkWindow m = + ask + >>= ( \w -> + liftX + ( do + ws <- getCurrentWorkspace + markAllLocations m [Location ws (Just w)] + ) + >> return (Endo id) + ) doCenterFloat :: ManageHook doCenterFloat = @@ -109,14 +120,11 @@ doCenterFloat = centerRect :: W.RationalRect -> W.RationalRect centerRect (W.RationalRect x y w h) = W.RationalRect ((1 - w) / 2) ((1 - h) / 2) w h - windowHooks :: WindowHook -> XConfig l -> XConfig l windowHooks (Query readerT) config = do - - config { - startupHook = do - withWindowSet $ mapM_ (runReaderT readerT) . W.allWindows - startupHook config, - - manageHook = mappend (Query readerT >> return (Endo id)) (manageHook config) - } + config + { startupHook = do + withWindowSet $ mapM_ (runReaderT readerT) . W.allWindows + startupHook config, + manageHook = mappend (Query readerT >> return (Endo id)) (manageHook config) + } -- cgit