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"; pamixer = "${pkgs.pamixer}/bin/pamixer";
in { in {
xsession.windowManager.xmonad = { xsession.windowManager.xmonad = {
enable = true; enable = true;
enableContribAndExtras = 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: [ extraPackages = haskellPackages: [
haskellPackages.monad-logger haskellPackages.monad-logger
haskellPackages.dbus haskellPackages.dbus

View File

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