[XMonad] Add goFullscreenDWIM
This commit is contained in:
parent
14162c437e
commit
f09ec7b7db
@ -522,6 +522,13 @@ actOnWindowsInWorkspace :: (Window -> X ())
|
|||||||
actOnWindowsInWorkspace windowAction getWindowsAction = restoreFocus $
|
actOnWindowsInWorkspace windowAction getWindowsAction = restoreFocus $
|
||||||
withWorkspace (getWindowsAction >=> mapM_ windowAction)
|
withWorkspace (getWindowsAction >=> mapM_ windowAction)
|
||||||
|
|
||||||
|
goFullscreenDWIM =
|
||||||
|
withWorkspace $ \ws -> do
|
||||||
|
wins <- windowsWithFocusedClass ws
|
||||||
|
if length wins > 1
|
||||||
|
then goFullscreen
|
||||||
|
else minimizeOtherClassesInWorkspace
|
||||||
|
|
||||||
windowsWithUnfocusedClass ws = windowsWithOtherClasses (W.focus ws) ws
|
windowsWithUnfocusedClass ws = windowsWithOtherClasses (W.focus ws) ws
|
||||||
windowsWithFocusedClass ws = windowsWithSameClass (W.focus ws) ws
|
windowsWithFocusedClass ws = windowsWithSameClass (W.focus ws) ws
|
||||||
windowsWithOtherClasses = windowsMatchingClassPredicate (/=)
|
windowsWithOtherClasses = windowsMatchingClassPredicate (/=)
|
||||||
@ -738,7 +745,7 @@ addKeys conf@XConfig { modMask = modm } =
|
|||||||
, ((modm, xK_g), myGoToWindow)
|
, ((modm, xK_g), myGoToWindow)
|
||||||
, ((modm, xK_b), myBringWindow)
|
, ((modm, xK_b), myBringWindow)
|
||||||
, ((modm .|. shiftMask, xK_b), myReplaceWindow)
|
, ((modm .|. shiftMask, xK_b), myReplaceWindow)
|
||||||
, ((modm .|. controlMask, xK_space), goFullscreen)
|
, ((modm .|. controlMask, xK_space), deactivateFullOr goFullscreenDWIM)
|
||||||
, ((modm, xK_m), withFocused minimizeWindow)
|
, ((modm, xK_m), withFocused minimizeWindow)
|
||||||
, ((modm .|. shiftMask, xK_m),
|
, ((modm .|. shiftMask, xK_m),
|
||||||
deactivateFullOr $ withLastMinimized maximizeWindowAndFocus)
|
deactivateFullOr $ withLastMinimized maximizeWindowAndFocus)
|
||||||
|
Loading…
Reference in New Issue
Block a user