This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
xmonad-conf/xmonad.hs

115 lines
3.6 KiB
Haskell

import XMonad
import XMonad.Config.Desktop
import XMonad.Config.Gnome
import XMonad.Actions.CycleWS
import XMonad.Actions.NoBorders
import XMonad.Actions.PhysicalScreens
import XMonad.Actions.Warp
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.SetWMName
import XMonad.Layout.ResizableTile
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig
import Control.Monad
import Control.Monad.Trans
import Data.Maybe
import Data.Monoid
import Ratio((%))
--import ConfigurableBorders
import FullscreenManager
import NoBorders
import ProcessWorkspaces
modm = mod4Mask
main = xmonad $ gnomeConfig
{ modMask = modm
, manageHook = myManageHook
, layoutHook = desktopLayoutModifiers myLayoutHook
, startupHook = myStartupHook
, handleEventHook = myEventHook
}
`additionalKeysP`
[ ("M-a", sendMessage MirrorShrink)
, ("M-y", sendMessage MirrorExpand)
, ("M-<Left>", prevWS)
, ("M-<Right>", nextWS)
, ("M-S-<Left>", shiftToPrev)
, ("M-S-<Right>", shiftToNext)
, ("M-S-b", withFocused toggleBorder >> refresh)
, ("M1-<F4>", kill)
, ("M-<F1>", viewOrWarp 0)
, ("M-<F2>", viewOrWarp 1)
, ("M-<F3>", viewOrWarp 2)
, ("M-p", spawnOnCurrent "exe=`dmenu_path | /home/neoraider/bin/dmemu -b` && eval \"exec $exe\"")
]
`additionalMouseBindings`
[ ((modm, button4), \_ -> sendMessage Shrink)
, ((modm, button5), \_ -> sendMessage Expand)
, ((modm .|. shiftMask, button4), \_ -> sendMessage MirrorExpand)
, ((modm .|. shiftMask, button5), \_ -> sendMessage MirrorShrink)
]
viewOrWarp :: Int -> X ()
viewOrWarp n = do
wset <- gets windowset
i <- getScreen $ P n
whenJust i $ \s -> do
ws <- screenWorkspace s
whenJust ws $ \w -> windows . W.view $ w
when (s == (W.screen . W.current $ wset)) $ warpToScreen s (1%2) (1%2)
--myStartupHook :: X ()
--myStartupHook = do
-- startupHook gnomeConfig
-- spawn "killall -u `id -un` -q xcompmgr; exec xcompmgr"
myStartupHook :: X ()
myStartupHook = do
startupHook gnomeConfig
setWMName "LG3D"
myManageHook :: ManageHook
myManageHook = composeAll
[ composeOne
[ isDialog -?> doFloat
, className =? "Guake.py" -?> (doFloatMaybeFullscreen <+> doIgnoreProcessWorkspace) -- <+> doConfigBorderOff)
--, className =? "Do" -?> (doFloat <+> doConfigBorderOff)
, className =? "MPlayer" -?> doCenterFloat
, className =? "Gimp" -?> doFloat
, className =? "Display" -?> doFloat
, className =? "Wine" -?> doFloat
, className =? "Pcsx2" -?> doFloat
, stringProperty "WM_ICON_NAME" =? "ZeroGS" -?> doFloat
, isFullscreen -?> doFullscreen
]
, doAutoShift
, manageHook gnomeConfig
]
myLayoutHook = processWorkspaceStorage $ manageFullscreen $ smartBorders (Full ||| tiled ||| Mirror tiled)
where
-- default tiling algorithm partitions the screen into two panes
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 = 3/5
-- Percent of screen to increment by when resizing panes
delta = 3/100
myEventHook :: Event -> X All
myEventHook ev = do
handleFullscreen ev
(handleEventHook gnomeConfig) ev