75 lines
2.9 KiB
Haskell
75 lines
2.9 KiB
Haskell
import XMonad
|
|
import XMonad.Hooks.ManageDocks
|
|
import System.Exit
|
|
|
|
import qualified XMonad.StackSet as W
|
|
import qualified Data.Map as M
|
|
|
|
myTerminal = "urxvt"
|
|
myBorderWidth = 1
|
|
myModMask = mod1Mask
|
|
myNumlockMask = mod2Mask
|
|
myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
|
|
myNormalBorderColor = "#dddddd"
|
|
myFocusedBorderColor = "#ff0000"
|
|
|
|
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
|
|
[ ((modMask, xK_Return), spawn $ XMonad.terminal conf)
|
|
, ((modMask, xK_q ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
|
|
, ((modMask, xK_l ), spawn "slock")
|
|
, ((modMask .|. shiftMask, xK_c ), kill)
|
|
, ((modMask, xK_space ), sendMessage NextLayout)
|
|
, ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
|
|
, ((modMask, xK_r ), windows W.focusDown)
|
|
, ((modMask, xK_g ), windows W.focusUp )
|
|
, ((modMask, xK_m ), windows W.focusMaster )
|
|
, ((modMask .|. shiftMask, xK_r ), windows W.swapDown )
|
|
, ((modMask .|. shiftMask, xK_g ), windows W.swapUp )
|
|
, ((modMask, xK_n ), sendMessage Shrink)
|
|
, ((modMask, xK_t ), sendMessage Expand)
|
|
, ((modMask, xK_h ), withFocused $ windows . W.sink)
|
|
, ((modMask , xK_comma ), sendMessage (IncMasterN 1))
|
|
, ((modMask , xK_period), sendMessage (IncMasterN (-1)))
|
|
]
|
|
++
|
|
|
|
[((m .|. modMask, k), windows $ f i)
|
|
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
|
|
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
|
|
|
|
myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
|
|
[ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w))
|
|
, ((modMask, button2), (\w -> focus w >> windows W.swapMaster))
|
|
, ((modMask, button3), (\w -> focus w >> mouseResizeWindow w))
|
|
]
|
|
|
|
myManageHook = composeAll
|
|
[ className =? "MPlayer" --> doFloat
|
|
, className =? "Gimp" --> doFloat ]
|
|
|
|
myFocusFollowsMouse :: Bool
|
|
myFocusFollowsMouse = True
|
|
|
|
myLogHook = return ()
|
|
myStartupHook = return ()
|
|
|
|
main = xmonad defaults
|
|
|
|
defaults = defaultConfig {
|
|
manageHook = manageDocks <+> manageHook defaultConfig,
|
|
layoutHook = avoidStruts $ layoutHook defaultConfig,
|
|
terminal = myTerminal,
|
|
focusFollowsMouse = myFocusFollowsMouse,
|
|
borderWidth = myBorderWidth,
|
|
modMask = myModMask,
|
|
numlockMask = myNumlockMask,
|
|
workspaces = myWorkspaces,
|
|
normalBorderColor = myNormalBorderColor,
|
|
focusedBorderColor = myFocusedBorderColor,
|
|
|
|
keys = myKeys,
|
|
mouseBindings = myMouseBindings,
|
|
|
|
logHook = myLogHook,
|
|
startupHook = myStartupHook
|
|
}
|