tv xmonad: no layout changes while focusing floats
This commit is contained in:
parent
1f7fabbd27
commit
7e158f1c53
14
tv/5pkgs/haskell/xmonad-tv/src/XMonad/Extra.hs
Normal file
14
tv/5pkgs/haskell/xmonad-tv/src/XMonad/Extra.hs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module XMonad.Extra where
|
||||||
|
|
||||||
|
import XMonad
|
||||||
|
import qualified Data.Map as Map
|
||||||
|
import qualified XMonad.StackSet as W
|
||||||
|
|
||||||
|
|
||||||
|
isFloating :: Window -> WindowSet -> Bool
|
||||||
|
isFloating w =
|
||||||
|
Map.member w . W.floating
|
||||||
|
|
||||||
|
isFloatingX :: Window -> X Bool
|
||||||
|
isFloatingX w =
|
||||||
|
isFloating w <$> gets windowset
|
@ -7,11 +7,12 @@ module Main (main) where
|
|||||||
import System.Exit (exitFailure)
|
import System.Exit (exitFailure)
|
||||||
|
|
||||||
import Control.Exception
|
import Control.Exception
|
||||||
import Control.Monad.Extra (whenJustM)
|
import Control.Monad.Extra (ifM, whenJustM)
|
||||||
import qualified Data.List
|
import qualified Data.List
|
||||||
import Graphics.X11.ExtraTypes.XF86
|
import Graphics.X11.ExtraTypes.XF86
|
||||||
import Text.Read (readEither)
|
import Text.Read (readEither)
|
||||||
import XMonad
|
import XMonad
|
||||||
|
import XMonad.Extra (isFloatingX)
|
||||||
import System.IO (hPutStrLn, stderr)
|
import System.IO (hPutStrLn, stderr)
|
||||||
import System.Environment (getArgs, getEnv, getEnvironment, lookupEnv)
|
import System.Environment (getArgs, getEnv, getEnvironment, lookupEnv)
|
||||||
import System.Posix.Process (executeFile)
|
import System.Posix.Process (executeFile)
|
||||||
@ -154,8 +155,8 @@ myKeys conf = Map.fromList $
|
|||||||
, ((_S , xK_Menu ), gets windowset >>= allWorkspaceNames >>= pager pagerConfig (windows . W.shift) )
|
, ((_S , xK_Menu ), gets windowset >>= allWorkspaceNames >>= pager pagerConfig (windows . W.shift) )
|
||||||
, ((_C , xK_Menu ), toggleWS)
|
, ((_C , xK_Menu ), toggleWS)
|
||||||
|
|
||||||
, ((_4 , xK_space ), sendMessage NextLayout)
|
, ((_4 , xK_space ), withFocused $ \w -> ifM (isFloatingX w) xdeny $ sendMessage NextLayout)
|
||||||
, ((_4M , xK_space ), resetLayout)
|
, ((_4M , xK_space ), withFocused $ \w -> ifM (isFloatingX w) xdeny $ resetLayout)
|
||||||
|
|
||||||
, ((_4 , xK_m ), windows W.focusMaster)
|
, ((_4 , xK_m ), windows W.focusMaster)
|
||||||
, ((_4 , xK_j ), windows W.focusDown)
|
, ((_4 , xK_j ), windows W.focusDown)
|
||||||
|
Loading…
Reference in New Issue
Block a user