import qualified XMonad.StackSet as W import System.IO (hPutStrLn) import XMonad import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import XMonad.Layout.ResizableTile import XMonad.Util.EZConfig (additionalKeys, additionalKeysP) import XMonad.Util.Loggers (logCmd) import XMonad.Util.Run (spawnPipe) main = do statBarPipe <- spawnPipe myStateBar xmonad $ defaultConfig -- xmonad $ gnomeConfig { -- hooks layoutHook = myLayoutHook , logHook = dynamicLogWithPP $ myStateBarPP statBarPipe , manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig , startupHook = myStartupHook -- keys & mouse , modMask = mod4Mask -- look , borderWidth = 2 , focusedBorderColor = myColFgUrgent , normalBorderColor = myColBgNormal -- workspaces , workspaces = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] } `additionalKeysP` myKeys `additionalKeys` [ ((0, 0x1008ff11), spawn "amixer -q set Master 5%- unmute") , ((0, 0x1008ff12), spawn "amixer -q set Master mute") , ((0, 0x1008ff13), spawn "amixer -q set Master 5%+ unmute") ] -- alternates -- apps -- myBrowser = "google-chrome --enable-extensions --enable-plugins --enable-remote-fonts --enable-user-scripts" myBrowser = "chromium --enable-greasemonkey" myPdfViewer = "evince" myRunner = "exe=`dmenu_path | dmenu -b -nb '"++ myColBgNormal ++ "' -nf '" ++ myColFgNormal ++ "' -fn '" ++ myFont ++ "' -p '$'` && eval \"exec $exe\"" myRunnerRoot = "exe=`dmenu_path | dmenu -b -nb '"++ myColBgNormal ++ "' -nf '" ++ myColFgNormal ++ "' -sb '" ++ myColFgUrgent ++ "' -fn '" ++ myFont ++ "' -p '#'` && eval \"exec sudo $exe\"" myStateBar = "dzen2 -bg '" ++ myColBgNormal ++ "' -fn '" ++ myFont ++ "' -ta l -w 720 -h 24" myTerminal = "sakura" myTextEditor = "libreoffice" -- look myColBgNormal = "#2a2b2f" myColFgFocus = "#62acce" myColFgNormal = "#e1e0e5" myColFgUnimp = "#67686b" myColFgUrgent = "#e6ac32" myFont = "-*-dax-light-r-normal-*-17-*-*-*-p-*-iso8859-1" -- config myKeys = [ -- xmonad ("M-", spawn myRunner) , ("M-", spawn myRunnerRoot) , ("M-f", withFocused $ windows . W.sink) , ("M-q", kill) , ("M-s", spawn "/home/kamil/.dzen/dzen-stats.sh") , ("M-S-r", restart "xmonad" True) -- apps , ("M-b", spawn myBrowser) , ("M-m", spawn (myBrowser ++ " www.gmail.com")) , ("M-p", spawn myPdfViewer) , ("M-t", spawn myTextEditor) , ("M-", spawn myTerminal) -- xkb , ("M-`", spawn "/home/kamil/conf/kbd/layout_switcher.sh often") , ("M-S-`", spawn "/home/kamil/conf/kbd/layout_switcher.sh menu") ] myLayoutHook = avoidStruts (resizableTall ||| resizableWide) where resizableTall = ResizableTall 1 (3/100) (1/2) [] resizableWide = ResizableTall 2 (3/100) (1/2) [] myManageHook = composeAll [ className =? "Do" --> doIgnore , className =? "Gimp" --> doFloat , className =? "stalonetray" --> doIgnore -- download windows , className =? "Download" --> doShift "nine" -- dialogs , stringProperty "WM_WINDOW_TYPE" =? "_NET_WIM_WINDOW_TYPE_DIALOG" --> doFloat -- fontforge , stringProperty "WM_NAME" =? "Layers" --> doFloat , stringProperty "WM_NAME" =? "Tools" --> doFloat ] myStartupHook = do spawn "sudo /sbin/bootchartd stop" myStateBarPP handle = defaultPP { -- content ppExtras = [] , ppOrder = \(ws:l:t:e) -> [ws] ++ e -- look , ppCurrent = dzenColor myColFgFocus "" , ppHidden = dzenColor myColFgNormal "" , ppOutput = hPutStrLn handle , ppSep = " | " , ppUrgent = dzenColor myColFgUrgent "" }