From e2f3a1393658bae1d8c88cacc159a7e4d1a398b8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 16 Feb 2010 11:45:32 +0100 Subject: Added mouse binding and changed layouts --- .gitignore | 5 +++++ lib/FullscreenManager.hs | 2 +- xmonad.hs | 29 ++++++++++++++++++++--------- 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee6844f --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*~ +*.o +*.hi +xmonad.errors +xmonad-i386-linux diff --git a/lib/FullscreenManager.hs b/lib/FullscreenManager.hs index ac1907f..95a6ff2 100644 --- a/lib/FullscreenManager.hs +++ b/lib/FullscreenManager.hs @@ -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) diff --git a/xmonad.hs b/xmonad.hs index 7dd1d14..be1d1e9 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -5,6 +5,7 @@ import XMonad.Actions.CycleWS import XMonad.Actions.NoBorders import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageHelpers +import XMonad.Layout.ResizableTile import qualified XMonad.StackSet as W import XMonad.Util.EZConfig @@ -17,27 +18,37 @@ import FullscreenManager import NoBorders +myModMask = mod4Mask + main = xmonad $ gnomeConfig - { modMask = mod4Mask -- set the mod key to the windows key + { modMask = myModMask , manageHook = myManageHook , layoutHook = desktopLayoutModifiers myLayoutHook , startupHook = myStartupHook , handleEventHook = myEventHook } `additionalKeysP` - [ ("M-", prevWS ) - , ("M-", nextWS ) - , ("M-S-", shiftToPrev ) - , ("M-S-", shiftToNext ) + [ ("M-a", sendMessage MirrorShrink) + , ("M-y", sendMessage MirrorExpand) + , ("M-", prevWS) + , ("M-", nextWS) + , ("M-S-", shiftToPrev) + , ("M-S-", shiftToNext) , ("M-S-b", withFocused toggleBorder >> refresh) , ("M1-", kill) ] + `additionalMouseBindings` + [ ((myModMask, button4), \_ -> sendMessage Shrink) + , ((myModMask, button5), \_ -> sendMessage Expand) + , ((myModMask .|. shiftMask, button4), \_ -> sendMessage MirrorExpand) + , ((myModMask .|. shiftMask, button5), \_ -> sendMessage MirrorShrink) + ] myStartupHook :: X () myStartupHook = do startupHook gnomeConfig - spawn "xcompmgr" + spawn "killall -u `id -un` -q xcompmgr; exec xcompmgr" myManageHook :: ManageHook myManageHook = composeAll @@ -53,16 +64,16 @@ myManageHook = composeAll ] -myLayoutHook = manageFullscreen $ configureBorders $ smartBorders (tiled ||| Mirror tiled ||| Full) +myLayoutHook = manageFullscreen $ configureBorders $ smartBorders (tiled ||| Mirror tiled ||| Full) where -- 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 nmaster = 1 -- Default proportion of screen occupied by master pane - ratio = 1/2 + ratio = 3/5 -- Percent of screen to increment by when resizing panes delta = 3/100 -- cgit v1.2.3