xmonad: Setup a basic xmonad config
This commit is contained in:
parent
71dbb652b8
commit
3a367e9f4f
4 changed files with 124 additions and 14 deletions
|
|
@ -1,6 +1,10 @@
|
|||
import XMonad
|
||||
import XMonad.Util.Ungrab (unGrab)
|
||||
import XMonad.Util.EZConfig (additionalKeys, additionalKeysP)
|
||||
import XMonad.Layout.ThreeColumns
|
||||
import XMonad.Layout.Magnifier (magnifiercz')
|
||||
import XMonad.Hooks.EwmhDesktops
|
||||
import qualified XMonad.Hooks.ManageDocks as Docks
|
||||
import qualified XMonad.Util.EZConfig as EZ
|
||||
import Control.Monad (when)
|
||||
import Text.Printf (printf)
|
||||
import System.Posix.Process (executeFile)
|
||||
|
|
@ -20,21 +24,28 @@ compileRestart resume = do
|
|||
executeFile (cacheDir dirs </> compiledConfig) False args Nothing
|
||||
)
|
||||
|
||||
myLayout = Docks.avoidStruts (tiled ||| Mirror tiled ||| Full ||| columns)
|
||||
where
|
||||
tiled = Tall nmaster delta ratio
|
||||
columns = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio
|
||||
nmaster = 1 -- default number of windows in the master pane
|
||||
ratio = 1/2 -- default proportion occupied by master pane
|
||||
delta = 3/100 -- percent of screen to increment when resizing
|
||||
|
||||
main :: IO ()
|
||||
main = getDirectories >>= launch myConfig
|
||||
|
||||
myConfig = defaultConfig
|
||||
myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def
|
||||
{ modMask = mod4Mask -- Use Super instead of Alt
|
||||
, terminal = "alacritty"
|
||||
, layoutHook = myLayout
|
||||
}
|
||||
`additionalKeys`
|
||||
[ ( (mod4Mask,xK_r), compileRestart True)
|
||||
, ( (mod4Mask,xK_q), restart "xmonad" True )
|
||||
]
|
||||
`additionalKeysP`
|
||||
`EZ.additionalKeysP`
|
||||
[ ("M-S-z", spawn "xscreensaver-command -lock")
|
||||
, ("M-C-s", unGrab *> spawn "scrot -s" )
|
||||
, ("M-f" , spawn "firefox" )
|
||||
, ("M-S-r", compileRestart True)
|
||||
, ("M-S-q", restart "xmonad" True)
|
||||
, ("M-C-s", unGrab *> spawn "scrot -s")
|
||||
, ("M-b", sendMessage Docks.ToggleStruts)
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
config = ./config.hs;
|
||||
extraPackages = hp: [ hp.dbus hp.monad-logger hp.xmonad-contrib ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue