Added mouse binding and changed layouts

This commit is contained in:
Matthias Schiffer 2010-02-16 11:45:32 +01:00
parent a1af240919
commit e2f3a13936
3 changed files with 26 additions and 10 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
*~
*.o
*.hi
xmonad.errors
xmonad-i386-linux

View file

@ -85,7 +85,7 @@ instance LayoutModifier FullscreenManager Window where
isFloating :: Window -> X (Bool) isFloating :: Window -> X Bool
isFloating w = gets windowset >>= \ws -> return $ M.member w (W.floating ws) isFloating w = gets windowset >>= \ws -> return $ M.member w (W.floating ws)

View file

@ -5,6 +5,7 @@ import XMonad.Actions.CycleWS
import XMonad.Actions.NoBorders import XMonad.Actions.NoBorders
import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers import XMonad.Hooks.ManageHelpers
import XMonad.Layout.ResizableTile
import qualified XMonad.StackSet as W import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig import XMonad.Util.EZConfig
@ -17,27 +18,37 @@ import FullscreenManager
import NoBorders import NoBorders
myModMask = mod4Mask
main = xmonad $ gnomeConfig main = xmonad $ gnomeConfig
{ modMask = mod4Mask -- set the mod key to the windows key { modMask = myModMask
, manageHook = myManageHook , manageHook = myManageHook
, layoutHook = desktopLayoutModifiers myLayoutHook , layoutHook = desktopLayoutModifiers myLayoutHook
, startupHook = myStartupHook , startupHook = myStartupHook
, handleEventHook = myEventHook , handleEventHook = myEventHook
} }
`additionalKeysP` `additionalKeysP`
[ ("M-<Left>", prevWS ) [ ("M-a", sendMessage MirrorShrink)
, ("M-y", sendMessage MirrorExpand)
, ("M-<Left>", prevWS)
, ("M-<Right>", nextWS) , ("M-<Right>", nextWS)
, ("M-S-<Left>", shiftToPrev) , ("M-S-<Left>", shiftToPrev)
, ("M-S-<Right>", shiftToNext) , ("M-S-<Right>", shiftToNext)
, ("M-S-b", withFocused toggleBorder >> refresh) , ("M-S-b", withFocused toggleBorder >> refresh)
, ("M1-<F4>", kill) , ("M1-<F4>", kill)
] ]
`additionalMouseBindings`
[ ((myModMask, button4), \_ -> sendMessage Shrink)
, ((myModMask, button5), \_ -> sendMessage Expand)
, ((myModMask .|. shiftMask, button4), \_ -> sendMessage MirrorExpand)
, ((myModMask .|. shiftMask, button5), \_ -> sendMessage MirrorShrink)
]
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
startupHook gnomeConfig startupHook gnomeConfig
spawn "xcompmgr" spawn "killall -u `id -un` -q xcompmgr; exec xcompmgr"
myManageHook :: ManageHook myManageHook :: ManageHook
myManageHook = composeAll myManageHook = composeAll
@ -56,13 +67,13 @@ myManageHook = composeAll
myLayoutHook = manageFullscreen $ configureBorders $ smartBorders (tiled ||| Mirror tiled ||| Full) myLayoutHook = manageFullscreen $ configureBorders $ smartBorders (tiled ||| Mirror tiled ||| Full)
where where
-- default tiling algorithm partitions the screen into two panes -- default tiling algorithm partitions the screen into two panes
tiled = Tall nmaster delta ratio tiled = ResizableTall nmaster delta ratio []
-- The default number of windows in the master pane -- The default number of windows in the master pane
nmaster = 1 nmaster = 1
-- Default proportion of screen occupied by master pane -- Default proportion of screen occupied by master pane
ratio = 1/2 ratio = 3/5
-- Percent of screen to increment by when resizing panes -- Percent of screen to increment by when resizing panes
delta = 3/100 delta = 3/100