mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Add workspaceHistoryModify
This commit is contained in:
parent
ae6c658bc4
commit
3e7df4911a
@ -25,6 +25,7 @@ module XMonad.Hooks.WorkspaceHistory (
|
|||||||
, workspaceHistoryWithScreen
|
, workspaceHistoryWithScreen
|
||||||
-- * Handling edits
|
-- * Handling edits
|
||||||
, workspaceHistoryTransaction
|
, workspaceHistoryTransaction
|
||||||
|
, workspaceHistoryModify
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
@ -101,3 +102,7 @@ updateLastActiveOnEachScreen StackSet {current = cur, visible = vis} wh =
|
|||||||
let newEntry = (sid, wid)
|
let newEntry = (sid, wid)
|
||||||
alreadyCurrent = maybe False (== newEntry) $ firstOnScreen sid curr
|
alreadyCurrent = maybe False (== newEntry) $ firstOnScreen sid curr
|
||||||
in if alreadyCurrent then curr else newEntry:delete newEntry curr
|
in if alreadyCurrent then curr else newEntry:delete newEntry curr
|
||||||
|
|
||||||
|
-- | Modify a the workspace history with a given pure function.
|
||||||
|
workspaceHistoryModify :: ([(ScreenId, WorkspaceId)] -> [(ScreenId, WorkspaceId)]) -> X ()
|
||||||
|
workspaceHistoryModify action = XS.modify $ WorkspaceHistory . action . history
|
||||||
|
Loading…
x
Reference in New Issue
Block a user