Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import XMonad
- import Monad
- import qualified XMonad.StackSet as W
- import XMonad.Hooks.ManageHelpers
- import XMonad.Hooks.ManageDocks
- import XMonad.Config.Xfce
- import XMonad.Util.EZConfig
- import XMonad.Layout.NoBorders
- import XMonad.Config.Desktop
- import XMonad.Layout.Tabbed
- import Data.Monoid (All (All), mappend)
- myTerminal = "xfce4-terminal"
- -- layoutHook = smartBorders
- main = xmonad $ xfceConfig
- { terminal = myTerminal
- , layoutHook = smartBorders (layoutHook desktopConfig)
- , manageHook = newManageHook
- , handleEventHook = fullscreenEventHook `mappend` handleEventHook xfceConfig
- }
- `additionalKeys`
- [ ((mod1Mask, xK_p ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
- ]
- newManageHook = myManageHook <+> manageHook desktopConfig
- -- myManageHook = composeAll
- -- [ isFullscreen --> (doF W.focusDown <+> doFullFloat)
- -- ]
- myManageHook = composeOne [
- transience,
- isFullscreen -?> doFullFloat,
- resource =? "stalonetray" -?> doIgnore
- ]
- -- Helper functions to fullscreen the window
- fullFloat, tileWin :: Window -> X ()
- fullFloat w = windows $ W.float w r
- where r = W.RationalRect 0 0 1 1
- tileWin w = windows $ W.sink w
- fullscreenEventHook :: Event -> X All
- fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ dat) = do
- state <- getAtom "_NET_WM_STATE"
- fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN"
- isFull <- runQuery isFullscreen win
- -- Constants for the _NET_WM_STATE protocol
- let remove = 0
- add = 1
- toggle = 2
- -- The ATOM property type for changeProperty
- ptype = 4
- action = head dat
- when (typ == state && (fromIntegral fullsc) `elem` tail dat) $ do
- when (action == add || (action == toggle && not isFull)) $ do
- io $ changeProperty32 dpy win state ptype propModeReplace [fromIntegral fullsc]
- fullFloat win
- when (head dat == remove || (action == toggle && isFull)) $ do
- io $ changeProperty32 dpy win state ptype propModeReplace []
- tileWin win
- return $ All True
- fullscreenEventHook _ = return $ All True
Add Comment
Please, Sign In to add comment