Skip to content

Instantly share code, notes, and snippets.

@ThomasLocke
Created February 5, 2012 18:21
Show Gist options
  • Save ThomasLocke/1747012 to your computer and use it in GitHub Desktop.
Save ThomasLocke/1747012 to your computer and use it in GitHub Desktop.
xmonad.hs
import XMonad
import XMonad.Actions.CycleWS -- cycle thru WS', toggle last WS
import XMonad.Hooks.DynamicLog -- statusbar
import XMonad.Hooks.ManageDocks -- dock/tray mgmt
import XMonad.Util.EZConfig -- append key/mouse bindings
import XMonad.Util.Run(spawnPipe) -- spawnPipe and hPutStrLn
import System.IO
myLogHook dest = dynamicLogWithPP defaultPP { ppOutput = hPutStrLn dest
,ppVisible = wrap "(" ")"
}
myKeys = [ ("M-b" , sendMessage ToggleStruts ) -- toggle the status bar gap
, ("M-<Right>" , nextWS ) -- go to next workspace
, ("M-<Left>" , prevWS ) -- go to prev workspace
, ("M-p" , spawn "gmrun" ) -- app launcher
, ("M-r" , spawn "xmonad --restart" ) -- restart xmonad w/o recompiling
, ("M-g" , spawn "google-chrome" ) -- launch chrome
, ("M-f" , spawn "firefox" ) -- launch firefox
, ("M-s" , spawn "sudo /usr/sbin/pm-suspend" ) -- suspend
, ("C-M-h" , spawn "sudo /usr/sbin/pm-hibernate" ) -- hibernate
, ("C-M-r" , spawn "sudo /sbin/shutdown -r now" ) -- reboot
, ("C-M-h" , spawn "sudo /sbin/shutdown -h now" ) -- halt
]
main = do
xmproc <- spawnPipe "/usr/bin/xmobar /home/thomas/.xmobarrc"
xmonad $ defaultConfig
{ manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, terminal = "urxvt"
, focusFollowsMouse = False
, logHook = myLogHook xmproc
, modMask = mod4Mask -- Rebind Mod to the Windows key
}
`additionalKeysP` myKeys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment