diff --git a/.config/xmonad/xmonad.hs b/.config/xmonad/xmonad.norg
similarity index 94%
rename from .config/xmonad/xmonad.hs
rename to .config/xmonad/xmonad.norg
index c8d436d..845b874 100644
--- a/.config/xmonad/xmonad.hs
+++ b/.config/xmonad/xmonad.norg
@@ -1,4 +1,16 @@
+@document.meta
+title: Xmonad Config
+authors: Afonso Franco
+categories: configs
+tangle: ./xmonad.hs
+@end
+
+* Overrides
+@code haskell
{-# OPTIONS_GHC -Wno-deprecations #-}
+@end
+* Imports
+@code haskell
import XMonad
@@ -42,6 +54,10 @@ import System.Exit
--Color Scheme
import Colors.Teal
+@end
+* Variables
+@code haskell
+
myTerminal = "alacritty"
myTextEditor = "nvim"
myWebBrowser = "firefox"
@@ -64,6 +80,9 @@ myBorderWidth = 2
myWorkspaces = ["main","web","text","code","social","mail"]
myWorkspaceIndices = zip myWorkspaces [1..]
+ @end
+* ScratchPads
+@code haskell
myScratchPads :: [NamedScratchpad]
myScratchPads = [NS "terminal" spawnTerm findTerm manageTerm]
where
@@ -76,7 +95,9 @@ myScratchPads = [NS "terminal" spawnTerm findTerm manageTerm]
t = 0.7 -h
l = 0.8 -w
-
+ @end
+* Keybinds
+@code haskell
myKeys :: [(String, X ())]
myKeys =
[ ("M-x" ,spawn myTerminal )
@@ -121,14 +142,18 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
, ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
, ((modm, button3), (\w -> focus w >> mouseResizeWindow w
>> windows W.shiftMaster))]
-
+ @end
+* Layouts
+@code haskell
myLayout = avoidStruts(tiled ||| Mirror tiled ||| Full)
where
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 1/2
delta = 3/100
-
+@end
+* Hooks
+@code haskell
myManageHook = composeAll
[ className =? "MPlayer" --> doFloat
, className =? "Gimp" --> doFloat
@@ -147,6 +172,7 @@ myManageHook = composeAll
, title =? "scratchpad" --> doFloat
, isFullscreen --> doFullFloat]
+
myEventHook = ewmhDesktopsEventHook
myStartupHook = do
@@ -162,6 +188,9 @@ myStartupHook = do
spawn ("killall trayer ;sleep 1 && trayer --monitor 0 --edge top --align right --widthtype request --padding 7 --iconspacing 12 --SetDockType true --SetPartialStrut true --expand true --transparent true --alpha 0 --tint 0x2B2E37 --height 26 --distance 5 &")
spawnOn "web" myWebBrowser
spawnOn "main" myTerminal
+@end
+* XMobar Config
+@code haskell
myStatusBarSpawner :: Applicative f => ScreenId -> f StatusBarConfig
myStatusBarSpawner (S s) = do
@@ -195,7 +224,9 @@ myXmobarPP s = def
layoutColorIsActive n l = do
c <- withWindowSet $ return . W.screen . W.current
if n == c then wrapL "" l else wrapL "" l
-
+ @end
+* Config Variables binding
+@code haskell
myConfig = def
{
@@ -213,6 +244,10 @@ myConfig = def
handleEventHook = myEventHook <+> fullscreenEventHook <+> swallowEventHook (className=?"Alacritty") (return True),
startupHook = myStartupHook
}
+@end
+* Main
+@code haskell
main :: IO ()
main = xmonad . ewmh . ewmhFullscreen . dynamicSBs myStatusBarSpawner . docks $ additionalKeysP (removeKeysP myConfig myRemoveKeys) myKeys
+@end