mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Minor style corrections in X.U.SpawnOnce
This commit is contained in:
parent
da094a635d
commit
e14dcd9aa6
@ -26,14 +26,14 @@ data SpawnOnce = SpawnOnce { unspawnOnce :: (Set String) }
|
|||||||
deriving (Read, Show, Typeable)
|
deriving (Read, Show, Typeable)
|
||||||
|
|
||||||
instance ExtensionClass SpawnOnce where
|
instance ExtensionClass SpawnOnce where
|
||||||
initialValue = SpawnOnce $ Set.empty
|
initialValue = SpawnOnce Set.empty
|
||||||
extensionType = PersistentExtension
|
extensionType = PersistentExtension
|
||||||
|
|
||||||
-- | The first time 'spawnOnce' is executed on a particular command, that
|
-- | The first time 'spawnOnce' is executed on a particular command, that
|
||||||
-- command is executed. Subsequent invocations for a command do nothing.
|
-- command is executed. Subsequent invocations for a command do nothing.
|
||||||
spawnOnce :: String -> X ()
|
spawnOnce :: String -> X ()
|
||||||
spawnOnce xs = do
|
spawnOnce xs = do
|
||||||
b <- fmap (Set.member xs . unspawnOnce) $ getState
|
b <- fmap (Set.member xs . unspawnOnce) getState
|
||||||
when (not b) $ do
|
when (not b) $ do
|
||||||
spawn xs
|
spawn xs
|
||||||
modifyState (SpawnOnce . Set.insert xs . unspawnOnce)
|
modifyState (SpawnOnce . Set.insert xs . unspawnOnce)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user