mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -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
|
changed and you want to re-sort windows into the appropriate
|
||||||
sub-layout.
|
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`
|
* `XMonad.Config.Gnome`
|
||||||
|
|
||||||
- Update logout key combination (modm+shift+Q) to work with modern
|
- Update logout key combination (modm+shift+Q) to work with modern
|
||||||
versions of GNOME
|
|
||||||
|
|
||||||
## 0.13 (February 10, 2017)
|
## 0.13 (February 10, 2017)
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ module XMonad.Actions.Minimize
|
|||||||
, maximizeWindowAndFocus
|
, maximizeWindowAndFocus
|
||||||
, withLastMinimized
|
, withLastMinimized
|
||||||
, withLastMinimized'
|
, withLastMinimized'
|
||||||
|
, withFirstMinimized
|
||||||
|
, withFirstMinimized'
|
||||||
, withMinimized
|
, withMinimized
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@ -85,7 +87,7 @@ modified f = XS.modified $
|
|||||||
in Minimized { rectMap = newRectMap
|
in Minimized { rectMap = newRectMap
|
||||||
, minimizedStack = (newWindows L.\\ oldStack)
|
, minimizedStack = (newWindows L.\\ oldStack)
|
||||||
++
|
++
|
||||||
(newWindows `L.intersect` oldStack)
|
(oldStack `L.intersect` newWindows)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -115,6 +117,16 @@ maximizeWindow = maximizeWindowAndChangeWSet $ const id
|
|||||||
maximizeWindowAndFocus :: Window -> X ()
|
maximizeWindowAndFocus :: Window -> X ()
|
||||||
maximizeWindowAndFocus = maximizeWindowAndChangeWSet W.focusWindow
|
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
|
-- | Perform an action with last minimized window on current workspace
|
||||||
-- or do nothing if there is no minimized windows on current workspace
|
-- or do nothing if there is no minimized windows on current workspace
|
||||||
withLastMinimized :: (Window -> X ()) -> X ()
|
withLastMinimized :: (Window -> X ()) -> X ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user