diff --git a/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/ResizableTile/FixDescription.hs b/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/ResizableTile/FixDescription.hs index 19153c17..18a813cd 100644 --- a/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/ResizableTile/FixDescription.hs +++ b/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/ResizableTile/FixDescription.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} module XMonad.Layout.ResizableTile.FixDescription @@ -14,10 +15,12 @@ newtype RTFixDescription a = RTFixDescription { unwrapRT :: ResizableTall a } instance LayoutClass RTFixDescription a where runLayout (W.Workspace t l s) = let ws' = W.Workspace t (unwrapRT l) s - in (fmap . fmap . fmap) RTFixDescription . runLayout ws' + in fmap (fmap (fmap RTFixDescription)) + . runLayout ws' - handleMessage (RTFixDescription l) = - (fmap . fmap) RTFixDescription . handleMessage l + handleMessage (RTFixDescription l) m = + fmap (fmap RTFixDescription) + $ handleMessage l m description (RTFixDescription l) = description l <> " " <> show (_nmaster l) diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index 7f5cf5f7..898245aa 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -1,7 +1,6 @@ {-# LANGUAGE NegativeLiterals #-} import XMonad -import XMonad.Actions.CopyWindow import XMonad.Actions.Submap import XMonad.Actions.SwapWorkspaces import XMonad.Hooks.DynamicLog @@ -88,21 +87,8 @@ isFirefox = className =? "firefox" isSpotify :: Query Bool isSpotify = isFirefox <&&> title ~? "Spotify" -isYouTube :: Query Bool -isYouTube = isFirefox <&&> title ~? "YouTube" - -isWhatsApp :: Query Bool -isWhatsApp = isFirefox <&&> title ~? "WhatsApp" - -isSignal :: Query Bool -isSignal = className =? "Signal" - -isElement :: Query Bool -isElement = isFirefox <&&> title ~? "Element" - --- This changes depending on the locale of the browser :/ isFirefoxPip :: Query Bool -isFirefoxPip = isFirefox <&&> title =? "Incrustation vidéo" +isFirefoxPip = isFirefox <&&> title =? "Picture-in-Picture" isFeh :: Query Bool isFeh = className =? "feh" @@ -125,7 +111,6 @@ myActivateHook = composeOne [ isDiscord -?> mempty , isEvolution -?> mempty - , isSignal -?> mempty , isSioyek -?> mempty , isFeh -?> mempty , return True -?> doFocus @@ -133,15 +118,16 @@ myActivateHook = myManageHook :: ManageHook myManageHook = - composeOne - [ isNautilusPreviewer -?> customFloating centeredFloat - , isFeh -?> doF copyToAll <> customFloating buttomRightFloat - , isMinder -?> customFloating centeredFloat - , isFirefoxPip -?> doF copyToAll <> customFloating buttomRightFloat - , isDiscord -?> doShift chatWS - , isEvolution -?> doShift chatWS - , isSignal -?> doShift chatWS - , isFirefox -?> insertPosition Master Newer + composeAll + [ isNautilusPreviewer --> customFloating centeredFloat + , isFeh --> customFloating buttomRightFloat + , isMinder --> customFloating centeredFloat + , isFirefoxPip --> doFloat + , isDiscord --> (doF $ W.shift chatWS) + , isEvolution --> (doF $ W.shift chatWS) + ] + <> composeOne + [ isFirefox -?> insertPosition Master Newer , isKitty -?> insertPosition Below Newer , isNautilus <||> isSioyek -?> insertPosition End Older ] @@ -151,11 +137,8 @@ myEventHandleHook :: Event -> X All myEventHandleHook = -- TODO: is there a way to always open certain sites in new windows in firefox? onTitleChange $ composeAll - [ isSpotify --> doShiftAndViewIfMoved multimediaWS - , isYouTube --> doShiftAndViewIfMoved multimediaWS - , isDiscord --> doShiftAndViewIfMoved chatWS - , isWhatsApp --> doShiftAndViewIfMoved chatWS - , isElement --> doShiftAndViewIfMoved chatWS + [ isSpotify --> doShiftAndViewIfMoved multimediaWS + , isDiscord --> doShiftAndViewIfMoved chatWS ] -- If the title changes in the background, we don't want to greedy view that workspace.