Difference between revisions of "Xmonad/Config archive/brad's xmonad.hs"
< Xmonad | Config archive
Jump to navigation
Jump to search
(haskell tags) |
|||
(7 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | < |
+ | <haskell> |
import XMonad |
import XMonad |
||
import qualified XMonad.StackSet as W |
import qualified XMonad.StackSet as W |
||
+ | import qualified XMonad.Util.CustomKeys as C |
||
import qualified Data.Map as M |
import qualified Data.Map as M |
||
− | |||
− | -- hopefully it is obvious what changes i want to impose in xmonad: |
||
− | -- 1. no borders |
||
− | -- 2. urxvt is my terminal |
||
− | -- 3. mod+shift+w launches ff in worksapce 2 |
||
− | -- 4. mod+shift+u launches my shell |
||
− | -- 5. mod+shift+l locks the screen |
||
− | -- thats it! thanks to all the posters on xmonad.org whose configs i copied! |
||
main :: IO () |
main :: IO () |
||
Line 19: | Line 12: | ||
, normalBorderColor = "#000000" |
, normalBorderColor = "#000000" |
||
, focusedBorderColor = "#000000" |
, focusedBorderColor = "#000000" |
||
− | , keys = |
+ | , keys = C.customKeys delkeys inskeys |
, manageHook = manageHook defaultConfig <+> myManageHook |
, manageHook = manageHook defaultConfig <+> myManageHook |
||
} |
} |
||
⚫ | |||
− | |||
+ | delkeys :: XConfig l -> [(KeyMask, KeySym)] |
||
⚫ | |||
+ | delkeys XConfig {modMask = modm} = |
||
⚫ | |||
− | + | [ (modm, xK_b) ] |
|
⚫ | |||
− | ((modm .|. shiftMask, xK_u), spawn "urxvt -fg white -bg black -vb +sb -fn \"xft:Liberation Mono:pixelsize=20\""), |
||
+ | inskeys :: XConfig l -> [((KeyMask, KeySym), X ())] |
||
⚫ | |||
⚫ | |||
⚫ | |||
+ | let font = "Monospace" |
||
− | |||
+ | color = "-fg white -bg black" |
||
⚫ | |||
+ | urxvt = "urxvt -vb +sb" in |
||
⚫ | |||
+ | [ |
||
⚫ | |||
− | + | ((modm .|. shiftMask, xK_w), spawn "firefox"), |
|
+ | ((modm .|. shiftMask, xK_e), spawn |
||
− | </pre> |
||
+ | ("emacs --font \"" ++ font ++ "-14\" " ++ color)), |
||
+ | ((modm .|. shiftMask, xK_u), spawn |
||
+ | (urxvt ++ " " ++ color ++ " -fn \"xft:" ++ font ++ |
||
+ | ":pixelsize=20\"")), |
||
⚫ | |||
+ | ] |
||
⚫ | |||
⚫ | |||
⚫ | |||
+ | ] |
||
+ | </haskell> |
Latest revision as of 10:58, 20 December 2008
import XMonad
import qualified XMonad.StackSet as W
import qualified XMonad.Util.CustomKeys as C
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
, 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 .|. shiftMask, xK_w), spawn "firefox"),
((modm .|. shiftMask, xK_e), spawn
("emacs --font \"" ++ font ++ "-14\" " ++ color)),
((modm .|. shiftMask, xK_u), spawn
(urxvt ++ " " ++ color ++ " -fn \"xft:" ++ font ++
":pixelsize=20\"")),
((modm .|. shiftMask, xK_l), spawn "xlock -mode blank")
]
myManageHook :: ManageHook
myManageHook = composeAll [
className =? "Firefox-bin" --> doF(W.shift "web")
]