-- | A 'logHook' that keeps track of the order in which windows have
-- been viewed.
windowHistoryHook :: X ()
windowHistoryHook = do
                  f <- focus' . W.stack . W.workspace . W.current <$> gets windowset
                  case isNothing f of
                       True -> return ()
                       False -> do 
                             return (fromJust f) >>= (XS.modify . makeFirst)

-- | A list of workspace tags in the order they have been viewed, with the
-- most recent first. No duplicates are present, but not all workspaces are
-- guaranteed to appear, and there may be workspaces that no longer exist.
windowHistoryHook :: X ()
windowHistoryHook = do
                  f <- focus' . W.stack . W.workspace . W.current <$> gets windowset
                  case isNothing f of
                       True -> return ()
                       False -> do 
                             return (fromJust f) >>= (XS.modify . makeFirst)

-- | A list of workspace tags in the order they have been viewed, with the
-- most recent first. No duplicates are present, but not all workspaces are
-- guaranteed to appear, and there may be workspaces that no longer exist.
windowHistoryHook = do
                  f <- focus' . W.stack . W.workspace . W.current <$> gets windowset
                  case isNothing f of
                       True -> return ()
                       False -> do 
                             return (fromJust f) >>= (XS.modify . makeFirst)

-- | A list of workspace tags in the order they have been viewed, with the
-- most recent first. No duplicates are present, but not all workspaces are
-- guaranteed to appear, and there may be workspaces that no longer exist.