| 1 | import XMonad |
| 2 | import XMonad.Actions.SpawnOn |
| 3 | import XMonad.Hooks.DynamicLog |
| 4 | import XMonad.Hooks.ManageDocks |
| 5 | import XMonad.Util.Run |
| 6 | import XMonad.Util.EZConfig(additionalKeys) |
| 7 | import XMonad.Util.WorkspaceCompare |
| 8 | import XMonad.Layout.PerWorkspace |
| 9 | import XMonad.Layout.Spacing |
| 10 | import XMonad.Layout.ThreeColumns |
| 11 | import XMonad.Layout.Spiral |
| 12 | import Data.Ratio |
| 13 | import System.IO |
| 14 | |
| 15 | threeColLayout = ThreeCol 2 (3/100) (1/2) |
| 16 | tallLayout = Tall 1 (5/100) (2/3) |
| 17 | spiralLayout = spiral (1 % 1) |
| 18 | |
| 19 | mLayout = spacing 7 |
| 20 | $ tallLayout |
| 21 | ||| threeColLayout |
| 22 | ||| spiralLayout |
| 23 | |
| 24 | mStartupHook :: X () |
| 25 | mStartupHook = do |
| 26 | spawnOn "term" "kremterm" |
| 27 | spawnOn "term" "kremterm" |
| 28 | spawnOn "term" "kremterm" |
| 29 | spawnOn "term" "kremterm" |
| 30 | spawnOn "term" "kremterm" |
| 31 | spawnOn "term" "kremterm" |
| 32 | spawnOn "term" "kremterm" |
| 33 | |
| 34 | spawnOn "www" "google-chrome-stable" |
| 35 | |
| 36 | spawnOn "chat" "skype" |
| 37 | spawnOn "chat" "kremirc" |
| 38 | |
| 39 | spawnOn "music" "spotify" |
| 40 | spawnOn "music" "kremcmus" |
| 41 | |
| 42 | spawnOn "game" "steam" |
| 43 | |
| 44 | mManageHook = composeAll |
| 45 | [ appName =? "kremterm" --> doShift "term" |
| 46 | , appName =? "google-chrome-stable" --> doShift "www" |
| 47 | , appName =? "firefox" --> doShift "www" |
| 48 | , appName =? "kremirc" --> doShift "chat" |
| 49 | , appName =? "skype" --> doShift "chat" |
| 50 | , appName =? "spotify" --> doShift "music" |
| 51 | , appName =? "kremcmus" --> doShift "music" |
| 52 | , appName =? "thunderbird" --> doShift "mail" |
| 53 | , appName =? "Steam" --> doShift "game" |
| 54 | , className =? "Steam" --> doShift "game" |
| 55 | , appName =? "steam" --> doShift "game" |
| 56 | , className =? "steam" --> doShift "game" |
| 57 | , appName =? "steam.sh" --> doShift "game" |
| 58 | , className =? "steam.sh" --> doShift "game" |
| 59 | , appName =? "gimp" --> doShift "extra" |
| 60 | ] |
| 61 | |
| 62 | mWorkspaces = ["mon", "term", "www", "chat", "music", "mail", "game", "code", "extra"] |
| 63 | -- 1 2 3 4 5 6 7 8 9 |
| 64 | |
| 65 | main = do |
| 66 | xmproc <- spawnPipe "xmobar" |
| 67 | xmonad $ defaultConfig |
| 68 | { manageHook = mManageHook <+> manageDocks |
| 69 | , layoutHook = avoidStruts $ mLayout |
| 70 | , startupHook = mStartupHook |
| 71 | , logHook = dynamicLogWithPP xmobarPP |
| 72 | { ppOutput = hPutStrLn xmproc |
| 73 | , ppCurrent = xmobarColor "#70a16c" "" . wrap "[" "]" |
| 74 | , ppTitle = xmobarColor "#70a16c" "" . shorten 40 |
| 75 | , ppVisible = wrap "(" ")" |
| 76 | , ppWsSep = " <fc=#af652f>|</fc> " |
| 77 | , ppUrgent = xmobarColor "#af652f" "" |
| 78 | , ppHidden = xmobarColor "#746c48" "" |
| 79 | , ppHiddenNoWindows = xmobarColor "#746c48" "" |
| 80 | , ppOrder = \(ws:_:t:_) -> [ws,t] |
| 81 | } |
| 82 | , workspaces = mWorkspaces |
| 83 | , modMask = mod4Mask |
| 84 | , normalBorderColor = "#170f0d" |
| 85 | , focusedBorderColor = "#746c48" |
| 86 | , borderWidth = 2 |
| 87 | , terminal = "urxvtc" |
| 88 | } |