Created
May 29, 2010 11:06
-
-
Save bsag/418215 to your computer and use it in GitHub Desktop.
My xmonad.hs file, put together from some great examples on the XMonad wiki. Wish I could remember which and give credit!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- xmonad.hs -} | |
-- Imports -- | |
-- main | |
import XMonad | |
import IO (Handle, hPutStrLn) | |
-- utils | |
import qualified Data.Map as M | |
import XMonad.Util.Run (spawnPipe) | |
-- hooks | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.UrgencyHook | |
import XMonad.Hooks.FadeInactive | |
-- layouts | |
import XMonad.Layout.NoBorders | |
--------------------------------------------------------------------- | |
-- Variables -- | |
myNormalBGColor = "#000000" | |
myFocusedBGColor = "#414141" | |
myNormalFGColor = "#E0FFFF" | |
myFocusedFGColor = "#F8F893" | |
myUrgentFGColor = "#000000" | |
myUrgentBGColor = "#FF0000" | |
mySeperatorColor = "#8CD0D3" | |
myVisibleBGColor = "#515151" | |
-- Remember to change to appropiate path | |
xmonadDir = "/home/USERNAME/.xmonad" | |
--------------------------------------------------------------------- | |
-- Main -- | |
main = do | |
bar <- spawnPipe myWorkspaceBar | |
bar2 <- spawnPipe myDateBar | |
spawn "xcompmgr" | |
xmonad $ withUrgencyHook NoUrgencyHook defaultConfig | |
{ manageHook = manageDocks <+> manageHook defaultConfig | |
, layoutHook = myLayoutHook | |
, logHook = myLogHook bar | |
, workspaces = myWorkspaces | |
, modMask = myModMask | |
, keys = myKeys | |
, terminal = myTerminal | |
, borderWidth = myBorderWidth | |
, normalBorderColor = myNormalBorderColor | |
, focusedBorderColor = myFocusedBorderColor | |
} | |
--------------------------------------------------------------------- | |
-- Terminal -- | |
myTerminal = "urxvt" | |
-- Workspaces -- | |
myWorkspaces = ["1:term", "2:web", "3:mail", "4:doc", "5:file", "6", "7", "8", "9"] | |
-- ModMask -- | |
myModMask = mod4Mask | |
--------------------------------------------------------------------- | |
-- Looks -- | |
-- borders | |
myBorderWidth = 1 | |
myNormalBorderColor = "grey30" | |
myFocusedBorderColor = "#CCDC90" | |
-- keys | |
-- Union default and new key bindings | |
myKeys x = M.union (M.fromList (newKeys x)) (keys defaultConfig x) | |
-- Add new and/or redefine key bindings | |
newKeys conf@(XConfig {XMonad.modMask = modm}) = [ | |
-- Do not leave useless conky, dzen and xxkb after restart | |
((modm, xK_q), spawn "killall conky dzen2 xxkb; xmonad --recompile; xmonad --restart"), | |
-- Make a screeshot | |
((0, xK_Print), spawn "scrot -e 'mv $f ~/Dropbox/ArchieDocs/shots/'"), | |
((controlMask, xK_Print), spawn "sleep 0.2; scrot -s -e 'mv $f ~/Dropbox/ArchieDocs/shots/'"), -- interactive | |
((modm, xK_b ), sendMessage ToggleStruts ), -- toggle the status bars | |
((modm, xK_u ), focusUrgent), -- go to the most recent urgent window | |
((modm, xK_BackSpace), clearUrgents) -- get rid of urgent notification | |
] | |
-- layoutHooks | |
myLayoutHook = smartBorders $ avoidStruts (tiled ||| Mirror tiled ||| noBorders Full) | |
where | |
tiled = Tall 1 (3/100) (1/2) | |
--------------------------------------------------------------------- | |
-- DZEN bars -- | |
myWorkspaceBar = "dzen2 -p -x '0' -y '0' -h '16' -w '1024' -ta 'l' -bg black -fn 'xft:inconsolata:size=9:antialias=true:hinting=true:hintstyle=hintfull'" | |
myDateBar = "conky -c /home/USERNAME/.xmonad/conkyrc_console | dzen2 -x '0' -y '752' -h '16' -w '1024' -ta 'c' -bg black -fn 'xft:inconsolata:size=9:antialias=true:hinting=true:hintstyle=hintfull'" | |
--------------------------------------------------------------------- | |
-- DZEN looks -- | |
myLogHook :: Handle -> X () | |
myLogHook h = dynamicLogWithPP $ defaultPP | |
{ ppCurrent = dzenColor myFocusedFGColor myFocusedBGColor . pad | |
, ppUrgent = dzenColor myUrgentFGColor myUrgentBGColor . pad | |
, ppVisible = dzenColor myNormalFGColor myNormalBGColor . pad | |
, ppHiddenNoWindows = dzenColor myNormalFGColor myNormalBGColor . pad | |
, ppHidden = dzenColor myNormalFGColor myVisibleBGColor . pad | |
, ppSep = " | " | |
, ppTitle = dzenColor myNormalFGColor "" . wrap "< " " >" | |
, ppLayout = dzenColor mySeperatorColor myNormalBGColor . pad | |
, ppOutput = hPutStrLn h | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment