xmonad 0.9.2 → 0.10
raw patch · 16 files changed
+413/−541 lines, 16 filesdep +utf8-string
Dependencies added: utf8-string
Files
- Main.hs +12/−2
- TODO +2/−0
- XMonad/Config.hs +12/−28
- XMonad/Core.hs +58/−21
- XMonad/Layout.hs +5/−5
- XMonad/Main.hsc +71/−13
- XMonad/ManageHook.hs +11/−9
- XMonad/Operations.hs +21/−19
- XMonad/StackSet.hs +3/−3
- man/xmonad.1 +52/−44
- man/xmonad.1.html +153/−374
- man/xmonad.1.markdown +6/−0
- man/xmonad.hs +1/−17
- tests/loc.hs +2/−2
- util/GenerateManpage.hs +1/−1
- xmonad.cabal +3/−3
Main.hs view
@@ -25,6 +25,8 @@ import Paths_xmonad (version) import Data.Version (showVersion) +import Graphics.X11.Xinerama (compiledWithXinerama)+ #ifdef TESTING import qualified Properties #endif@@ -38,15 +40,22 @@ let launch = catchIO buildLaunch >> xmonad defaultConfig case args of [] -> launch- ["--resume", _] -> launch+ ("--resume":_) -> launch ["--help"] -> usage ["--recompile"] -> recompile True >>= flip unless exitFailure+ ["--replace"] -> launch ["--restart"] -> sendRestart >> return ()- ["--version"] -> putStrLn ("xmonad " ++ showVersion version)+ ["--version"] -> putStrLn $ unwords shortVersion+ ["--verbose-version"] -> putStrLn . unwords $ shortVersion ++ longVersion #ifdef TESTING ("--run-tests":_) -> Properties.main #endif _ -> fail "unrecognized flags"+ where+ shortVersion = ["xmonad", showVersion version]+ longVersion = [ "compiled by", compilerName, showVersion compilerVersion+ , "for", arch ++ "-" ++ os+ , "\nXinerama:", show compiledWithXinerama ] usage :: IO () usage = do@@ -57,6 +66,7 @@ " --help Print this message" : " --version Print the version number" : " --recompile Recompile your ~/.xmonad/xmonad.hs" :+ " --replace Replace the running window manager with xmonad" : " --restart Request a running xmonad process to restart" : #ifdef TESTING " --run-tests Run the test suite" :
TODO view
@@ -16,6 +16,8 @@ * test core with 6.6 and 6.8 * bump xmonad.cabal version and X11 version * upload X11 and xmonad to Hackage+* update links to hackage in download.html+* update #xmonad topic * check examples/text in user-facing Config.hs * check tour.html and intro.html are up to date, and mention all core bindings * confirm template config is type correct
XMonad/Config.hs view
@@ -25,11 +25,11 @@ -- Useful imports -- import XMonad.Core as XMonad hiding- (workspaces,manageHook,numlockMask,keys,logHook,startupHook,borderWidth,mouseBindings+ (workspaces,manageHook,keys,logHook,startupHook,borderWidth,mouseBindings ,layoutHook,modMask,terminal,normalBorderColor,focusedBorderColor,focusFollowsMouse ,handleEventHook) import qualified XMonad.Core as XMonad- (workspaces,manageHook,numlockMask,keys,logHook,startupHook,borderWidth,mouseBindings+ (workspaces,manageHook,keys,logHook,startupHook,borderWidth,mouseBindings ,layoutHook,modMask,terminal,normalBorderColor,focusedBorderColor,focusFollowsMouse ,handleEventHook) @@ -64,22 +64,6 @@ defaultModMask :: KeyMask defaultModMask = mod1Mask --- | The mask for the numlock key. Numlock status is "masked" from the--- current modifier status, so the keybindings will work with numlock on or--- off. You may need to change this on some systems.------ You can find the numlock modifier by running "xmodmap" and looking for a--- modifier with Num_Lock bound to it:------ > $ xmodmap | grep Num--- > mod2 Num_Lock (0x4d)------ Set numlockMask = 0 if you don't have a numlock key, or want to treat--- numlock status separately.----numlockMask :: KeyMask-numlockMask = mod2Mask- -- | Width of the window border in pixels. -- borderWidth :: Dimension@@ -181,7 +165,7 @@ keys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ -- launching and killing programs [ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) -- %! Launch terminal- , ((modMask, xK_p ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") -- %! Launch dmenu+ , ((modMask, xK_p ), spawn "dmenu_run") -- %! Launch dmenu , ((modMask .|. shiftMask, xK_p ), spawn "gmrun") -- %! Launch gmrun , ((modMask .|. shiftMask, xK_c ), kill) -- %! Close the focused window @@ -218,7 +202,7 @@ -- quit, or restart , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) -- %! Quit xmonad- , ((modMask , xK_q ), spawn "xmonad --recompile && xmonad --restart") -- %! Restart xmonad+ , ((modMask , xK_q ), spawn "if type xmonad; then xmonad --recompile && xmonad --restart; else xmessage xmonad not in \\$PATH: \"$PATH\"; fi") -- %! Restart xmonad ] ++ -- mod-[1..9] %! Switch to workspace N@@ -236,15 +220,15 @@ -- | Mouse bindings: default actions bound to mouse events -- mouseBindings :: XConfig Layout -> M.Map (KeyMask, Button) (Window -> X ())-mouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $+mouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList -- mod-button1 %! Set the window to floating mode and move by dragging- [ ((modMask, button1), (\w -> focus w >> mouseMoveWindow w- >> windows W.shiftMaster))+ [ ((modMask, button1), \w -> focus w >> mouseMoveWindow w+ >> windows W.shiftMaster) -- mod-button2 %! Raise the window to the top of the stack- , ((modMask, button2), (\w -> focus w >> windows W.shiftMaster))+ , ((modMask, button2), windows . (W.shiftMaster .) . W.focusWindow) -- mod-button3 %! Set the window to floating mode and resize by dragging- , ((modMask, button3), (\w -> focus w >> mouseResizeWindow w- >> windows W.shiftMaster))+ , ((modMask, button3), \w -> focus w >> mouseResizeWindow w+ >> windows W.shiftMaster) -- you may also bind events to the mouse scroll wheel (button4 and button5) ] @@ -256,7 +240,6 @@ , XMonad.terminal = terminal , XMonad.normalBorderColor = normalBorderColor , XMonad.focusedBorderColor = focusedBorderColor- , XMonad.numlockMask = numlockMask , XMonad.modMask = defaultModMask , XMonad.keys = keys , XMonad.logHook = logHook@@ -264,4 +247,5 @@ , XMonad.mouseBindings = mouseBindings , XMonad.manageHook = manageHook , XMonad.handleEventHook = handleEventHook- , XMonad.focusFollowsMouse = focusFollowsMouse }+ , XMonad.focusFollowsMouse = focusFollowsMouse+ }
XMonad/Core.hs view
@@ -1,7 +1,5 @@ {-# LANGUAGE ExistentialQuantification, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, TypeSynonymInstances, CPP, DeriveDataTypeable #-}--- required for deriving Typeable-{- # OPTIONS_GHC -fglasgow-exts #-} ----------------------------------------------------------------------------- -- |@@ -24,15 +22,17 @@ XConf(..), XConfig(..), LayoutClass(..), Layout(..), readsLayout, Typeable, Message, SomeMessage(..), fromMessage, LayoutMessages(..),+ StateExtension(..), ExtensionClass(..), runX, catchX, userCode, userCodeDef, io, catchIO, installSignalHandlers, uninstallSignalHandlers, withDisplay, withWindowSet, isRoot, runOnWorkspaces,- getAtom, spawn, spawnPID, getXMonadDir, recompile, trace, whenJust, whenX,+ getAtom, spawn, spawnPID, xfork, getXMonadDir, recompile, trace, whenJust, whenX, atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW, ManageHook, Query(..), runQuery ) where import XMonad.StackSet hiding (modify) import Prelude hiding ( catch )+import Codec.Binary.UTF8.String (encodeString) import Control.Exception.Extensible (catch, fromException, try, bracket, throw, finally, SomeException(..)) import Control.Applicative import Control.Monad.State@@ -51,19 +51,25 @@ import Graphics.X11.Xlib.Extras (Event) import Data.Typeable import Data.List ((\\))-import Data.Maybe (isJust)+import Data.Maybe (isJust,fromMaybe) import Data.Monoid-import Data.Maybe (fromMaybe) import qualified Data.Map as M import qualified Data.Set as S -- | XState, the (mutable) window manager state. data XState = XState- { windowset :: !WindowSet -- ^ workspace list- , mapped :: !(S.Set Window) -- ^ the Set of mapped windows- , waitingUnmap :: !(M.Map Window Int) -- ^ the number of expected UnmapEvents- , dragging :: !(Maybe (Position -> Position -> X (), X ())) }+ { windowset :: !WindowSet -- ^ workspace list+ , mapped :: !(S.Set Window) -- ^ the Set of mapped windows+ , waitingUnmap :: !(M.Map Window Int) -- ^ the number of expected UnmapEvents+ , dragging :: !(Maybe (Position -> Position -> X (), X ()))+ , numberlockMask :: !KeyMask -- ^ The numlock modifier+ , extensibleState :: !(M.Map String (Either String StateExtension))+ -- ^ stores custom state information.+ --+ -- The module "XMonad.Utils.ExtensibleState" in xmonad-contrib+ -- provides additional information and a simple interface for using this.+ } -- | XConf, the (read-only) window manager configuration. data XConf = XConf@@ -93,7 +99,6 @@ -- should also be run afterwards. mappend should be used for combining -- event hooks in most cases. , workspaces :: ![String] -- ^ The list of workspaces' names- , numlockMask :: !KeyMask -- ^ The numlock modifier , modMask :: !KeyMask -- ^ the mod modifier , keys :: !(XConfig Layout -> M.Map (ButtonMask,KeySym) (X ())) -- ^ The key binding: a map from key presses and actions@@ -129,9 +134,7 @@ -- instantiated on 'XConf' and 'XState' automatically. -- newtype X a = X (ReaderT XConf (StateT XState IO) a)-#ifndef __HADDOCK__ deriving (Functor, Monad, MonadIO, MonadState XState, MonadReader XConf, Typeable)-#endif instance Applicative X where pure = return@@ -143,9 +146,7 @@ type ManageHook = Query (Endo WindowSet) newtype Query a = Query (ReaderT Window X a)-#ifndef __HADDOCK__ deriving (Functor, Monad, MonadReader Window, MonadIO)-#endif runQuery :: Query a -> Window -> X a runQuery (Query m) w = runReaderT m w@@ -344,6 +345,33 @@ instance Message LayoutMessages -- ---------------------------------------------------------------------+-- Extensible state+--++-- | Every module must make the data it wants to store+-- an instance of this class.+--+-- Minimal complete definition: initialValue+class Typeable a => ExtensionClass a where+ -- | Defines an initial value for the state extension+ initialValue :: a+ -- | Specifies whether the state extension should be+ -- persistent. Setting this method to 'PersistentExtension'+ -- will make the stored data survive restarts, but+ -- requires a to be an instance of Read and Show.+ --+ -- It defaults to 'StateExtension', i.e. no persistence.+ extensionType :: a -> StateExtension+ extensionType = StateExtension++-- | Existential type to store a state extension.+data StateExtension =+ forall a. ExtensionClass a => StateExtension a+ -- ^ Non-persistent state extension+ | forall a. (Read a, Show a, ExtensionClass a) => PersistentExtension a+ -- ^ Persistent extension++-- --------------------------------------------------------------------- -- | General utilities -- -- Lift an 'IO' action into the 'X' monad@@ -356,16 +384,22 @@ catchIO f = io (f `catch` \(SomeException e) -> hPrint stderr e >> hFlush stderr) -- | spawn. Launch an external application. Specifically, it double-forks and--- runs the 'String' you pass as a command to /bin/sh.+-- runs the 'String' you pass as a command to \/bin\/sh.+--+-- Note this function assumes your locale uses utf8. spawn :: MonadIO m => String -> m () spawn x = spawnPID x >> return () -- | Like 'spawn', but returns the 'ProcessID' of the launched application spawnPID :: MonadIO m => String -> m ProcessID-spawnPID x = io . forkProcess . finally nullStdin $ do+spawnPID x = xfork $ executeFile "/bin/sh" False ["-c", encodeString x] Nothing++-- | A replacement for 'forkProcess' which resets default signal handlers.+xfork :: MonadIO m => IO () -> m ProcessID+xfork x = io . forkProcess . finally nullStdin $ do uninstallSignalHandlers createSession- executeFile "/bin/sh" False ["-c", x] Nothing+ x where nullStdin = do fd <- openFd "/dev/null" ReadOnly Nothing defaultFileFlags@@ -393,9 +427,11 @@ -- -- * the xmonad executable does not exist ----- * the xmonad executable is older than xmonad.hs+-- * the xmonad executable is older than xmonad.hs or any file in+-- ~\/.xmonad\/lib ----- The -i flag is used to restrict recompilation to the xmonad.hs file only.+-- The -i flag is used to restrict recompilation to the xmonad.hs file only,+-- and any files in the ~\/.xmonad\/lib directory. -- -- Compilation errors (if any) are logged to ~\/.xmonad\/xmonad.errors. If -- GHC indicates failure with a non-zero exit code, an xmessage displaying@@ -419,7 +455,7 @@ then do -- temporarily disable SIGCHLD ignoring: uninstallSignalHandlers- status <- bracket (openFile err WriteMode) hClose $ \h -> do+ status <- bracket (openFile err WriteMode) hClose $ \h -> waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir) Nothing Nothing Nothing (Just h) @@ -431,7 +467,8 @@ ghcErr <- readFile err let msg = unlines $ ["Error detected while loading xmonad configuration file: " ++ src]- ++ lines ghcErr ++ ["","Please check the file for errors."]+ ++ lines (if null ghcErr then show status else ghcErr)+ ++ ["","Please check the file for errors."] -- nb, the ordering of printing, then forking, is crucial due to -- lazy evaluation hPutStrLn stderr msg
XMonad/Layout.hs view
@@ -1,4 +1,3 @@-{- # OPTIONS_GHC -fglasgow-exts #-} -- For deriving Data/Typeable {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, PatternGuards, TypeSynonymInstances, DeriveDataTypeable #-} -- --------------------------------------------------------------------------@@ -53,7 +52,8 @@ -- 'IncMasterN'. data Tall a = Tall { tallNMaster :: !Int -- ^ The default number of windows in the master pane (default: 1) , tallRatioIncrement :: !Rational -- ^ Percent of screen to increment by when resizing panes (default: 3/100)- , tallRatio :: !Rational } -- ^ Default proportion of screen occupied by master pane (default: 1/2)+ , tallRatio :: !Rational -- ^ Default proportion of screen occupied by master pane (default: 1/2)+ } deriving (Show, Read) -- TODO should be capped [0..1] .. @@ -125,7 +125,7 @@ -- | Mirror a rectangle. mirrorRect :: Rectangle -> Rectangle-mirrorRect (Rectangle rx ry rw rh) = (Rectangle ry rx rh rw)+mirrorRect (Rectangle rx ry rw rh) = Rectangle ry rx rh rw ------------------------------------------------------------------------ -- LayoutClass selection manager@@ -173,7 +173,7 @@ instance (LayoutClass l a, LayoutClass r a) => LayoutClass (Choose l r) a where runLayout (W.Workspace i (Choose L l r) ms) =- fmap (second . fmap $ flip (Choose L) $ r) . runLayout (W.Workspace i l ms)+ fmap (second . fmap $ flip (Choose L) r) . runLayout (W.Workspace i l ms) runLayout (W.Workspace i (Choose R l r) ms) = fmap (second . fmap $ Choose R l) . runLayout (W.Workspace i r ms) @@ -194,7 +194,7 @@ R -> choose c R Nothing =<< handle r NextNoWrap - handleMessage c@(Choose _ l _) m | Just FirstLayout <- fromMessage m = do + handleMessage c@(Choose _ l _) m | Just FirstLayout <- fromMessage m = flip (choose c L) Nothing =<< handle l FirstLayout handleMessage c@(Choose d l r) m | Just ReleaseResources <- fromMessage m =
XMonad/Main.hsc view
@@ -15,8 +15,10 @@ module XMonad.Main (xmonad) where +import Control.Arrow (second) import Data.Bits import Data.List ((\\))+import Data.Function import qualified Data.Map as M import qualified Data.Set as S import Control.Monad.Reader@@ -66,6 +68,10 @@ rootw <- rootWindow dpy dflt + args <- getArgs++ when ("--replace" `elem` args) $ replace dpy dflt rootw+ -- If another WM is running, a BadAccess error will be returned. The -- default error handler will write the exception to stderr and exit with -- an error.@@ -88,12 +94,10 @@ return (fromMaybe fbc_ v) hSetBuffering stdout NoBuffering- args <- getArgs let layout = layoutHook xmc lreads = readsLayout layout initialWinset = new layout (workspaces xmc) $ map SD xinesc- maybeRead reads' s = case reads' s of [(x, "")] -> Just x _ -> Nothing@@ -103,6 +107,10 @@ ws <- maybeRead reads s return . W.ensureTags layout (workspaces xmc) $ W.mapLayout (fromMaybe layout . maybeRead lreads) ws+ extState = fromMaybe M.empty $ do+ ("--resume" : _ : dyns : _) <- return args+ vals <- maybeRead reads dyns+ return . M.fromList . map (second Left) $ vals cf = XConf { display = dpy@@ -114,15 +122,19 @@ , buttonActions = mouseBindings xmc xmc , mouseFocused = False , mousePosition = Nothing }- st = XState- { windowset = initialWinset- , mapped = S.empty- , waitingUnmap = M.empty- , dragging = Nothing } + st = XState+ { windowset = initialWinset+ , numberlockMask = 0+ , mapped = S.empty+ , waitingUnmap = M.empty+ , dragging = Nothing+ , extensibleState = extState+ } allocaXEvent $ \e -> runX cf st $ do + setNumlockMask grabKeys grabButtons @@ -143,12 +155,10 @@ userCode $ startupHook initxmc -- main loop, for all you HOF/recursion fans out there.- forever_ $ prehandle =<< io (nextEvent dpy e >> getEvent e)+ forever $ prehandle =<< io (nextEvent dpy e >> getEvent e) return () where- forever_ a = a >> forever_ a- -- if the event gives us the position of the pointer, set mousePosition prehandle e = let mouse = do guard (ev_event_type e `elem` evs) return (fromIntegral (ev_x_root e)@@ -212,7 +222,9 @@ -- set keyboard mapping handle e@(MappingNotifyEvent {}) = do io $ refreshKeyboardMapping e- when (ev_request e == mappingKeyboard) grabKeys+ when (ev_request e `elem` [mappingKeyboard, mappingModifier]) $ do+ setNumlockMask+ grabKeys -- handle button release, which may finish dragging. handle e@(ButtonEvent {ev_event_type = t})@@ -285,8 +297,9 @@ handle (ConfigureEvent {ev_window = w}) = whenX (isRoot w) rescreen -- property notify-handle PropertyEvent { ev_event_type = t, ev_atom = a }- | t == propertyNotify && a == wM_NAME = userCodeDef () =<< asks (logHook . config)+handle event@(PropertyEvent { ev_event_type = t, ev_atom = a })+ | t == propertyNotify && a == wM_NAME = asks (logHook . config) >>= userCodeDef () >>+ broadcastMessage event handle e@ClientMessageEvent { ev_message_type = mt } = do a <- getAtom "XMONAD_RESTART"@@ -318,6 +331,18 @@ return $ not (wa_override_redirect wa) && (wa_map_state wa == waIsViewable || ic) +setNumlockMask :: X ()+setNumlockMask = do+ dpy <- asks display+ ms <- io $ getModifierMapping dpy+ xs <- sequence [ do+ ks <- io $ keycodeToKeysym dpy kc 0+ if ks == xK_Num_Lock+ then return (setBit 0 (fromIntegral m))+ else return (0 :: KeyMask)+ | (m, kcs) <- ms, kc <- kcs, kc /= 0]+ modify (\s -> s { numberlockMask = foldr (.|.) 0 xs })+ -- | Grab the keys back grabKeys :: X () grabKeys = do@@ -341,3 +366,36 @@ ems <- extraModifiers ba <- asks buttonActions mapM_ (\(m,b) -> mapM_ (grab b . (m .|.)) ems) (M.keys $ ba)++-- | @replace@ to signals compliant window managers to exit.+replace :: Display -> ScreenNumber -> Window -> IO ()+replace dpy dflt rootw = do+ -- check for other WM+ wmSnAtom <- internAtom dpy ("WM_S" ++ show dflt) False+ currentWmSnOwner <- xGetSelectionOwner dpy wmSnAtom+ when (currentWmSnOwner /= 0) $ do+ -- prepare to receive destroyNotify for old WM+ selectInput dpy currentWmSnOwner structureNotifyMask++ -- create off-screen window+ netWmSnOwner <- allocaSetWindowAttributes $ \attributes -> do+ set_override_redirect attributes True+ set_event_mask attributes propertyChangeMask+ let screen = defaultScreenOfDisplay dpy+ visual = defaultVisualOfScreen screen+ attrmask = cWOverrideRedirect .|. cWEventMask+ createWindow dpy rootw (-100) (-100) 1 1 0 copyFromParent copyFromParent visual attrmask attributes++ -- try to acquire wmSnAtom, this should signal the old WM to terminate+ xSetSelectionOwner dpy wmSnAtom netWmSnOwner currentTime++ -- SKIPPED: check if we acquired the selection+ -- SKIPPED: send client message indicating that we are now the WM++ -- wait for old WM to go away+ fix $ \again -> do+ evt <- allocaXEvent $ \event -> do+ windowEvent dpy currentWmSnOwner structureNotifyMask event+ get_EventType event++ when (evt /= destroyNotify) again
XMonad/ManageHook.hs view
@@ -22,7 +22,7 @@ import XMonad.Core import Graphics.X11.Xlib.Extras import Graphics.X11.Xlib (Display, Window, internAtom, wM_NAME)-import Control.Exception (bracket, catch, SomeException(..))+import Control.Exception.Extensible (bracket, catch, SomeException(..)) import Control.Monad.Reader import Data.Maybe import Data.Monoid@@ -34,22 +34,24 @@ liftX = Query . lift -- | The identity hook that returns the WindowSet unchanged.-idHook :: ManageHook-idHook = doF id+idHook :: Monoid m => m+idHook = mempty --- | Compose two 'ManageHook's.-(<+>) :: ManageHook -> ManageHook -> ManageHook+-- | Infix 'mappend'. Compose two 'ManageHook' from right to left.+(<+>) :: Monoid m => m -> m -> m (<+>) = mappend -- | Compose the list of 'ManageHook's.-composeAll :: [ManageHook] -> ManageHook+composeAll :: Monoid m => [m] -> m composeAll = mconcat infix 0 --> -- | @p --> x@. If @p@ returns 'True', execute the 'ManageHook'.-(-->) :: Query Bool -> ManageHook -> ManageHook-p --> f = p >>= \b -> if b then f else mempty+--+-- > (-->) :: Monoid m => Query Bool -> Query m -> Query m -- a simpler type+(-->) :: (Monad m, Monoid a) => m Bool -> m a -> m a+p --> f = p >>= \b -> if b then f else return mempty -- | @q =? x@. if the result of @q@ equals @x@, return 'True'. (=?) :: Eq a => Query a -> a -> Query Bool@@ -101,7 +103,7 @@ return $ fmap (map (toEnum . fromIntegral)) md -- | Modify the 'WindowSet' with a pure function.-doF :: (WindowSet -> WindowSet) -> ManageHook+doF :: (s -> s) -> Query (Endo s) doF = return . Endo -- | Move the window to the floating layer.
XMonad/Operations.hs view
@@ -1,7 +1,6 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}-{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, PatternGuards, TypeSynonymInstances, DeriveDataTypeable #-}+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, PatternGuards, TypeSynonymInstances #-} -{- # OPTIONS_GHC -fglasgow-exts #-} -- For deriving Data/Typeable -- -------------------------------------------------------------------------- -- | -- Module : XMonad.Operations@@ -67,7 +66,7 @@ where i = W.tag $ W.workspace $ W.current ws mh <- asks (manageHook . config)- g <- fmap appEndo $ userCodeDef (Endo id) (runQuery mh w)+ g <- appEndo <$> userCodeDef (Endo id) (runQuery mh w) windows (g . f) -- | unmanage. A window no longer exists, remove it from the window@@ -154,13 +153,13 @@ whenJust (W.peek ws) $ \w -> io $ setWindowBorder d w fbc + mapM_ reveal visible+ setTopFocus+ -- hide every window that was potentially visible before, but is not -- given a position by a layout now. mapM_ hide (nub (oldvisible ++ newwindows) \\ visible) - mapM_ reveal visible- setTopFocus- -- all windows that are no longer in the windowset are marked as -- withdrawn, it is important to do this after the above, otherwise 'hide' -- will overwrite withdrawnState with iconicState@@ -200,7 +199,7 @@ reveal w = withDisplay $ \d -> do setWMState w normalState io $ mapWindow d w- modify (\s -> s { mapped = S.insert w (mapped s) })+ whenX (isClient w) $ modify (\s -> s { mapped = S.insert w (mapped s) }) -- | The client events that xmonad is interested in clientMask :: EventMask@@ -210,7 +209,7 @@ setInitialProperties :: Window -> X () setInitialProperties w = asks normalBorder >>= \nb -> withDisplay $ \d -> do setWMState w iconicState- io $ selectInput d w $ clientMask+ io $ selectInput d w clientMask bw <- asks (borderWidth . config) io $ setWindowBorderWidth d w bw -- we must initially set the color of new windows, to maintain invariants@@ -320,14 +319,13 @@ dpy <- asks display -- clear mouse button grab and border on other windows- forM_ (W.current ws : W.visible ws) $ \wk -> do- forM_ (W.index (W.view (W.tag (W.workspace wk)) ws)) $ \otherw -> do+ forM_ (W.current ws : W.visible ws) $ \wk ->+ forM_ (W.index (W.view (W.tag (W.workspace wk)) ws)) $ \otherw -> setButtonGrab True otherw -- If we ungrab buttons on the root window, we lose our mouse bindings. whenX (not <$> isRoot w) $ setButtonGrab False w- io $ do setInputFocus dpy w revertToPointerRoot 0- -- raiseWindow dpy w+ io $ setInputFocus dpy w revertToPointerRoot 0 ------------------------------------------------------------------------ -- Message handling@@ -338,7 +336,7 @@ sendMessage a = do w <- W.workspace . W.current <$> gets windowset ml' <- handleMessage (W.layout w) (SomeMessage a) `catchX` return Nothing- whenJust ml' $ \l' -> do+ whenJust ml' $ \l' -> windows $ \ws -> ws { W.current = (W.current ws) { W.workspace = (W.workspace $ W.current ws) { W.layout = l' }}}@@ -388,13 +386,13 @@ -- (numlock and capslock) extraModifiers :: X [KeyMask] extraModifiers = do- nlm <- asks (numlockMask . config)+ nlm <- gets numberlockMask return [0, nlm, lockMask, nlm .|. lockMask ] -- | Strip numlock\/capslock from a mask cleanMask :: KeyMask -> X KeyMask cleanMask km = do- nlm <- asks (numlockMask . config)+ nlm <- gets numberlockMask return (complement (nlm .|. lockMask) .&. km) -- | Get the 'Pixel' value for a named color@@ -412,9 +410,13 @@ restart prog resume = do broadcastMessage ReleaseResources io . flush =<< asks display- args <- if resume then gets (("--resume":) . return . showWs . windowset) else return []+ let wsData = show . W.mapLayout show . windowset+ maybeShow (t, Right (PersistentExtension ext)) = Just (t, show ext)+ maybeShow (t, Left str) = Just (t, str)+ maybeShow _ = Nothing+ extState = return . show . catMaybes . map maybeShow . M.toList . extensibleState+ args <- if resume then gets (\s -> "--resume":wsData s:extState s) else return [] catchIO (executeFile prog True args Nothing)- where showWs = show . W.mapLayout show ------------------------------------------------------------------------ -- | Floating layer support@@ -434,7 +436,7 @@ (fi (wa_width wa + bw*2) % fi (rect_width sr)) (fi (wa_height wa + bw*2) % fi (rect_height sr)) - return (W.screen $ sc, rr)+ return (W.screen sc, rr) where fi x = fromIntegral x -- | Given a point, determine the screen (if any) that contains it.@@ -504,7 +506,7 @@ wa <- io $ getWindowAttributes d w sh <- io $ getWMNormalHints d w io $ warpPointer d none w 0 0 0 0 (fromIntegral (wa_width wa)) (fromIntegral (wa_height wa))- mouseDrag (\ex ey -> do+ mouseDrag (\ex ey -> io $ resizeWindow d w `uncurry` applySizeHintsContents sh (ex - fromIntegral (wa_x wa), ey - fromIntegral (wa_y wa)))
XMonad/StackSet.hs view
@@ -52,7 +52,7 @@ ) where import Prelude hiding (filter)-import Data.Maybe (listToMaybe,isJust)+import Data.Maybe (listToMaybe,isJust,fromMaybe) import qualified Data.List as L (deleteBy,find,splitAt,filter,nub) import Data.List ( (\\) ) import qualified Data.Map as M (Map,insert,delete,empty)@@ -155,7 +155,7 @@ deriving (Show, Read, Eq) -- |--- A stack is a cursor onto a (possibly empty) window list.+-- A stack is a cursor onto a window list. -- The data structure tracks focus by construction, and -- the master window is by convention the top-most item. -- Focus operations will not reorder the list that results from@@ -369,7 +369,7 @@ -- focusWindow :: (Eq s, Eq a, Eq i) => a -> StackSet i l a s sd -> StackSet i l a s sd focusWindow w s | Just w == peek s = s- | otherwise = maybe s id $ do+ | otherwise = fromMaybe s $ do n <- findTag w s return $ until ((Just w ==) . peek) focusUp (view n s)
man/xmonad.1 view
@@ -1,65 +1,64 @@-.TH xmonad 1 "21 December 10" xmonad-0.9.2 "xmonad manual".TH "" "" +.TH xmonad 1 "25 October 09" xmonad-0.10 "xmonad manual".TH "" "" .SH Name .PP xmonad - a tiling window manager .SH Description .PP-\f[I]xmonad\f[] is a minimalist tiling window manager for X,-written in Haskell.+\f[I]xmonad\f[] is a minimalist tiling window manager for X, written in+Haskell. Windows are managed using automatic layout algorithms, which can be dynamically reconfigured.-At any time windows are arranged so as to maximize the use of-screen real estate.+At any time windows are arranged so as to maximize the use of screen+real estate. All features of the window manager are accessible purely from the keyboard: a mouse is entirely optional.-\f[I]xmonad\f[] is configured in Haskell, and custom layout-algorithms may be implemented by the user in config files.-A principle of \f[I]xmonad\f[] is predictability: the user should-know in advance precisely the window arrangement that will result-from any action.+\f[I]xmonad\f[] is configured in Haskell, and custom layout algorithms+may be implemented by the user in config files.+A principle of \f[I]xmonad\f[] is predictability: the user should know+in advance precisely the window arrangement that will result from any+action. .PP-By default, \f[I]xmonad\f[] provides three layout algorithms: tall,-wide and fullscreen.-In tall or wide mode, windows are tiled and arranged to prevent-overlap and maximize screen use.-Sets of windows are grouped together on virtual screens, and each-screen retains its own layout, which may be reconfigured-dynamically.+By default, \f[I]xmonad\f[] provides three layout algorithms: tall, wide+and fullscreen.+In tall or wide mode, windows are tiled and arranged to prevent overlap+and maximize screen use.+Sets of windows are grouped together on virtual screens, and each screen+retains its own layout, which may be reconfigured dynamically. Multiple physical monitors are supported via Xinerama, allowing simultaneous display of a number of screens. .PP-By utilizing the expressivity of a modern functional language with-a rich static type system, \f[I]xmonad\f[] provides a complete,-featureful window manager in less than 1200 lines of code, with an-emphasis on correctness and robustness.+By utilizing the expressivity of a modern functional language with a+rich static type system, \f[I]xmonad\f[] provides a complete, featureful+window manager in less than 1200 lines of code, with an emphasis on+correctness and robustness. Internal properties of the window manager are checked using a combination of static guarantees provided by the type system, and type-based automated testing.-A benefit of this is that the code is simple to understand, and-easy to modify.+A benefit of this is that the code is simple to understand, and easy to+modify. .SH Usage .PP \f[I]xmonad\f[] places each window into a "workspace". Each workspace can have any number of windows, which you can cycle though with mod-j and mod-k.-Windows are either displayed full screen, tiled horizontally, or-tiled vertically.-You can toggle the layout mode with mod-space, which will cycle-through the available modes.+Windows are either displayed full screen, tiled horizontally, or tiled+vertically.+You can toggle the layout mode with mod-space, which will cycle through+the available modes. .PP You can switch to workspace N with mod-N. For example, to switch to workspace 5, you would press mod-5.-Similarly, you can move the current window to another workspace-with mod-shift-N.+Similarly, you can move the current window to another workspace with+mod-shift-N. .PP-When running with multiple monitors (Xinerama), each screen has-exactly 1 workspace visible.-mod-{w,e,r} switch the focus between screens, while-shift-mod-{w,e,r} move the current window to that screen.-When \f[I]xmonad\f[] starts, workspace 1 is on screen 1, workspace-2 is on screen 2, etc.-When switching workspaces to one that is already visible, the-current and visible workspaces are swapped.+When running with multiple monitors (Xinerama), each screen has exactly+1 workspace visible.+mod-{w,e,r} switch the focus between screens, while shift-mod-{w,e,r}+move the current window to that screen.+When \f[I]xmonad\f[] starts, workspace 1 is on screen 1, workspace 2 is+on screen 2, etc.+When switching workspaces to one that is already visible, the current+and visible workspaces are swapped. .SS Flags .PP xmonad has several flags which you may pass to the executable.@@ -75,10 +74,20 @@ .RS .RE .TP+.B --replace+Replace the current window manager with xmonad+.RS+.RE+.TP .B --version Display version of \f[I]xmonad\f[] .RS .RE+.TP+.B --verbose-version+Display detailed version of \f[I]xmonad\f[]+.RS+.RE .SS Default keyboard bindings .TP .B mod-shift-return@@ -232,8 +241,8 @@ .RE .SH Examples .PP-To use xmonad as your window manager add to your-\f[I]~/.xinitrc\f[] file:+To use xmonad as your window manager add to your \f[I]~/.xinitrc\f[]+file: .IP .nf \f[C]@@ -242,17 +251,16 @@ .fi .SH Customization .PP-xmonad is customized in ~/.xmonad/xmonad.hs, and then restarting-with mod-q.+xmonad is customized in ~/.xmonad/xmonad.hs, and then restarting with+mod-q. .PP You can find many extensions to the core feature set in the xmonad- contrib package, available through your package manager or from xmonad.org (http://xmonad.org). .SS Modular Configuration .PP-As of \f[I]xmonad-0.9\f[], any additional Haskell modules may be-placed in \f[I]~/.xmonad/lib/\f[] are available in GHC\[aq]s-searchpath.+As of \f[I]xmonad-0.9\f[], any additional Haskell modules may be placed+in \f[I]~/.xmonad/lib/\f[] are available in GHC\[aq]s searchpath. Hierarchical modules are supported: for example, the file \f[I]~/.xmonad/lib/XMonad/Stack/MyAdditions.hs\f[] could contain: .IP
man/xmonad.1.html view
@@ -1,384 +1,163 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>- <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" />+ <title></title> </head> <body>-<h1>xmonad-0.9.2</h1><p>Section: xmonad manual (1)<br/>Updated: 21 December 10</p><hr/>-<div id="TOC"-><ul- ><li- ><a href="#name"- >Name</a- ></li- ><li- ><a href="#description"- >Description</a- ></li- ><li- ><a href="#usage"- >Usage</a- ><ul- ><li- ><a href="#flags"- >Flags</a- ></li- ><li- ><a href="#default-keyboard-bindings"- >Default keyboard bindings</a- ></li- ></ul- ></li- ><li- ><a href="#examples"- >Examples</a- ></li- ><li- ><a href="#customization"- >Customization</a- ><ul- ><li- ><a href="#modular-configuration"- >Modular Configuration</a- ></li- ></ul- ></li- ><li- ><a href="#bugs"- >Bugs</a- ></li- ></ul- ></div->-<div id="name"-><h1- ><a href="#TOC"- >Name</a- ></h1- ><p- >xmonad - a tiling window manager</p- ></div-><div id="description"-><h1- ><a href="#TOC"- >Description</a- ></h1- ><p- ><em- >xmonad</em- > is a minimalist tiling window manager for X, written in Haskell. Windows are managed using automatic layout algorithms, which can be dynamically reconfigured. At any time windows are arranged so as to maximize the use of screen real estate. All features of the window manager are accessible purely from the keyboard: a mouse is entirely optional. <em- >xmonad</em- > is configured in Haskell, and custom layout algorithms may be implemented by the user in config files. A principle of <em- >xmonad</em- > is predictability: the user should know in advance precisely the window arrangement that will result from any action.</p- ><p- >By default, <em- >xmonad</em- > provides three layout algorithms: tall, wide and fullscreen. In tall or wide mode, windows are tiled and arranged to prevent overlap and maximize screen use. Sets of windows are grouped together on virtual screens, and each screen retains its own layout, which may be reconfigured dynamically. Multiple physical monitors are supported via Xinerama, allowing simultaneous display of a number of screens.</p- ><p- >By utilizing the expressivity of a modern functional language with a rich static type system, <em- >xmonad</em- > provides a complete, featureful window manager in less than 1200 lines of code, with an emphasis on correctness and robustness. Internal properties of the window manager are checked using a combination of static guarantees provided by the type system, and type-based automated testing. A benefit of this is that the code is simple to understand, and easy to modify.</p- ></div-><div id="usage"-><h1- ><a href="#TOC"- >Usage</a- ></h1- ><p- ><em- >xmonad</em- > places each window into a "workspace". Each workspace can have any number of windows, which you can cycle though with mod-j and mod-k. Windows are either displayed full screen, tiled horizontally, or tiled vertically. You can toggle the layout mode with mod-space, which will cycle through the available modes.</p- ><p- >You can switch to workspace N with mod-N. For example, to switch to workspace 5, you would press mod-5. Similarly, you can move the current window to another workspace with mod-shift-N.</p- ><p- >When running with multiple monitors (Xinerama), each screen has exactly 1 workspace visible. mod-{w,e,r} switch the focus between screens, while shift-mod-{w,e,r} move the current window to that screen. When <em- >xmonad</em- > starts, workspace 1 is on screen 1, workspace 2 is on screen 2, etc. When switching workspaces to one that is already visible, the current and visible workspaces are swapped.</p- ><div id="flags"- ><h2- ><a href="#TOC"- >Flags</a- ></h2- ><p- >xmonad has several flags which you may pass to the executable. These flags are:</p- ><dl- ><dt- >--recompile</dt- ><dd- ><p- >Recompiles your configuration in <em- >~/.xmonad/xmonad.hs</em- ></p- ></dd- ><dt- >--restart</dt- ><dd- ><p- >Causes the currently running <em- >xmonad</em- > process to restart</p- ></dd- ><dt- >--version</dt- ><dd- ><p- >Display version of <em- >xmonad</em- ></p- ></dd- ></dl- ></div- ><div id="default-keyboard-bindings"- ><h2- ><a href="#TOC"- >Default keyboard bindings</a- ></h2- ><dl- ><dt- >mod-shift-return</dt- ><dd- ><p- >Launch terminal</p- ></dd- ><dt- >mod-p</dt- ><dd- ><p- >Launch dmenu</p- ></dd- ><dt- >mod-shift-p</dt- ><dd- ><p- >Launch gmrun</p- ></dd- ><dt- >mod-shift-c</dt- ><dd- ><p- >Close the focused window</p- ></dd- ><dt- >mod-space</dt- ><dd- ><p- >Rotate through the available layout algorithms</p- ></dd- ><dt- >mod-shift-space</dt- ><dd- ><p- >Reset the layouts on the current workspace to default</p- ></dd- ><dt- >mod-n</dt- ><dd- ><p- >Resize viewed windows to the correct size</p- ></dd- ><dt- >mod-tab</dt- ><dd- ><p- >Move focus to the next window</p- ></dd- ><dt- >mod-shift-tab</dt- ><dd- ><p- >Move focus to the previous window</p- ></dd- ><dt- >mod-j</dt- ><dd- ><p- >Move focus to the next window</p- ></dd- ><dt- >mod-k</dt- ><dd- ><p- >Move focus to the previous window</p- ></dd- ><dt- >mod-m</dt- ><dd- ><p- >Move focus to the master window</p- ></dd- ><dt- >mod-return</dt- ><dd- ><p- >Swap the focused window and the master window</p- ></dd- ><dt- >mod-shift-j</dt- ><dd- ><p- >Swap the focused window with the next window</p- ></dd- ><dt- >mod-shift-k</dt- ><dd- ><p- >Swap the focused window with the previous window</p- ></dd- ><dt- >mod-h</dt- ><dd- ><p- >Shrink the master area</p- ></dd- ><dt- >mod-l</dt- ><dd- ><p- >Expand the master area</p- ></dd- ><dt- >mod-t</dt- ><dd- ><p- >Push window back into tiling</p- ></dd- ><dt- >mod-comma</dt- ><dd- ><p- >Increment the number of windows in the master area</p- ></dd- ><dt- >mod-period</dt- ><dd- ><p- >Deincrement the number of windows in the master area</p- ></dd- ><dt- >mod-b</dt- ><dd- ><p- >Toggle the status bar gap</p- ></dd- ><dt- >mod-shift-q</dt- ><dd- ><p- >Quit xmonad</p- ></dd- ><dt- >mod-q</dt- ><dd- ><p- >Restart xmonad</p- ></dd- ><dt- >mod-[1..9]</dt- ><dd- ><p- >Switch to workspace N</p- ></dd- ><dt- >mod-shift-[1..9]</dt- ><dd- ><p- >Move client to workspace N</p- ></dd- ><dt- >mod-{w,e,r}</dt- ><dd- ><p- >Switch to physical/Xinerama screens 1, 2, or 3</p- ></dd- ><dt- >mod-shift-{w,e,r}</dt- ><dd- ><p- >Move client to screen 1, 2, or 3</p- ></dd- ><dt- >mod-button1</dt- ><dd- ><p- >Set the window to floating mode and move by dragging</p- ></dd- ><dt- >mod-button2</dt- ><dd- ><p- >Raise the window to the top of the stack</p- ></dd- ><dt- >mod-button3</dt- ><dd- ><p- >Set the window to floating mode and resize by dragging</p- ></dd- ></dl- ></div- ></div-><div id="examples"-><h1- ><a href="#TOC"- >Examples</a- ></h1- ><p- >To use xmonad as your window manager add to your <em- >~/.xinitrc</em- > file:</p- ><pre class="sourceCode haskell"- ><code- >exec xmonad-</code- ></pre- ></div-><div id="customization"-><h1- ><a href="#TOC"- >Customization</a- ></h1- ><p- >xmonad is customized in ~/.xmonad/xmonad.hs, and then restarting with mod-q.</p- ><p- >You can find many extensions to the core feature set in the xmonad- contrib package, available through your package manager or from <a href="http://xmonad.org"- >xmonad.org</a- >.</p- ><div id="modular-configuration"- ><h2- ><a href="#TOC"- >Modular Configuration</a- ></h2- ><p- >As of <em- >xmonad-0.9</em- >, any additional Haskell modules may be placed in <em- >~/.xmonad/lib/</em- > are available in GHC's searchpath. Hierarchical modules are supported: for example, the file <em- >~/.xmonad/lib/XMonad/Stack/MyAdditions.hs</em- > could contain:</p- ><pre class="sourceCode haskell"- ><code- >module XMonad.Stack.MyAdditions (function1) where+<h1>xmonad-0.10</h1><p>Section: xmonad manual (1)<br/>Updated: 25 October 09</p><hr/>+<div id="TOC">+<ul>+<li><a href="#name">Name</a></li>+<li><a href="#description">Description</a></li>+<li><a href="#usage">Usage</a><ul>+<li><a href="#flags">Flags</a></li>+<li><a href="#default-keyboard-bindings">Default keyboard bindings</a></li>+</ul></li>+<li><a href="#examples">Examples</a></li>+<li><a href="#customization">Customization</a><ul>+<li><a href="#modular-configuration">Modular Configuration</a></li>+</ul></li>+<li><a href="#bugs">Bugs</a></li>+</ul>+</div>+<h1 id="name"><a href="#TOC">Name</a></h1>+<p>xmonad - a tiling window manager</p>+<h1 id="description"><a href="#TOC">Description</a></h1>+<p><em>xmonad</em> is a minimalist tiling window manager for X, written in Haskell. Windows are managed using automatic layout algorithms, which can be dynamically reconfigured. At any time windows are arranged so as to maximize the use of screen real estate. All features of the window manager are accessible purely from the keyboard: a mouse is entirely optional. <em>xmonad</em> is configured in Haskell, and custom layout algorithms may be implemented by the user in config files. A principle of <em>xmonad</em> is predictability: the user should know in advance precisely the window arrangement that will result from any action.</p>+<p>By default, <em>xmonad</em> provides three layout algorithms: tall, wide and fullscreen. In tall or wide mode, windows are tiled and arranged to prevent overlap and maximize screen use. Sets of windows are grouped together on virtual screens, and each screen retains its own layout, which may be reconfigured dynamically. Multiple physical monitors are supported via Xinerama, allowing simultaneous display of a number of screens.</p>+<p>By utilizing the expressivity of a modern functional language with a rich static type system, <em>xmonad</em> provides a complete, featureful window manager in less than 1200 lines of code, with an emphasis on correctness and robustness. Internal properties of the window manager are checked using a combination of static guarantees provided by the type system, and type-based automated testing. A benefit of this is that the code is simple to understand, and easy to modify.</p>+<h1 id="usage"><a href="#TOC">Usage</a></h1>+<p><em>xmonad</em> places each window into a "workspace". Each workspace can have any number of windows, which you can cycle though with mod-j and mod-k. Windows are either displayed full screen, tiled horizontally, or tiled vertically. You can toggle the layout mode with mod-space, which will cycle through the available modes.</p>+<p>You can switch to workspace N with mod-N. For example, to switch to workspace 5, you would press mod-5. Similarly, you can move the current window to another workspace with mod-shift-N.</p>+<p>When running with multiple monitors (Xinerama), each screen has exactly 1 workspace visible. mod-{w,e,r} switch the focus between screens, while shift-mod-{w,e,r} move the current window to that screen. When <em>xmonad</em> starts, workspace 1 is on screen 1, workspace 2 is on screen 2, etc. When switching workspaces to one that is already visible, the current and visible workspaces are swapped.</p>+<h2 id="flags"><a href="#TOC">Flags</a></h2>+<p>xmonad has several flags which you may pass to the executable. These flags are:</p>+<dl>+<dt>--recompile</dt>+<dd><p>Recompiles your configuration in <em>~/.xmonad/xmonad.hs</em></p>+</dd>+<dt>--restart</dt>+<dd><p>Causes the currently running <em>xmonad</em> process to restart</p>+</dd>+<dt>--replace</dt>+<dd><p>Replace the current window manager with xmonad</p>+</dd>+<dt>--version</dt>+<dd><p>Display version of <em>xmonad</em></p>+</dd>+<dt>--verbose-version</dt>+<dd><p>Display detailed version of <em>xmonad</em></p>+</dd>+</dl>+<h2 id="default-keyboard-bindings"><a href="#TOC">Default keyboard bindings</a></h2>+<dl>+<dt>mod-shift-return</dt>+<dd><p>Launch terminal</p>+</dd>+<dt>mod-p</dt>+<dd><p>Launch dmenu</p>+</dd>+<dt>mod-shift-p</dt>+<dd><p>Launch gmrun</p>+</dd>+<dt>mod-shift-c</dt>+<dd><p>Close the focused window</p>+</dd>+<dt>mod-space</dt>+<dd><p>Rotate through the available layout algorithms</p>+</dd>+<dt>mod-shift-space</dt>+<dd><p>Reset the layouts on the current workspace to default</p>+</dd>+<dt>mod-n</dt>+<dd><p>Resize viewed windows to the correct size</p>+</dd>+<dt>mod-tab</dt>+<dd><p>Move focus to the next window</p>+</dd>+<dt>mod-shift-tab</dt>+<dd><p>Move focus to the previous window</p>+</dd>+<dt>mod-j</dt>+<dd><p>Move focus to the next window</p>+</dd>+<dt>mod-k</dt>+<dd><p>Move focus to the previous window</p>+</dd>+<dt>mod-m</dt>+<dd><p>Move focus to the master window</p>+</dd>+<dt>mod-return</dt>+<dd><p>Swap the focused window and the master window</p>+</dd>+<dt>mod-shift-j</dt>+<dd><p>Swap the focused window with the next window</p>+</dd>+<dt>mod-shift-k</dt>+<dd><p>Swap the focused window with the previous window</p>+</dd>+<dt>mod-h</dt>+<dd><p>Shrink the master area</p>+</dd>+<dt>mod-l</dt>+<dd><p>Expand the master area</p>+</dd>+<dt>mod-t</dt>+<dd><p>Push window back into tiling</p>+</dd>+<dt>mod-comma</dt>+<dd><p>Increment the number of windows in the master area</p>+</dd>+<dt>mod-period</dt>+<dd><p>Deincrement the number of windows in the master area</p>+</dd>+<dt>mod-b</dt>+<dd><p>Toggle the status bar gap</p>+</dd>+<dt>mod-shift-q</dt>+<dd><p>Quit xmonad</p>+</dd>+<dt>mod-q</dt>+<dd><p>Restart xmonad</p>+</dd>+<dt>mod-[1..9]</dt>+<dd><p>Switch to workspace N</p>+</dd>+<dt>mod-shift-[1..9]</dt>+<dd><p>Move client to workspace N</p>+</dd>+<dt>mod-{w,e,r}</dt>+<dd><p>Switch to physical/Xinerama screens 1, 2, or 3</p>+</dd>+<dt>mod-shift-{w,e,r}</dt>+<dd><p>Move client to screen 1, 2, or 3</p>+</dd>+<dt>mod-button1</dt>+<dd><p>Set the window to floating mode and move by dragging</p>+</dd>+<dt>mod-button2</dt>+<dd><p>Raise the window to the top of the stack</p>+</dd>+<dt>mod-button3</dt>+<dd><p>Set the window to floating mode and resize by dragging</p>+</dd>+</dl>+<h1 id="examples"><a href="#TOC">Examples</a></h1>+<p>To use xmonad as your window manager add to your <em>~/.xinitrc</em> file:</p>+<pre class="sourceCode haskell"><code>exec xmonad+</code></pre>+<h1 id="customization"><a href="#TOC">Customization</a></h1>+<p>xmonad is customized in ~/.xmonad/xmonad.hs, and then restarting with mod-q.</p>+<p>You can find many extensions to the core feature set in the xmonad- contrib package, available through your package manager or from <a href="http://xmonad.org">xmonad.org</a>.</p>+<h2 id="modular-configuration"><a href="#TOC">Modular Configuration</a></h2>+<p>As of <em>xmonad-0.9</em>, any additional Haskell modules may be placed in <em>~/.xmonad/lib/</em> are available in GHC's searchpath. Hierarchical modules are supported: for example, the file <em>~/.xmonad/lib/XMonad/Stack/MyAdditions.hs</em> could contain:</p>+<pre class="sourceCode haskell"><code>module XMonad.Stack.MyAdditions (function1) where function1 = error "function1: Not implemented yet!"-</code- ></pre- ><p- >Your xmonad.hs may then import XMonad.Stack.MyAdditions as if that module was contained within xmonad or xmonad-contrib.</p- ></div- ></div-><div id="bugs"-><h1- ><a href="#TOC"- >Bugs</a- ></h1- ><p- >Probably. If you find any, please report them to the <a href="http://code.google.com/p/xmonad/issues/list"- >bugtracker</a- ></p- ></div->+</code></pre>+<p>Your xmonad.hs may then import XMonad.Stack.MyAdditions as if that module was contained within xmonad or xmonad-contrib.</p>+<h1 id="bugs"><a href="#TOC">Bugs</a></h1>+<p>Probably. If you find any, please report them to the <a href="http://code.google.com/p/xmonad/issues/list">bugtracker</a></p> </body> </html>
man/xmonad.1.markdown view
@@ -57,8 +57,14 @@ --restart : Causes the currently running _xmonad_ process to restart +--replace+: Replace the current window manager with xmonad+ --version : Display version of _xmonad_++--verbose-version+: Display detailed version of _xmonad_ ##Default keyboard bindings
man/xmonad.hs view
@@ -34,21 +34,6 @@ -- myModMask = mod1Mask --- The mask for the numlock key. Numlock status is "masked" from the--- current modifier status, so the keybindings will work with numlock on or--- off. You may need to change this on some systems.------ You can find the numlock modifier by running "xmodmap" and looking for a--- modifier with Num_Lock bound to it:------ > $ xmodmap | grep Num--- > mod2 Num_Lock (0x4d)------ Set numlockMask = 0 if you don't have a numlock key, or want to treat--- numlock status separately.----myNumlockMask = mod2Mask- -- The default number of workspaces (virtual screens) and their names. -- By default we use numeric strings, but any string may be used as a -- workspace name. The number of workspaces is determined by the length@@ -74,7 +59,7 @@ [ ((modm .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf) -- launch dmenu- , ((modm, xK_p ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")+ , ((modm, xK_p ), spawn "dmenu_run") -- launch gmrun , ((modm .|. shiftMask, xK_p ), spawn "gmrun")@@ -272,7 +257,6 @@ focusFollowsMouse = myFocusFollowsMouse, borderWidth = myBorderWidth, modMask = myModMask,- numlockMask = myNumlockMask, workspaces = myWorkspaces, normalBorderColor = myNormalBorderColor, focusedBorderColor = myFocusedBorderColor,
tests/loc.hs view
@@ -5,9 +5,9 @@ let actual_loc = filter (not.null) $ filter isntcomment $ map (dropWhile (==' ')) $ lines foo loc = length actual_loc- putStrLn $ show loc+ print loc -- uncomment the following to check for mistakes in isntcomment- -- putStr $ unlines $ actual_loc+ -- print actual_loc isntcomment ('-':'-':_) = False isntcomment ('{':'-':_) = False -- pragmas
util/GenerateManpage.hs view
@@ -36,7 +36,7 @@ import Text.Pandoc -- works with 1.6 -releaseDate = "21 December 10"+releaseDate = "18 November 2011" trim :: String -> String trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
xmonad.cabal view
@@ -1,5 +1,5 @@ name: xmonad-version: 0.9.2+version: 0.10 homepage: http://xmonad.org synopsis: A tiling window manager description:@@ -22,7 +22,6 @@ util/GenerateManpage.hs cabal-version: >= 1.2 build-type: Simple-tested-with: GHC == 6.12.3, GHC == 6.10.4, GHC == 7.0.1 data-files: man/xmonad.hs @@ -47,7 +46,8 @@ build-depends: base < 5 && >=3, containers, directory, process, filepath, extensible-exceptions else build-depends: base < 3- build-depends: X11>=1.5.0.0 && < 1.6, mtl, unix+ build-depends: X11>=1.5.0.0 && < 1.6, mtl, unix,+ utf8-string >= 0.3 && < 0.4 if true ghc-options: -funbox-strict-fields -Wall