module XMonad.Prompt.Workspace (
workspacePrompt,
Wor(Wor),
) where
import XMonad hiding ( workspaces )
import XMonad.Prompt
import XMonad.StackSet ( workspaces, tag )
import XMonad.Util.WorkspaceCompare ( getSortByIndex )
newtype Wor = Wor String
instance XPrompt Wor where
showXPrompt :: Wor -> String
showXPrompt (Wor String
x) = String
x
workspacePrompt :: XPConfig -> (String -> X ()) -> X ()
workspacePrompt :: XPConfig -> (String -> X ()) -> X ()
workspacePrompt XPConfig
c String -> X ()
job = do [Workspace String (Layout Window) Window]
ws <- forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a
gets (forall i l a s sd. StackSet i l a s sd -> [Workspace i l a]
workspaces forall b c a. (b -> c) -> (a -> b) -> a -> c
. XState -> WindowSet
windowset)
WorkspaceSort
sort <- X WorkspaceSort
getSortByIndex
let ts :: [String]
ts = forall a b. (a -> b) -> [a] -> [b]
map forall i l a. Workspace i l a -> i
tag forall a b. (a -> b) -> a -> b
$ WorkspaceSort
sort [Workspace String (Layout Window) Window]
ws
forall p.
XPrompt p =>
p -> XPConfig -> ComplFunction -> (String -> X ()) -> X ()
mkXPrompt (String -> Wor
Wor String
"") XPConfig
c (XPConfig -> [String] -> ComplFunction
mkComplFunFromList' XPConfig
c [String]
ts) String -> X ()
job