Skip to content

Instantly share code, notes, and snippets.

@ArthurClune
Created March 7, 2012 14:56
Show Gist options
  • Save ArthurClune/1993633 to your computer and use it in GitHub Desktop.
Save ArthurClune/1993633 to your computer and use it in GitHub Desktop.
xmonad.hs
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeysP)
import qualified XMonad.StackSet as W
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
import XMonad.Layout.Spiral
import System.IO
import XMonad.Hooks.EwmhDesktops
-- myManageHook = composeOne [
-- isFullscreen -?> doFullFloat
-- ]
myManageHook = composeAll [
isFullscreen --> (doF W.focusDown <+> doFullFloat)
]
myLayout = avoidStruts ( Mirror tiled ||| tiled |||
Full ||| spiral(6/7) )
where
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 2/3
delta = 3/100
myWorkspaces = ["1","2","3","4","5","6","7","8","9"]
main = do
xmproc <- spawnPipe "xmobar"
xmonad $ defaultConfig
{ manageHook = manageDocks <+> myManageHook -- make sure to include myManageHook definition from above
<+> manageHook defaultConfig
, layoutHook = smartBorders $ myLayout
, terminal = "gnome-terminal"
, logHook = dynamicLogWithPP $ xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "red" "" . shorten 60
}
-- , modMask = mod4Mask -- Rebind Mod to the Windows key
, handleEventHook = fullscreenEventHook
} `additionalKeysP`
([
("M-=", spawn "gnome-screensaver-command -l"),
("M-p", spawn "exe=`dmenu_path | /home/arthur/.cabal/bin/yeganesh` && eval \"exec $exe\""),
("M-o", spawn "host=`list_ssh_hosts | /home/arthur/.cabal/bin/yeganesh -p hosts -f` && eval \"exec gnome-terminal --command=\\\"/usr/bin/ssh $host\\\"\"")
] ++
[
(otherModMasks ++ "M-" ++ [key], action tag)
| (tag, key) <- zip myWorkspaces "123456789"
, (otherModMasks, action) <- [ ("", windows . W.view) -- was W.greedyView
, ("S-", windows . W.shift)]
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment