From 2f529702a9c77136c8c58a9192b07bee523e573f Mon Sep 17 00:00:00 2001 From: David Roundy Date: Thu, 6 Sep 2007 14:55:43 +0200 Subject: add function and comment assisting use in resizing the screen. darcs-hash:20070906125543-72aca-8cf6a1adc15e24be24f1368a96e424d97606f02d.gz --- LayoutScreens.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'LayoutScreens.hs') diff --git a/LayoutScreens.hs b/LayoutScreens.hs index a78a402..2961b8b 100644 --- a/LayoutScreens.hs +++ b/LayoutScreens.hs @@ -13,7 +13,7 @@ module XMonadContrib.LayoutScreens ( -- * Usage -- $usage - layoutScreens + layoutScreens, fixedLayout ) where import Control.Monad.Reader ( asks ) @@ -39,6 +39,16 @@ import Graphics.X11.Xlib.Extras -- -- > , ((modMask .|. shiftMask, xK_space), layoutScreens 2 (twoPane 0.5 0.5)) -- > , ((controlMask .|. modMask .|. shiftMask, xK_space), rescreen) +-- +-- Another example use would be to handle a scenario where xrandr didn't +-- work properly (e.g. a VNC X server in my case) and you want to be able +-- to resize your screen (e.g. to match the size of a remote VNC client): +-- +-- > import XMonadContrib.LayoutScreens +-- +-- > , ((modMask .|. shiftMask, xK_space), +-- > layoutScreens 1 (fixedLayout $ Rectangle 0 0 1024 768)) +-- > , ((controlMask .|. modMask .|. shiftMask, xK_space), rescreen) -- %import XMonadContrib.LayoutScreens -- %keybind , ((modMask .|. shiftMask, xK_space), layoutScreens 2 (twoPane 0.5 0.5)) @@ -62,3 +72,7 @@ getWindowRectangle w = withDisplay $ \d -> do a <- io $ getWindowAttributes d w return $ Rectangle (fromIntegral $ wa_x a) (fromIntegral $ wa_y a) (fromIntegral $ wa_width a) (fromIntegral $ wa_height a) + +fixedLayout :: Rectangle -> Layout a +fixedLayout r = Layout { doLayout = \_ (W.Stack f _ _) -> return ([(f, r)],Nothing) + , modifyLayout = const (return Nothing) } -- no changes -- cgit v1.2.3