upgraded to xmonad 0.17

feat/kile-v2
Ricard Illa 2022-02-02 13:35:08 +01:00
parent a3885acc8d
commit b6464fd9dd
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
2 changed files with 52 additions and 34 deletions

View File

@ -54,9 +54,17 @@ let
pamixer = "${pkgs.pamixer}/bin/pamixer";
in {
xsession.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: {
xmonad = self.xmonad_0_17_0;
xmonad-contrib = self.xmonad_0_17_0;
xmonad-extras = self.xmonad-extras_0_17_0;
};
};
extraPackages = haskellPackages: [
haskellPackages.monad-logger
haskellPackages.dbus

View File

@ -32,7 +32,8 @@ import XMonad.Layout.MultiToggle ( Toggle (Toggle) )
import XMonad.Layout.BoringWindows ( focusUp , focusDown )
import XMonad.Layout.Maximize ( maximizeRestore )
import XMonad.Actions.CopyWindow ( kill1 )
import XMonad.Actions.FloatKeys ( keysResizeWindow, keysMoveWindow )
-- import XMonad.Actions.FloatKeys ( keysResizeWindow, keysMoveWindow, ChangeDim )
import XMonad.Actions.FloatKeys
import XMonad.Actions.Navigation2D ( switchLayer , windowGo , windowSwap )
import XMonad.Hooks.ManageHelpers ( doRectFloat )
@ -103,6 +104,7 @@ import XMonad.Operations
, mouseResizeWindow
, mouseMoveWindow
, focus
, D
)
import XMonad.StackSet
@ -295,43 +297,51 @@ wmBinds conf@XConfig {modMask = modm} = M.fromList
doIt = runQuery $ doRectFloat rect
rect = RationalRect 0.05 0.05 0.9 0.9
floatResize = M.fromList
[ ("L", (-n, 0))
, ("R", (n, 0))
, ("D", (0, n))
, ("U", (0, -n))
]
tillingResize = M.fromList
[ ("L", sendMessage Shrink)
, ("R", sendMessage Expand)
, ("D", sendMessage MirrorShrink)
, ("U", sendMessage MirrorExpand)
]
tillingMove = M.fromList
[ ("L", L)
, ("R", R)
, ("D", D)
, ("U", U)
]
incDec = M.fromList
[ ("+", (n,n))
, ("-", (-n,-n))
]
n = 10
resize = M.union lrdu chSize
resize :: M.Map [Char] (X())
resize = M.intersectionWith onFloat flt tilling
where
flt = fmap (\x -> keysResizeWindow x (0,0)) floatResize
lrdu = M.intersectionWith onFloat flt tillingResize
chSize = fmap (g . f) incDec
where
f x = keysResizeWindow x (1%2,1%2)
g x = onFloat x $ return ()
flt :: M.Map [Char] (Window -> X())
flt = M.fromList
[ ("L", keysResizeWindow (-n, 0) (0, 0))
, ("R", keysResizeWindow ( n, 0) (0, 0))
, ("D", keysResizeWindow ( 0, n) (0, 0))
, ("U", keysResizeWindow ( 0, -n) (0, 0))
, ("+", keysResizeWindow ( n, n) (1%2, 1%2))
, ("-", keysResizeWindow (-n, -n) (1%2, 1%2))
]
tilling :: M.Map [Char] (X())
tilling = M.fromList
[ ("L", sendMessage Shrink)
, ("R", sendMessage Expand)
, ("D", sendMessage MirrorShrink)
, ("U", sendMessage MirrorExpand)
, ("+", return ())
, ("-", return ())
]
n = 10
move :: M.Map [Char] (X())
move = M.intersectionWith onFloat flt tilling
where
flt = fmap keysMoveWindow floatResize
tilling = fmap (`windowSwap` False) tillingMove
flt :: M.Map [Char] (Window -> X())
flt = M.fromList
[ ("L", keysMoveWindow (-n, 0))
, ("R", keysMoveWindow ( n, 0))
, ("D", keysMoveWindow ( 0, n))
, ("U", keysMoveWindow ( 0, -n))
]
tilling :: M.Map [Char] (X())
tilling = M.fromList
[ ("L", windowSwap L False)
, ("R", windowSwap R False)
, ("D", windowSwap D False)
, ("U", windowSwap U False)
]
n = 10
onFloat a b = withFocused $ ifFloat a (const b)
where