Skip to content

Instantly share code, notes, and snippets.

@bradclawsie
Created December 5, 2010 04:07
Show Gist options
  • Save bradclawsie/728767 to your computer and use it in GitHub Desktop.
Save bradclawsie/728767 to your computer and use it in GitHub Desktop.
xmonad.hs
import XMonad
import qualified XMonad.StackSet as SS
import qualified XMonad.Layout as L
import qualified XMonad.Util.CustomKeys as C
import qualified XMonad.Actions.Warp as W
import qualified Data.Map as M
main :: IO ()
main = xmonad $ defaultConfig
{ borderWidth = 0
, terminal = "urxvt -bg black -fg white -vb +sb"
, workspaces = ["shell", "web"] ++ map show [3..9]
, normalBorderColor = "#000000"
, focusedBorderColor = "#000000"
, keys = C.customKeys delkeys inskeys
, layoutHook = myLayout
, manageHook = manageHook defaultConfig <+> myManageHook
}
where
delkeys :: XConfig l -> [(KeyMask, KeySym)]
delkeys XConfig {modMask = modm} =
[ (modm, xK_b) ]
inskeys :: XConfig l -> [((KeyMask, KeySym), X ())]
inskeys conf@(XConfig {modMask = modm}) =
let font = "Monospace"
color = "-fg white -bg black"
urxvt = "urxvt -vb +sb" in
[
((modm, xK_w), spawn "firefox"),
((modm, xK_e), spawn
("emacs --font \"" ++ font ++ "-19\" " ++ color)),
((modm, xK_u), spawn
(urxvt ++ " " ++ color ++ " -fn \"xft:" ++ font ++
":pixelsize=25\"")),
((modm .|. shiftMask, xK_l), spawn "slock"),
((modm .|. shiftMask, xK_z), W.banish W.LowerRight)
]
myManageHook :: ManageHook
myManageHook = composeAll [
className =? w --> doF (SS.shift "web") |
w <- ["Firefox-bin",
"Firefox",
"Minefield"]
]
myLayout :: Choose (Mirror Tall) (Choose Tall Full) a
myLayout = Mirror (Tall 1 (3/100) (1/2)) |||
Tall 1 (3/100) (1/2) |||
Full
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment