aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions/TopicSpace.hs
diff options
context:
space:
mode:
authorNicolas Pouillard <nicolas.pouillard@gmail.com>2010-05-20 09:28:44 +0200
committerNicolas Pouillard <nicolas.pouillard@gmail.com>2010-05-20 09:28:44 +0200
commit8e244d61031ac0833cefdfe5879db34b5478bdc4 (patch)
tree68308babc92f5d7e394b25b8d5d0fb63bd3f6c86 /XMonad/Actions/TopicSpace.hs
parent561ff5d92301981237db5c245b99f4fd9632f257 (diff)
downloadXMonadContrib-8e244d61031ac0833cefdfe5879db34b5478bdc4.tar.gz
XMonadContrib-8e244d61031ac0833cefdfe5879db34b5478bdc4.tar.xz
XMonadContrib-8e244d61031ac0833cefdfe5879db34b5478bdc4.zip
TopicSpace: +reverseLastFocusedTopics
Ignore-this: 97c860fb139269cd592beab275f78d57 darcs-hash:20100520072844-eb2e9-5f78879484684e406ab4d3502fe65f2bd0d36e4a.gz
Diffstat (limited to 'XMonad/Actions/TopicSpace.hs')
-rw-r--r--XMonad/Actions/TopicSpace.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/XMonad/Actions/TopicSpace.hs b/XMonad/Actions/TopicSpace.hs
index 46b6c21..d081439 100644
--- a/XMonad/Actions/TopicSpace.hs
+++ b/XMonad/Actions/TopicSpace.hs
@@ -25,6 +25,7 @@ module XMonad.Actions.TopicSpace
, defaultTopicConfig
, getLastFocusedTopics
, setLastFocusedTopic
+ , reverseLastFocusedTopics
, pprWindowSet
, topicActionWithPrompt
, topicAction
@@ -232,6 +233,11 @@ setLastFocusedTopic w predicate =
. getPrevTopics
where seqList xs = length xs `seq` xs
+-- | Reverse the list of "last focused topics"
+reverseLastFocusedTopics :: X ()
+reverseLastFocusedTopics =
+ XS.modify $ PrevTopics . reverse . getPrevTopics
+
-- | This function is a variant of 'DL.pprWindowSet' which takes a topic configuration
-- and a pretty-printing record 'PP'. It will show the list of topics sorted historically
-- and highlighting topics with urgent windows.
@@ -271,7 +277,7 @@ switchTopic tg topic = do
when (null wins) $ topicAction tg topic
-- | Switch to the Nth last focused topic or failback to the 'defaultTopic'.
-switchNthLastFocused ::TopicConfig -> Int -> X ()
+switchNthLastFocused :: TopicConfig -> Int -> X ()
switchNthLastFocused tg depth = do
lastWs <- getLastFocusedTopics
switchTopic tg $ (lastWs ++ repeat (defaultTopic tg)) !! depth