Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

My current XMonad configuration file.

View xmonad.hs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
import Data.Monoid
 
import Control.Monad
 
import qualified Data.Map as M
 
import XMonad hiding ((|||))
import XMonad.Util.EZConfig
import qualified XMonad.StackSet as W
 
import XMonad.Config.Desktop (desktopLayoutModifiers)
import XMonad.Config.Xfce
 
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.RunOrRaise
 
import XMonad.Actions.UpdatePointer
 
import XMonad.Actions.DynamicWorkspaces
import XMonad.Actions.CycleWS
import XMonad.Actions.CopyWindow (copy)
 
import XMonad.Layout.LayoutCombinators
import XMonad.Layout.PerWorkspace
import XMonad.Layout.WindowNavigation
 
import XMonad.Layout.LimitWindows
import XMonad.Actions.CycleWindows
 
import XMonad.Layout.NoBorders
import XMonad.Layout.Spacing
import XMonad.Layout.Gaps
 
import System.Exit
 
-- The Solarized colours
base03 = "#002b36"
base02 = "#073642"
base01 = "#586e75"
base00 = "#657b83"
base0 = "#839496"
base1 = "#93a1a1"
base2 = "#eee8d5"
base3 = "#fdf6e3"
yellow = "#b58900"
orange = "#cb4b16"
red = "#dc322f"
magenta = "#d33682"
violet = "#6c71c4"
blue = "#268bd2"
cyan = "#2aa198"
green = "#859900"
 
myConfig = xfceConfig
{ modMask = mod4Mask
, terminal = "xfce4-terminal"
 
, workspaces = myWorkspaces
 
, layoutHook = desktopLayoutModifiers myLayoutHook
, logHook = myLogHook >> logHook xfceConfig
 
, focusFollowsMouse = True
 
, borderWidth = 2
, normalBorderColor = base1
, focusedBorderColor = magenta
 
} `removeKeysP` keyRem `additionalKeysP` keyMap
 
keyRem = ["M-q", "M-S-q"]
 
keyMap =
-- Launching applications
[ ("M-p" , runOrRaisePrompt myXPConfig)
, ("M-S-p", shellPrompt myXPConfig)
 
-- Change shrink and expand so we can use M-h and M-l
, ("M-[", sendMessage Shrink)
, ("M-]", sendMessage Expand)
, ("M-S-[", replicateM_ 5 $ sendMessage Shrink)
, ("M-S-]", replicateM_ 5 $ sendMessage Expand)
 
-- h,j,k,l change windows, vim style
, ("M-j" , windows W.focusDown)
, ("M-k" , windows W.focusUp )
, ("M-S-j", windows W.swapDown )
, ("M-S-k", windows W.swapUp )
, ("M-h" , rotFocusedUp )
, ("M-l" , rotFocusedDown )
, ("M-S-h", rotUnfocusedUp )
, ("M-S-l", rotUnfocusedDown )
 
-- The arrow keys move around using spatial navigation
, ("M-<Left>", sendMessage $ Go L)
, ("M-<Right>", sendMessage $ Go R)
, ("M-<Up>", sendMessage $ Go U)
, ("M-<Down>", sendMessage $ Go D)
, ("M-S-<Left>", sendMessage $ Swap L)
, ("M-S-<Right>", sendMessage $ Swap R)
, ("M-S-<Up>", sendMessage $ Swap U)
, ("M-S-<Down>", sendMessage $ Swap D)
 
-- y,u,i,o change workspaces/screens, vim style
, ("M-u" , prevWS)
, ("M-i" , nextWS)
, ("M-S-u", shiftToPrev >> prevWS)
, ("M-S-i", shiftToNext >> nextWS)
, ("M-y" , prevScreen)
, ("M-o" , nextScreen)
, ("M-S-y", shiftPrevScreen)
, ("M-S-o", shiftNextScreen)
 
-- M-Tab switches between two workspace, M-S-Tab swaps screens
, ("M-<Tab>" , toggleWS)
, ("M-S-<Tab>", swapNextScreen)
 
-- Use dynamic workspaces with M-0
, ("M-0" , withWorkspace myXPConfig (windows . W.greedyView))
, ("M-S-0" , withWorkspace myXPConfig (windows . W.shift))
 
-- M-q closes window, M-S-q closes workspace
, ("M-q", kill)
, ("M-S-q", removeWorkspace)
 
-- Switch immediately to the full layout
, ("M-f", sendMessage $ JumpToLayout "Full")
 
-- Add workspace number keys
] ++ [ ("M-" ++ show n, withNthWorkspace W.greedyView $ pred n) | n <- [1..9]
] ++ [ ("M-S-" ++ show n, withNthWorkspace W.shift $ pred n) | n <- [1..9]]
 
myLayoutHook = configurableNavigation noNavigateBorders $
windowGaps $
tiled ||| Full
where
-- Set-up for evened-out gaps between windows
windowGap = 5
windowGaps = gaps [(d, windowGap) | d <- [U, D, L, R]] . spacing windowGap
 
-- Tiled with a limit on the number of windows at once
tiled = limitWindows 4 $ Tall nmaster delta ratio
 
nmaster = 1
ratio = 1/2
delta = 1/100
 
myManageHook = composeAll
[ manageHook xfceConfig
, resource =? "desktop_window" --> doIgnore
, resource =? "kdesktop" --> doIgnore ]
 
myWorkspaces = ["main", "web", "mail", "work"]
 
myLogHook = updatePointer (TowardsCentre 0.3 0.3)
 
myXPConfig = defaultXPConfig
{ height = 24
, promptBorderWidth = 0
, bgColor = base2
, fgColor = base00
, bgHLight = base00
, fgHLight = base3
, borderColor = cyan
, font = "xft:Droid Sans:size=10" }
 
main = xmonad myConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.