[MINOR] changed xmonad config to neorg file

This commit is contained in:
Afonso Franco 2023-03-07 21:48:12 +00:00
parent 6a0755f0c7
commit bb3b544724
Signed by: afonso
GPG key ID: C459E0BB3DCEE899

View file

@ -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 #-} {-# OPTIONS_GHC -Wno-deprecations #-}
@end
* Imports
@code haskell
import XMonad import XMonad
@ -42,6 +54,10 @@ import System.Exit
--Color Scheme --Color Scheme
import Colors.Teal import Colors.Teal
@end
* Variables
@code haskell
myTerminal = "alacritty" myTerminal = "alacritty"
myTextEditor = "nvim" myTextEditor = "nvim"
myWebBrowser = "firefox" myWebBrowser = "firefox"
@ -64,6 +80,9 @@ myBorderWidth = 2
myWorkspaces = ["main","web","text","code","social","mail"] myWorkspaces = ["main","web","text","code","social","mail"]
myWorkspaceIndices = zip myWorkspaces [1..] myWorkspaceIndices = zip myWorkspaces [1..]
@end
* ScratchPads
@code haskell
myScratchPads :: [NamedScratchpad] myScratchPads :: [NamedScratchpad]
myScratchPads = [NS "terminal" spawnTerm findTerm manageTerm] myScratchPads = [NS "terminal" spawnTerm findTerm manageTerm]
where where
@ -76,7 +95,9 @@ myScratchPads = [NS "terminal" spawnTerm findTerm manageTerm]
t = 0.7 -h t = 0.7 -h
l = 0.8 -w l = 0.8 -w
@end
* Keybinds
@code haskell
myKeys :: [(String, X ())] myKeys :: [(String, X ())]
myKeys = myKeys =
[ ("M-x" ,spawn myTerminal ) [ ("M-x" ,spawn myTerminal )
@ -121,14 +142,18 @@ myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
, ((modm, button2), (\w -> focus w >> windows W.shiftMaster)) , ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
, ((modm, button3), (\w -> focus w >> mouseResizeWindow w , ((modm, button3), (\w -> focus w >> mouseResizeWindow w
>> windows W.shiftMaster))] >> windows W.shiftMaster))]
@end
* Layouts
@code haskell
myLayout = avoidStruts(tiled ||| Mirror tiled ||| Full) myLayout = avoidStruts(tiled ||| Mirror tiled ||| Full)
where where
tiled = Tall nmaster delta ratio tiled = Tall nmaster delta ratio
nmaster = 1 nmaster = 1
ratio = 1/2 ratio = 1/2
delta = 3/100 delta = 3/100
@end
* Hooks
@code haskell
myManageHook = composeAll myManageHook = composeAll
[ className =? "MPlayer" --> doFloat [ className =? "MPlayer" --> doFloat
, className =? "Gimp" --> doFloat , className =? "Gimp" --> doFloat
@ -147,6 +172,7 @@ myManageHook = composeAll
, title =? "scratchpad" --> doFloat , title =? "scratchpad" --> doFloat
, isFullscreen --> doFullFloat] , isFullscreen --> doFullFloat]
myEventHook = ewmhDesktopsEventHook myEventHook = ewmhDesktopsEventHook
myStartupHook = do 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 &") 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 "web" myWebBrowser
spawnOn "main" myTerminal spawnOn "main" myTerminal
@end
* XMobar Config
@code haskell
myStatusBarSpawner :: Applicative f => ScreenId -> f StatusBarConfig myStatusBarSpawner :: Applicative f => ScreenId -> f StatusBarConfig
myStatusBarSpawner (S s) = do myStatusBarSpawner (S s) = do
@ -195,7 +224,9 @@ myXmobarPP s = def
layoutColorIsActive n l = do layoutColorIsActive n l = do
c <- withWindowSet $ return . W.screen . W.current c <- withWindowSet $ return . W.screen . W.current
if n == c then wrapL "<icon=/home/afonso/.config/xmobar/xpm/" "_selected.xpm/>" l else wrapL "<icon=/home/afonso/.config/xmobar/xpm/" ".xpm/>" l if n == c then wrapL "<icon=/home/afonso/.config/xmobar/xpm/" "_selected.xpm/>" l else wrapL "<icon=/home/afonso/.config/xmobar/xpm/" ".xpm/>" l
@end
* Config Variables binding
@code haskell
myConfig = def myConfig = def
{ {
@ -213,6 +244,10 @@ myConfig = def
handleEventHook = myEventHook <+> fullscreenEventHook <+> swallowEventHook (className=?"Alacritty") (return True), handleEventHook = myEventHook <+> fullscreenEventHook <+> swallowEventHook (className=?"Alacritty") (return True),
startupHook = myStartupHook startupHook = myStartupHook
} }
@end
* Main
@code haskell
main :: IO () main :: IO ()
main = xmonad . ewmh . ewmhFullscreen . dynamicSBs myStatusBarSpawner . docks $ additionalKeysP (removeKeysP myConfig myRemoveKeys) myKeys main = xmonad . ewmh . ewmhFullscreen . dynamicSBs myStatusBarSpawner . docks $ additionalKeysP (removeKeysP myConfig myRemoveKeys) myKeys
@end