aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-12-22 11:50:45 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-12-22 11:50:45 +0100
commit80c414ffdec4bfcfb9c583264643176fba2ef3df (patch)
treec22657152a5ab75ae5b5cd3b3c7063f3e7d17805 /XMonad/Util
parentcc96523f7ab3d82572f91816359bc256683568dd (diff)
downloadXMonadContrib-80c414ffdec4bfcfb9c583264643176fba2ef3df.tar.gz
XMonadContrib-80c414ffdec4bfcfb9c583264643176fba2ef3df.tar.xz
XMonadContrib-80c414ffdec4bfcfb9c583264643176fba2ef3df.zip
A few short comments for WorkspaceCompare
darcs-hash:20071222105045-a5988-775e0ca1c62a7f1db386bdb739d4c0aad635862a.gz
Diffstat (limited to 'XMonad/Util')
-rw-r--r--XMonad/Util/WorkspaceCompare.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/XMonad/Util/WorkspaceCompare.hs b/XMonad/Util/WorkspaceCompare.hs
index 93bd597..bba9ebe 100644
--- a/XMonad/Util/WorkspaceCompare.hs
+++ b/XMonad/Util/WorkspaceCompare.hs
@@ -16,11 +16,14 @@ import qualified XMonad.StackSet as S
import Data.List
import Data.Monoid
+-- | Lookup the index of a workspace id in the user's config, return Nothing
+-- if that workspace does not exist in the config.
getWsIndex :: X (WorkspaceId -> Maybe Int)
getWsIndex = do
spaces <- asks (workspaces . config)
return $ flip elemIndex spaces
+-- | A comparison function for WorkspaceId
getWsCompare :: X (WorkspaceId -> WorkspaceId -> Ordering)
getWsCompare = do
wsIndex <- getWsIndex
@@ -31,6 +34,7 @@ getWsCompare = do
f Nothing (Just _) = GT
f (Just x) (Just y) = compare x y
+-- | Sort several workspaces according to the order in getWsCompare
getSortByTag :: X ([WindowSpace] -> [WindowSpace])
getSortByTag = do
cmp <- getWsCompare