import XMonad import System.Exit import XMonad.Layout.Circle import XMonad.Layout.NoBorders import XMonad.Layout.ShowWName import XMonad.Util.Run import XMonad.Hooks.DynamicLog import XMonad.Hooks.ManageDocks import qualified XMonad.StackSet as W import qualified Data.Map as M main = do spawn "feh --bg-scale ~/desktop.png" xmobar <- spawnPipe "xmobar ~/.xmonad/xmobar" xmonad $ defaultConfig{ terminal ="urxvt", focusFollowsMouse = False, borderWidth = 1, modMask = mod4Mask, workspaces = ["dp1","dp2","dp3","dp4","dp5","dp6"], normalBorderColor = "#202020", focusedBorderColor = "#e67817", keys = myKeys, mouseBindings = myMouseBindings, layoutHook = showWName' mySWNConfig myLayout, manageHook = myManageHook <+> manageDocks, logHook = dynamicLogWithPP $ defaultPP {ppOutput = hPutStrLn xmobar}, startupHook = return ()} mySWNConfig = defaultSWNConfig {swn_font = "-xos4-terminus-bold-*-normal-*-14-*-*-*-*-*-iso10646-*" ,swn_bgcolor = "#202020" ,swn_color = "#e67817" ,swn_fade = 1/4} -- ssworkspaces :: [String] -- ssworkspaces = ["dp1","dp2","dp3","dp4","dp5","dp6","dp7"] myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ [((controlMask .|. mod1Mask,xK_q),spawn $ XMonad.terminal conf) ,((controlMask .|. mod4Mask,xK_a),spawn "firefox") ,((mod1Mask .|. mod4Mask,xK_a),spawn "urxvt -e mcabber") ,((mod4Mask,xK_Up),spawn "amixer set 'PCM' 5+ > /dev/null") ,((mod4Mask,xK_Down),spawn "amixer set 'PCM' 5- > /dev/null") ,((0,xK_Print),spawn "scrot ~/scrots/%m-%d-%T_scrot.png") ,((mod1Mask,xK_x),withFocused $ windows . W.sink) ,((mod1Mask,xK_q),spawn "xkill") --, ((mod1Mask,xK_x), withFocused (sendMessage . expandWindowAlt) >> sendMessage Expand) --, ("M-h", withFocused (sendMessage . shrinkWindowAlt) >> sendMessage Shrink) -- , ((mod1Mask,xK_x), sendMessage MirrorShrink) -- , ((mod1Mask,xK_z), sendMessage MirrorExpand) -- close focused window , ((modMask .|. shiftMask, xK_c ), kill) -- Rotate through the available layout algorithms , ((modMask, xK_space ), sendMessage NextLayout) -- Reset the layouts on the current workspace to default , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) -- Resize viewed windows to the correct size , ((modMask, xK_n ), refresh) -- Move focus to the next window , ((mod1Mask, xK_Tab ), windows W.focusDown) -- Move focus to the next window , ((modMask, xK_j ), windows W.focusDown) -- Move focus to the previous window , ((modMask, xK_k ), windows W.focusUp ) -- Move focus to the master window , ((modMask, xK_m ), windows W.focusMaster ) -- Swap the focused window and the master window , ((modMask, xK_Return), windows W.swapMaster) -- Swap the focused window with the next window , ((modMask .|. shiftMask, xK_j ), windows W.swapDown ) -- Swap the focused window with the previous window , ((modMask .|. shiftMask, xK_k ), windows W.swapUp ) -- Shrink the master area , ((modMask, xK_h ), sendMessage Shrink) -- Expand the master area , ((modMask, xK_l ), sendMessage Expand) -- Push window back into tiling -- , ((modMask, xK_t ), withFocused $ windows . W.sink) -- Increment the number of windows in the master area , ((modMask , xK_comma ), sendMessage (IncMasterN 1)) -- Deincrement the number of windows in the master area , ((modMask , xK_period), sendMessage (IncMasterN (-1))) -- toggle the status bar gap -- TODO, update this binding with avoidStruts , ((modMask , xK_b ), -- Quit xmonad , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- Restart xmonad , ((modMask , xK_q ), restart "xmonad" True) ] ++ -- -- mod-[1..9], Switch to workspace N -- mod-shift-[1..9], Move client to workspace N -- [((m .|. mod1Mask, k), windows $ f i) | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9] , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] ++ -- -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3 -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3 -- [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f)) | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..] , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]] myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $ [((mod1Mask,button1),(\w -> focus w >> mouseMoveWindow w)) ,((mod1Mask,button2),(\w -> focus w >> windows W.swapMaster)) ,((mod1Mask,button3),(\w -> focus w >> mouseResizeWindow w))] myLayout = avoidStruts $ smartBorders (tiled ||| Circle ||| Mirror tiled ||| Full) where tiled = Tall nmaster delta ratio nmaster = 1 ratio = 1/2 delta = 3/100 -- tiled = ResizableTall 1 (2/100) (1/2) [] myManageHook = composeAll [className =? "MPlayer" --> doFloat ,className =? "Gimp" --> doFloat ,className =? "Qmmp" --> doFloat ]