mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-29 11:11:52 -07:00
fix selectWorkspace to work with new config.
This commit is contained in:
@@ -21,10 +21,11 @@ module XMonad.Actions.DynamicWorkspaces (
|
|||||||
toNthWorkspace, withNthWorkspace
|
toNthWorkspace, withNthWorkspace
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Control.Monad.Reader ( asks )
|
||||||
import Control.Monad.State ( gets )
|
import Control.Monad.State ( gets )
|
||||||
import Data.List ( sort )
|
import Data.List ( sort )
|
||||||
|
|
||||||
import XMonad ( X, XState(..), Layout, WorkspaceId, WindowSet )
|
import XMonad ( X, XState(..), Layout, WorkspaceId, WindowSet, config, layoutHook )
|
||||||
import XMonad.Operations
|
import XMonad.Operations
|
||||||
import XMonad.StackSet hiding (filter, modify, delete)
|
import XMonad.StackSet hiding (filter, modify, delete)
|
||||||
import Graphics.X11.Xlib ( Window )
|
import Graphics.X11.Xlib ( Window )
|
||||||
@@ -36,7 +37,7 @@ import XMonad.Prompt ( XPConfig )
|
|||||||
--
|
--
|
||||||
-- > import XMonad.Actions.DynamicWorkspaces
|
-- > import XMonad.Actions.DynamicWorkspaces
|
||||||
--
|
--
|
||||||
-- > , ((modMask .|. shiftMask, xK_n), selectWorkspace defaultXPConfig layoutHook)
|
-- > , ((modMask .|. shiftMask, xK_n), selectWorkspace defaultXPConfig)
|
||||||
-- > , ((modMask .|. shiftMask, xK_BackSpace), removeWorkspace)
|
-- > , ((modMask .|. shiftMask, xK_BackSpace), removeWorkspace)
|
||||||
-- > , ((modMask .|. shiftMask .|. controlMask, xK_r), renameWorkspace defaultXPConfig)
|
-- > , ((modMask .|. shiftMask .|. controlMask, xK_r), renameWorkspace defaultXPConfig)
|
||||||
--
|
--
|
||||||
@@ -69,8 +70,9 @@ withNthWorkspace job wnum = do ws <- gets (sort . map tag . workspaces . windows
|
|||||||
(w:_) -> windows $ job w
|
(w:_) -> windows $ job w
|
||||||
[] -> return ()
|
[] -> return ()
|
||||||
|
|
||||||
selectWorkspace :: XPConfig -> Layout Window -> X ()
|
selectWorkspace :: XPConfig -> X ()
|
||||||
selectWorkspace conf l = workspacePrompt conf $ \w ->
|
selectWorkspace conf = workspacePrompt conf $ \w ->
|
||||||
|
do l <- asks (layoutHook . config)
|
||||||
windows $ \s -> if tagMember w s
|
windows $ \s -> if tagMember w s
|
||||||
then greedyView w s
|
then greedyView w s
|
||||||
else addWorkspace' w l s
|
else addWorkspace' w l s
|
||||||
|
Reference in New Issue
Block a user