diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-09-17 23:33:29 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-09-17 23:33:29 +0200 |
commit | 1436b9a90835ec2abfee0ff0df8949ea84fc4b98 (patch) | |
tree | edcd050e3b3a702a8724c3a77998acbdc6bde7b9 | |
parent | 7163db0ed96d0bb4d7455766bfe42ac473d8cf1c (diff) | |
download | XMonadContrib-1436b9a90835ec2abfee0ff0df8949ea84fc4b98.tar.gz XMonadContrib-1436b9a90835ec2abfee0ff0df8949ea84fc4b98.tar.xz XMonadContrib-1436b9a90835ec2abfee0ff0df8949ea84fc4b98.zip |
Match 'Remove Operations functions which have StackSet equivalents' from the core
darcs-hash:20070917213329-a5988-b9cc2ae3e1c8740eecb9300a4b92a2dcd9c81aa1.gz
-rw-r--r-- | Commands.hs | 15 | ||||
-rw-r--r-- | CycleWS.hs | 4 | ||||
-rw-r--r-- | DynamicWorkspaces.hs | 7 | ||||
-rw-r--r-- | FindEmptyWorkspace.hs | 6 | ||||
-rw-r--r-- | RotView.hs | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/Commands.hs b/Commands.hs index 1b7cac8..524eadc 100644 --- a/Commands.hs +++ b/Commands.hs @@ -27,6 +27,7 @@ module XMonadContrib.Commands ( import XMonad import Operations +import StackSet hiding (sink) import XMonadContrib.Dmenu (dmenu) import {-# SOURCE #-} Config (workspaces) @@ -63,13 +64,13 @@ commandMap :: [(String, X ())] -> M.Map String (X ()) commandMap c = M.fromList c workspaceCommands :: [(String, X ())] -workspaceCommands = [((m ++ show i), f i) +workspaceCommands = [((m ++ show i), windows $ f i) | i <- workspaces , (f, m) <- [(view, "view"), (shift, "shift")] ] screenCommands :: [(String, X ())] -screenCommands = [((m ++ show sc), screenWorkspace (fromIntegral sc) >>= flip whenJust f) +screenCommands = [((m ++ show sc), screenWorkspace (fromIntegral sc) >>= flip whenJust (windows . f)) | sc <- [0, 1]::[Int] -- TODO: adapt to screen changes , (f, m) <- [(view, "screen"), (shift, "screen-to-")] ] @@ -85,11 +86,11 @@ defaultCommands = workspaceCommands ++ screenCommands , ("run", spawn "exe=`dmenu_path | dmenu -b` && exec $exe") , ("kill", kill) , ("refresh", refresh) - , ("focus-up", focusUp) - , ("focus-down", focusDown) - , ("swap-up", swapUp) - , ("swap-down", swapDown) - , ("swap-master", swapMaster) + , ("focus-up", windows $ focusUp) + , ("focus-down", windows $ focusDown) + , ("swap-up", windows $ swapUp) + , ("swap-down", windows $ swapDown) + , ("swap-master", windows $ swapMaster) , ("sink", withFocused sink) , ("quit-wm", io $ exitWith ExitSuccess) ] @@ -36,8 +36,8 @@ import Data.List -- > , ((modMask , xK_period), nextWS ) nextWS, prevWS :: X () -nextWS = withWindowSet $ \s -> view (workspaces !! (setWS s N)) -prevWS = withWindowSet $ \s -> view (workspaces !! (setWS s P)) +nextWS = withWindowSet $ \s -> windows $ W.view (workspaces !! (setWS s N)) +prevWS = withWindowSet $ \s -> windows $ W.view (workspaces !! (setWS s P)) data Dir = P | N deriving Eq setWS :: WindowSet -> Dir -> Int diff --git a/DynamicWorkspaces.hs b/DynamicWorkspaces.hs index 8decab1..6cb5ba3 100644 --- a/DynamicWorkspaces.hs +++ b/DynamicWorkspaces.hs @@ -22,9 +22,8 @@ module XMonadContrib.DynamicWorkspaces ( import Control.Monad.State ( gets, modify ) import XMonad ( X, XState(..), Layout, WorkspaceId, trace ) -import Operations ( windows, view ) -import StackSet ( tagMember, StackSet(..), Screen(..), Workspace(..), - integrate, differentiate ) +import Operations +import StackSet hiding (filter, modify, delete) import Data.Map ( delete, insert ) import Graphics.X11.Xlib ( Window ) @@ -51,7 +50,7 @@ removeWorkspace = do s <- gets windowset case s of StackSet { current = Screen { workspace = torem } , hidden = (w:_) } - -> do view $ tag w + -> do windows $ view (tag w) modify $ \st -> st { layouts = delete (tag torem) $ layouts st } windows (removeWorkspace' (tag torem)) _ -> return () diff --git a/FindEmptyWorkspace.hs b/FindEmptyWorkspace.hs index 7ffe664..4eced8c 100644 --- a/FindEmptyWorkspace.hs +++ b/FindEmptyWorkspace.hs @@ -25,7 +25,7 @@ import Data.Maybe ( isNothing ) import XMonad import StackSet -import qualified Operations as O +import Operations -- $usage -- @@ -64,9 +64,9 @@ withEmptyWorkspace f = do -- | Find and view an empty workspace. Do nothing if all workspaces are -- in use. viewEmptyWorkspace :: X () -viewEmptyWorkspace = withEmptyWorkspace O.view +viewEmptyWorkspace = withEmptyWorkspace (windows . view) -- | Tag current window to an empty workspace and view it. Do nothing if -- all workspaces are in use. tagToEmptyWorkspace :: X () -tagToEmptyWorkspace = withEmptyWorkspace $ \w -> O.shift w >> O.view w +tagToEmptyWorkspace = withEmptyWorkspace $ \w -> windows $ view w . shift w @@ -25,7 +25,7 @@ import Data.Ord ( comparing ) import XMonad import StackSet hiding (filter) -import qualified Operations as O +import Operations -- $usage -- You can use this module with the following in your Config.hs file: @@ -46,4 +46,4 @@ rotView b = do sortWs = sortBy (comparing tag) pivoted = uncurry (flip (++)) . span ((< m) . tag) . sortWs . hidden $ ws nextws = listToMaybe . filter (isJust . stack) . (if b then id else reverse) $ pivoted - whenJust nextws (O.view . tag) + whenJust nextws (windows . view . tag) |