module XMonad.Prompt.Layout (
layoutPrompt
) where
import XMonad.Prelude ( sort, nub )
import XMonad hiding ( workspaces )
import XMonad.Prompt
import XMonad.Prompt.Workspace ( Wor(..) )
import XMonad.StackSet ( workspaces, layout )
layoutPrompt :: XPConfig -> X ()
layoutPrompt :: XPConfig -> X ()
layoutPrompt XPConfig
c = do [String]
ls <- forall s (m :: * -> *) a. MonadState s m => (s -> a) -> m a
gets (forall a b. (a -> b) -> [a] -> [b]
map (forall (layout :: * -> *) a.
LayoutClass layout a =>
layout a -> String
description forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i l a. Workspace i l a -> l
layout) forall b c a. (b -> c) -> (a -> b) -> a -> c
. 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)
forall p.
XPrompt p =>
p -> XPConfig -> ComplFunction -> (String -> X ()) -> X ()
mkXPrompt (String -> Wor
Wor String
"") XPConfig
c (XPConfig -> [String] -> ComplFunction
mkComplFunFromList' XPConfig
c forall a b. (a -> b) -> a -> b
$ forall a. Ord a => [a] -> [a]
sort forall a b. (a -> b) -> a -> b
$ forall a. Eq a => [a] -> [a]
nub [String]
ls) (forall a. Message a => a -> X ()
sendMessage forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> JumpToLayout
JumpToLayout)