mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
Merge pull request #189 from skewerr/master
Added functions to perform actions with the first minimized window.
This commit is contained in:
commit
df88bc62d7
@ -124,10 +124,14 @@
|
||||
changed and you want to re-sort windows into the appropriate
|
||||
sub-layout.
|
||||
|
||||
* `XMonad.Actions.Minimize`
|
||||
|
||||
- Now has `withFirstMinimized` and `withFirstMinimized'` so you can perform
|
||||
actions with both the last and first minimized windows easily.
|
||||
|
||||
* `XMonad.Config.Gnome`
|
||||
|
||||
- Update logout key combination (modm+shift+Q) to work with modern
|
||||
versions of GNOME
|
||||
|
||||
## 0.13 (February 10, 2017)
|
||||
|
||||
|
@ -29,6 +29,8 @@ module XMonad.Actions.Minimize
|
||||
, maximizeWindowAndFocus
|
||||
, withLastMinimized
|
||||
, withLastMinimized'
|
||||
, withFirstMinimized
|
||||
, withFirstMinimized'
|
||||
, withMinimized
|
||||
) where
|
||||
|
||||
@ -85,7 +87,7 @@ modified f = XS.modified $
|
||||
in Minimized { rectMap = newRectMap
|
||||
, minimizedStack = (newWindows L.\\ oldStack)
|
||||
++
|
||||
(newWindows `L.intersect` oldStack)
|
||||
(oldStack `L.intersect` newWindows)
|
||||
}
|
||||
|
||||
|
||||
@ -115,6 +117,16 @@ maximizeWindow = maximizeWindowAndChangeWSet $ const id
|
||||
maximizeWindowAndFocus :: Window -> X ()
|
||||
maximizeWindowAndFocus = maximizeWindowAndChangeWSet W.focusWindow
|
||||
|
||||
-- | Perform an action with first minimized window on current workspace
|
||||
-- or do nothing if there is no minimized windows on current workspace
|
||||
withFirstMinimized :: (Window -> X ()) -> X ()
|
||||
withFirstMinimized action = withFirstMinimized' (flip whenJust action)
|
||||
|
||||
-- | Like withFirstMinimized but the provided action is always invoked with a
|
||||
-- 'Maybe Window', that will be nothing if there is no first minimized window.
|
||||
withFirstMinimized' :: (Maybe Window -> X ()) -> X ()
|
||||
withFirstMinimized' action = withMinimized (action . listToMaybe . reverse)
|
||||
|
||||
-- | Perform an action with last minimized window on current workspace
|
||||
-- or do nothing if there is no minimized windows on current workspace
|
||||
withLastMinimized :: (Window -> X ()) -> X ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user