diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-05-28 07:06:56 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-05-28 07:06:56 +0200 |
commit | e1c71f3449bc782e88a80e32346b6e1373451755 (patch) | |
tree | d0ead232ef9a7ad157679b61749c8afbf8cfaab8 | |
parent | d6c76f192898086e0e08eb26ef9c2a869f4fa80a (diff) | |
download | XMonadContrib-e1c71f3449bc782e88a80e32346b6e1373451755.tar.gz XMonadContrib-e1c71f3449bc782e88a80e32346b6e1373451755.tar.xz XMonadContrib-e1c71f3449bc782e88a80e32346b6e1373451755.zip |
Rescreen is in main xmonad now
darcs-hash:20070528050656-a5988-491d840e12d2a876c2f82bb52e7b2eeba79857a0.gz
-rw-r--r-- | Rescreen.hs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/Rescreen.hs b/Rescreen.hs deleted file mode 100644 index 90e6ab9..0000000 --- a/Rescreen.hs +++ /dev/null @@ -1,41 +0,0 @@ --- Grabs new screen information. Useful for randr setups. --- To use rescreen, add a keybinding in Config.hs. For example: --- , ((modMask .|. shiftMask, xK_F12 ), rescreen) - --- TODO Get this code into xmonad when it is ready for randr support. --- Make it happen automatically on randr events. It's currently 20 loc, but I --- believe it can be shrunk a bit. - -module XMonadContrib.Rescreen (rescreen) where - -import qualified StackSet as W -import XMonad -import Operations - -import Graphics.X11.Xlib -import Graphics.X11.Xinerama - -import Control.Monad.State -import Control.Monad.Reader -import Data.List (partition) - -rescreen :: X () -rescreen = do - dpy <- asks display - xinesc <- io $ getScreenInfo dpy - -- TODO: This stuff is necessary because Xlib apparently caches screen - -- width/height. Find a better solution later. I hate Xlib. - let sx = maximum $ map (\r -> rect_x r + fromIntegral (rect_width r)) xinesc - sy = maximum $ map (\r -> rect_y r + fromIntegral (rect_height r)) xinesc - modify (\s -> s { xineScreens = xinesc, dimensions = (sx, sy) }) - ws <- gets windowset - let s = W.current ws : W.visible ws - t = zipWith const [0 :: ScreenId ..] xinesc - (stay, hide) = partition (\x -> fromIntegral (W.screen x) < length t) s - newsids = filter (\x -> fromIntegral x >= length s) t - (newvis, newinvis) = splitAt (length newsids) (map W.workspace hide ++ W.hidden ws) - (newcurr : xs) = stay ++ zipWith W.Screen newvis newsids - windows $ const $ ws { W.current = newcurr - , W.visible = xs - , W.hidden = newinvis - } |