Created
November 21, 2012 20:16
-
-
Save twpayne/4127380 to your computer and use it in GitHub Desktop.
Tom's XMonad config
This file contains hidden or 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
| import Data.Bits ((.|.)) | |
| import qualified Data.Map as M | |
| import System.Exit | |
| import XMonad hiding (Tall) | |
| import XMonad.Actions.FocusNth | |
| import XMonad.Actions.Search | |
| import XMonad.Actions.Submap | |
| import XMonad.Config.Gnome | |
| import XMonad.Core | |
| import XMonad.Hooks.ManageDocks | |
| import XMonad.Hooks.ManageHelpers | |
| import XMonad.Hooks.RestoreMinimized | |
| import XMonad.Layout.BoringWindows | |
| import XMonad.Layout.HintedTile | |
| import XMonad.Layout.LayoutBuilder | |
| import XMonad.Layout.Maximize | |
| import XMonad.Layout.Minimize | |
| import XMonad.Layout.NoBorders | |
| import XMonad.Layout.Tabbed | |
| import XMonad.Layout.WindowNavigation | |
| import XMonad.Operations | |
| import XMonad.Prompt | |
| import XMonad.Prompt.AppLauncher | |
| import XMonad.Prompt.Man | |
| import XMonad.Prompt.Ssh | |
| import qualified XMonad.StackSet as W | |
| myModMask = mod1Mask | |
| myXPConfig = defaultXPConfig | |
| { font = "xft:Sans-10" | |
| , height = 24 | |
| } | |
| myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ | |
| [ ((modMask, xK_d), launchApp myXPConfig "gnome-help") | |
| , ((modMask, xK_e), launchApp myXPConfig "gvim") | |
| , ((modMask .|. controlMask, xK_e), spawn "gnome-open http://www.gmail.com/") | |
| , ((modMask, xK_g), promptSearch myXPConfig google) | |
| , ((modMask .|. controlMask, xK_g), selectSearch google) | |
| , ((modMask, xK_s), spawn $ XMonad.terminal conf ++ " -e screen -d -RR") | |
| , ((modMask, xK_t), spawn $ XMonad.terminal conf) | |
| , ((modMask, xK_w), spawn "chromium-browser --ignore-gpu-blacklist") | |
| , ((modMask .|. controlMask, xK_w), spawn "firefox") | |
| , ((modMask, xK_x), gnomeRun) | |
| , ((modMask, xK_z), sshPrompt myXPConfig) | |
| , ((modMask, xK_c), kill) | |
| , ((modMask, xK_b), sendMessage ToggleStruts) | |
| , ((modMask, xK_space), sendMessage NextLayout) | |
| , ((modMask .|. controlMask, xK_space), setLayout $ XMonad.layoutHook conf) | |
| , ((modMask, xK_comma), sendMessage $ IncMasterN 1) | |
| , ((modMask, xK_period), sendMessage $ IncMasterN (-1)) | |
| , ((modMask, xK_h), sendMessage $ Go L) | |
| , ((modMask, xK_j), sendMessage $ Go D) | |
| , ((modMask, xK_k), sendMessage $ Go U) | |
| , ((modMask, xK_l), sendMessage $ Go R) | |
| , ((modMask .|. controlMask, xK_h), sendMessage $ Swap L) | |
| , ((modMask .|. controlMask, xK_j), sendMessage $ Swap D) | |
| , ((modMask .|. controlMask, xK_k), sendMessage $ Swap U) | |
| , ((modMask .|. controlMask, xK_l), sendMessage $ Swap R) | |
| , ((modMask, xK_i), focusDown) | |
| , ((modMask, xK_u), focusUp) | |
| , ((modMask .|. controlMask, xK_Return), withFocused $ sendMessage . maximizeRestore) | |
| , ((modMask, xK_m), withFocused $ sendMessage . MinimizeWin) | |
| , ((modMask .|. controlMask, xK_m), sendMessage RestoreNextMinimizedWin) | |
| , ((modMask, xK_Return), windows W.swapMaster) | |
| , ((modMask .|. controlMask, xK_i), windows W.swapDown) | |
| , ((modMask .|. controlMask, xK_u), windows W.swapUp) | |
| , ((modMask .|. shiftMask, xK_h), sendMessage Shrink) | |
| , ((modMask .|. shiftMask, xK_j), sendMessage Expand) | |
| , ((modMask .|. shiftMask, xK_k), sendMessage Shrink) | |
| , ((modMask .|. shiftMask, xK_l), sendMessage Expand) | |
| , ((modMask .|. controlMask, xK_f), withFocused $ float) | |
| , ((modMask .|. controlMask, xK_t), withFocused $ windows . W.sink) | |
| , ((modMask, xK_y), screenWorkspace 0 >>= flip whenJust (windows . W.view)) | |
| , ((modMask, xK_o), screenWorkspace 1 >>= flip whenJust (windows . W.view)) | |
| , ((modMask .|. controlMask, xK_r), restart "xmonad" True) | |
| , ((modMask .|. controlMask, xK_q), spawn "gnome-session-save --gui --shutdown-dialog") | |
| , ((modMask .|. controlMask, xK_x), spawn "gnome-session-save --gui --logout-dialog") | |
| , ((modMask .|. controlMask, xK_z), spawn "gnome-screensaver-command --lock") | |
| ] | |
| ++ | |
| [ ((modMask, k), focusNth i) | |
| | (k, i) <- zip [xK_1 ..] [0 .. 8] ] | |
| ++ | |
| [ ((modMask, k), windows $ W.greedyView i) | |
| | (k, i) <- zip [xK_F1 ..] (XMonad.workspaces conf) ] | |
| ++ | |
| [ ((modMask .|. shiftMask, k), windows $ W.shift i) | |
| | (k, i) <- zip [xK_F1 ..] (XMonad.workspaces conf) ] | |
| myLayoutHook = windowNavigation $ smartBorders $ myAvoidStruts $ maximize $ minimize $ boringAuto $ layouts | |
| where | |
| layouts = hintedTile ||| twoPaneTabbed ||| Full | |
| myAvoidStruts = avoidStruts | |
| hintedTile = HintedTile nmaster delta ratio TopLeft Tall | |
| twoPaneTabbed = ( (layoutN 1 (relBox 0 0 0.5 1) (Just $ relBox 0 0 1 1) $ myTabbed) | |
| $ (layoutAll (relBox 0.5 0 1 1) $ myTabbed) | |
| ) | |
| myTabbed = tabbed shrinkText myTheme | |
| myTheme = defaultTheme { fontName = "xft:Sans-8" } | |
| nmaster = 1 | |
| delta = 4/128 | |
| ratio = 1/2 | |
| myHandleEventHook = restoreMinimizedEventHook | |
| myTerminal = "gnome-terminal-wrapper" | |
| main = xmonad gnomeConfig | |
| { handleEventHook = myHandleEventHook | |
| , keys = myKeys | |
| , layoutHook = myLayoutHook | |
| , modMask = myModMask | |
| , terminal = myTerminal | |
| } | |
| -- vim: set filetype=haskell: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment