Skip to content

Instantly share code, notes, and snippets.

@rcalsaverini
Created September 3, 2012 12:35
Show Gist options
  • Save rcalsaverini/3609033 to your computer and use it in GitHub Desktop.
Save rcalsaverini/3609033 to your computer and use it in GitHub Desktop.
my xmonad.hs
-- basic imports
import XMonad
-- needed for layouts
import XMonad.Layout.Grid
-- needed for hot keys
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Actions.CycleWS (nextWS, prevWS, shiftToNext, shiftToPrev)
-- needed for magageHooks
import XMonad.StackSet (shift)
-- needed for Pidgin
import XMonad.Layout.IM
import Data.Ratio ((%))
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.PerWorkspace (onWorkspace)
-- Workspace names
myWorkspaces :: [WorkspaceId]
myWorkspaces = ["general", "internet", "code 1", "code 2", "code 3", "im"] ++ map show [7..9 :: Int]
-- keys
myKeys = [ ((mod4Mask , xK_Right) , nextWS)
, ((mod4Mask , xK_Left) , prevWS)
, ((mod4Mask .|. shiftMask, xK_Right) , shiftToNext >> nextWS)
, ((mod4Mask .|. shiftMask, xK_Left) , shiftToPrev >> prevWS)
]
-- Layout Hook
myLayoutHook = avoidStruts $ onWorkspace "im" imLayout standardLayouts
where standardLayouts = layoutHook defaultConfig
imLayout = withIM (1%7) (Role "buddy_list") standardLayouts
--Manage Hooks
myManageHook = composeAll [shiftInstantMessengerToProperWS, floatChatWindows]
shiftInstantMessengerToProperWS = className =? "Pidgin" --> doShift "im"
floatChatWindows = (className =? "Pidgin") <&&> (windowRole /=? "buddy_list") --> doFloat
windowRole = stringProperty "WM_WINDOW_ROLE"
--Config
myConfig = defaultConfig { modMask = mod4Mask
, borderWidth = 1
, terminal = "gnome-terminal"
, normalBorderColor = "#000000"
, focusedBorderColor = "#FF0000"
, manageHook = myManageHook
, layoutHook = myLayoutHook
, workspaces = myWorkspaces
} `additionalKeys` myKeys
-- Main
main = do spawn "pidgin"
xmonad myConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment