Commits

Tony Morris committed 26f9207

get rid of categories

  • Participants
  • Parent commits bd9786f

Comments (0)

Files changed (1)

src/XMonad/Config/DescriptiveKeys.hs

 module XMonad.Config.DescriptiveKeys
 (
-  Category(..)
-, Tag(..)
+  Tag(..)
 , Tags
 , Description(..)
 , DescriptiveKey(..)
 import XMonad
 import Data.Bits
 
-newtype Category =
-  Category (Maybe String)
-  deriving (Eq, Ord, Show)
-
 newtype Tag =
   Tag String
   deriving (Eq, Ord, Show)
   , action      :: X ()
   , description :: Description
   , tags        :: Tags
-  , category    :: Category
   }
 
 defaultDescriptiveKey ::
   -> X ()
   -> DescriptiveKey
 defaultDescriptiveKey m s a =
-  DescriptiveKey m s a (Description Nothing) S.empty (Category Nothing)
+  DescriptiveKey m s a (Description Nothing) S.empty
 
 newtype DescriptiveKeys =
   DescriptiveKeys (XConfig Layout -> [DescriptiveKey])
   DescriptiveKeys
 
 wKeys ::
-  (XConfig Layout -> [(String, [(KeyMask, KeySym, X(), String, [String])])])
+  (XConfig Layout -> [(KeyMask, KeySym, X(), String, [String])])
   -> DescriptiveKeys
 wKeys z =
-  descriptiveKeys (\l -> let h = M.fromList (z l)
-                         in do c               <- M.keys h
-                               (m, s, a, d, t) <- h M.! c
-                               return (DescriptiveKey m s a (Description (Just d)) (S.fromList $ map Tag t) (Category (Just c))))
+  descriptiveKeys (fmap (\(m, s, a, d, t) -> DescriptiveKey m s a (Description (Just d)) (S.fromList (fmap Tag t))) . z)
 
 setDescriptiveKeys ::
   DescriptiveKeys
   -> XConfig l
   -> XConfig l
 setDescriptiveKeys k l =
-  let rawKeys (DescriptiveKeys d) = F.foldl' (\p (DescriptiveKey m s a _ _ _) -> M.insert (m, s) a p) M.empty . d
+  let rawKeys (DescriptiveKeys d) = F.foldl' (\p (DescriptiveKey m s a _ _) -> M.insert (m, s) a p) M.empty . d
   in l { keys = rawKeys k }
 
 data DescriptiveKeysPP =
   DescriptiveKeysPP {
     header :: String
-  , categoryPP :: String -> String
   , descriptionPP :: String -> String
   , keyPP :: ButtonMask -> KeySym -> String
   , tagPP :: Tag -> String
   , tagsSep :: String
   , keySep :: String
-  , categorySep :: String
-  , noCategory :: String
   , noDescription :: String
   , footer :: String
   }
 defaultDescriptiveKeysPP =
   DescriptiveKeysPP {
     header = ""
-  , categoryPP = id
   , descriptionPP = id
   , keyPP = \m s -> let pick n str = if n .&. complement m == 0 then str else ""
                         mk = concatMap (++"-") . filter (not . null) . map (uncurry pick) $
   , tagPP = \(Tag s) -> s
   , tagsSep = ","
   , keySep = "\n"
-  , categorySep = "\n\n"
-  , noCategory = "<Uncategorized>"
   , noDescription = "..."
   , footer = ""
   }
+