Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- TODO:
- -- bind mouse resize corner using flexible resize
- import XMonad
- import XMonad.Config.Gnome
- import Control.Monad (liftM2)
- import XMonad.Actions.CycleWindows
- import XMonad.Actions.CycleWS
- --import XMonad.Actions.FlexibleResize
- import XMonad.Actions.UpdatePointer
- import XMonad.Hooks.EwmhDesktops
- import XMonad.Hooks.SetWMName
- import XMonad.Hooks.ManageHelpers
- import XMonad.Layout.NoBorders
- import XMonad.Layout.ToggleLayouts
- import qualified XMonad.StackSet as W
- import XMonad.Util.EZConfig
- --import XMonad.Util.Run
- import XMonad.Util.Scratchpad
- main = xmonad $ gnomeConfig {
- borderWidth = 2,
- normalBorderColor = "#222",
- focusedBorderColor = "#c50",
- --focusFollowsMouse = False,
- terminal = myTerminal,
- modMask = mod4Mask,
- workspaces = myWorkspaces,
- logHook = updatePointer (Relative 0.5 0.5),
- layoutHook = smartBorders (layoutHook gnomeConfig),
- handleEventHook = fullscreenEventHook, --fix Chrome full screen
- startupHook = ewmhDesktopsStartup >> setWMName "LG3D",
- manageHook = myManageHook
- }
- `additionalKeysP` myKeys
- myTerminal = "gnome-terminal"
- myWorkspaces = ["1","2","3","4","5","6"]
- myKeys = [
- ("M4-u", spawn "xmonad --recompile; xmonad --restart"),
- ("C-M1-<Home>", spawn "nautilus"),
- ("C-M1-t", spawn myTerminal),
- ("M4-`", scratchpadSpawnActionCustom "gnome-terminal --disable-factory --name scratchpad"),
- ("M4-f", spawn "firefox"),
- ("M4-b", spawn "chromium"),
- -- print screen
- ("<Print>", spawn "gnome-screenshot"),
- ("C-<Print>", spawn "gnome-screenshot -w"),
- -- windows
- ("M1-q", kill),
- ("M1-<Tab>", cycleRecentWindows [xK_Alt_L] xK_Tab xK_Tab ), --classic alt-tab behavior
- -- workspaces
- ("C-M1-h", prevWS),
- ("C-M1-l", nextWS),
- ("M1-`", toggleWS),
- ("C-S-h", shiftToPrev),
- ("C-S-l", shiftToNext),
- -- screens
- ("M4-<Tab>", nextScreen),
- ("C-S-<Tab>", shiftNextScreen)
- ] ++ [
- -- switch to workspace as opposed to swapping
- -- switch to workspace with C- as opposed to M-
- (otherModMasks ++ "C-" ++ [key], action tag) |
- (tag, key) <- zip myWorkspaces "123456789",
- (otherModMasks, action) <- [ ("", windows . W.view), -- was W.greedyView
- ("S-", windows . W.shift) ]
- ]
- myManageHook = composeAll [
- className =? "Eog" --> doFloat,
- className =? "Gimp" --> doFloat,
- className =? "banshee" --> viewShift "6",
- appName =? "crx_nckgahadagoaajjgafhacjanaoiihapd" --> doFloat, --Google Chat extension windows
- className =? "Do" --> doFloat,
- className =? "Nautilus" --> viewShift "1",
- title =? "Top Expanded Edge Panel" --> doIgnore,
- title =? "Bottom Expanded Edge Panel" --> doIgnore,
- resource =? "desktop_window" --> doIgnore,
- isDialog --> doCenterFloat,
- isFullscreen --> doFullFloat
- ] <+> manageScratchPad <+> manageHook defaultConfig
- where viewShift = doF . liftM2 (.) W.view W.shift --shift workspace after move hook
- -- ScratchPad customizations
- manageScratchPad :: ManageHook
- manageScratchPad = scratchpadManageHook (W.RationalRect l t w h)
- where
- h = 0.8 -- terminal height
- w = 0.8 -- terminal width
- t = 0.1 -- distance from top edge
- l = 0.1 -- distance from left edge
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement