Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import XMonad hiding ( (|||) )
- import XMonad.Actions.CycleWS
- import XMonad.Layout.IndependentScreens
- import XMonad.Layout.LayoutCombinators
- import XMonad.Layout (Tall)
- import Data.Monoid (mempty)
- import System.Exit
- import qualified XMonad.StackSet as W
- import qualified Data.Map as M
- myTerminal = "xfce4-terminal"
- myModMask = mod4Mask -- Super
- myBorderWidth = 3
- -- Default workspaces
- -- Tagging: ["a", "b", "c"] ++ map show [4..9]
- myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
- myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
- [ ((modm, xK_Return), spawn "xfce4-terminal")
- -- launch rofi
- , ((modm, xK_r ), spawn "rofi -show drun -show-icons")
- -- move focus to the previous/next window
- , ((modm, xK_Left ), windows W.focusUp)
- , ((modm, xK_Right ), windows W.focusDown)
- , ((modm, xK_c), kill)
- -- shrink/expand master area
- , ((modm .|. shiftMask, xK_Left ), sendMessage Shrink)
- , ((modm .|. shiftMask, xK_Right), sendMessage Expand)
- -- swap the focused window and the next window
- , ((modm .|. shiftMask, xK_j), windows W.swapDown)
- , ((modm .|. shiftMask, xK_k), windows W.swapUp) -- swap with previous
- -- restore into tiling mode
- , ((modm, xK_t), withFocused $ windows . W.sink)
- , ((modm, xK_g), sendMessage $ JumpToLayout "Tall")
- , ((modm, xK_f), sendMessage $ JumpToLayout "Full")
- -- quit xmonad
- , ((modm .|. shiftMask, xK_q), io (exitWith ExitSuccess))
- -- crashes in lightdm, need to fix
- --, ((modm, xK_q), spawn "xmonad --recompile; xmonad --restart")
- ]
- ++
- -- mod + [1..9] - switch to workspace N
- -- mod + shift + N - move client to workspace N
- [((m .|. modm, k), windows $ f i)
- | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
- , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
- ++
- -- next/prev screens
- [
- ((modm, xK_comma), nextScreen)
- , ((modm, xK_period), prevScreen)
- ]
- -- [((m .|. modm, 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)]]
- -- Mouse bindings
- myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
- [
- -- mod+button1 - set to floating mode, and move by dragging
- ((modm, button1), \w -> focus w >> mouseMoveWindow w
- >> windows W.shiftMaster)
- -- mod+button3 - set to floating mode, resize by dragging
- , ((modm, button3), \w -> focus w >> mouseResizeWindow w
- >> windows W.shiftMaster)
- ]
- -- Layouts
- -- More info: https://wiki.haskell.org/Xmonad/Config_archive/Template_xmonad.hs_(0.9)
- myLayout = Tall 1 (3/100) (1/2) ||| Full ||| Full
- -- Window rules
- myManageHook = composeAll
- [ className =? "Krita" --> doFloat
- , className =? "Nemo" --> doFloat
- , resource =? "desktop_window" --> doIgnore ]
- -- Event handling
- --
- -- Defines a custom handler function for X Events. The function should
- -- return (All True) if the default handler is to be run afterwards. To
- -- combine event hooks use mappend or mconcat from Data.Monoid.
- myEventHook = mempty
- -- Status bars and logging
- myLogHook = return ()
- myStartupHook = return ()
- defaults = def
- { terminal = myTerminal
- , workspaces = withScreens 2 ["web", "code", ""]
- , modMask = myModMask
- , borderWidth = myBorderWidth
- -- key bindings
- , keys = myKeys
- , mouseBindings = myMouseBindings
- -- hooks and layouts
- , layoutHook = myLayout
- , handleEventHook = myEventHook
- , logHook = myLogHook
- , startupHook = myStartupHook
- }
- main = do xmonad defaults
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement