aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authorDaniel Schoepe <daniel.schoepe@gmail.com>2009-11-16 18:10:13 +0100
committerDaniel Schoepe <daniel.schoepe@gmail.com>2009-11-16 18:10:13 +0100
commite8c2239f6fe58b4a9bacd3bfed984841bb860a27 (patch)
tree8647006ee46087129f1ef4249f8f0265a9bca602 /XMonad/Actions
parenta64225bbe26df7d9873ac1d4c8143e3146045b7a (diff)
downloadXMonadContrib-e8c2239f6fe58b4a9bacd3bfed984841bb860a27.tar.gz
XMonadContrib-e8c2239f6fe58b4a9bacd3bfed984841bb860a27.tar.xz
XMonadContrib-e8c2239f6fe58b4a9bacd3bfed984841bb860a27.zip
Changed interface of X.U.ExtensibleState
Ignore-this: 9a830f9341e461628974890bab0bd65b Changed the interface of X.U.ExtensibleState to resemble that of Control.Monad.State and modified the modules that use it accordingly. darcs-hash:20091116171013-7f603-0631dc163d78785b123bc10164ee3295add28b60.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r--XMonad/Actions/SpawnOn.hs6
-rw-r--r--XMonad/Actions/TopicSpace.hs7
2 files changed, 6 insertions, 7 deletions
diff --git a/XMonad/Actions/SpawnOn.hs b/XMonad/Actions/SpawnOn.hs
index bdec270..d7500b2 100644
--- a/XMonad/Actions/SpawnOn.hs
+++ b/XMonad/Actions/SpawnOn.hs
@@ -36,7 +36,7 @@ import qualified XMonad.StackSet as W
import XMonad.Hooks.ManageHelpers
import XMonad.Prompt
import XMonad.Prompt.Shell
-import XMonad.Util.ExtensibleState
+import qualified XMonad.Util.ExtensibleState as XS
-- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
@@ -71,13 +71,13 @@ maxPids = 5
-- | Get the current Spawner or create one if it doesn't exist.
modifySpawner :: ([(ProcessID, ManageHook)] -> [(ProcessID, ManageHook)]) -> X ()
-modifySpawner f = putState . Spawner . f . pidsRef =<< getState
+modifySpawner f = XS.modify (Spawner . f . pidsRef)
-- | Provides a manage hook to react on process spawned with
-- 'spawnOn', 'spawnHere' etc.
manageSpawn :: ManageHook
manageSpawn = do
- Spawner pids <- liftX getState
+ Spawner pids <- liftX XS.get
mp <- pid
case flip lookup pids =<< mp of
Nothing -> idHook
diff --git a/XMonad/Actions/TopicSpace.hs b/XMonad/Actions/TopicSpace.hs
index 78b4e73..de0fb3c 100644
--- a/XMonad/Actions/TopicSpace.hs
+++ b/XMonad/Actions/TopicSpace.hs
@@ -45,7 +45,6 @@ import Data.Maybe (fromMaybe, isNothing, listToMaybe)
import Data.Ord
import qualified Data.Map as M
import Control.Monad ((=<<),liftM2,when,unless,replicateM_)
-import Control.Applicative ((<$>))
import System.IO
import XMonad.Operations
@@ -59,7 +58,7 @@ import XMonad.Hooks.DynamicLog (PP(..))
import qualified XMonad.Hooks.DynamicLog as DL
import XMonad.Util.Run (spawnPipe)
-import XMonad.Util.ExtensibleState
+import qualified XMonad.Util.ExtensibleState as XS
-- $overview
-- This module allows to organize your workspaces on a precise topic basis. So
@@ -222,14 +221,14 @@ instance ExtensionClass PrevTopics where
-- | Returns the list of last focused workspaces the empty list otherwise.
getLastFocusedTopics :: X [String]
-getLastFocusedTopics = getPrevTopics <$> getState
+getLastFocusedTopics = XS.gets getPrevTopics
-- | Given a 'TopicConfig', the last focused topic, and a predicate that will
-- select topics that one want to keep, this function will set the property
-- of last focused topics.
setLastFocusedTopic :: TopicConfig -> Topic -> (Topic -> Bool) -> X ()
setLastFocusedTopic tg w predicate =
- modifyState $ PrevTopics
+ XS.modify $ PrevTopics
. take (maxTopicHistory tg) . nub . (w:) . filter predicate
. getPrevTopics