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 18a813cd..19153c17 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,4 +1,3 @@ -{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} module XMonad.Layout.ResizableTile.FixDescription @@ -15,12 +14,10 @@ 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) m = - fmap (fmap RTFixDescription) - $ handleMessage l m + handleMessage (RTFixDescription l) = + (fmap . fmap) RTFixDescription . handleMessage l 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 898245aa..7f5cf5f7 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -1,6 +1,7 @@ {-# LANGUAGE NegativeLiterals #-} import XMonad +import XMonad.Actions.CopyWindow import XMonad.Actions.Submap import XMonad.Actions.SwapWorkspaces import XMonad.Hooks.DynamicLog @@ -87,8 +88,21 @@ 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 =? "Picture-in-Picture" +isFirefoxPip = isFirefox <&&> title =? "Incrustation vidéo" isFeh :: Query Bool isFeh = className =? "feh" @@ -111,6 +125,7 @@ myActivateHook = composeOne [ isDiscord -?> mempty , isEvolution -?> mempty + , isSignal -?> mempty , isSioyek -?> mempty , isFeh -?> mempty , return True -?> doFocus @@ -118,16 +133,15 @@ myActivateHook = myManageHook :: ManageHook myManageHook = - 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 + 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 , isKitty -?> insertPosition Below Newer , isNautilus <||> isSioyek -?> insertPosition End Older ] @@ -137,8 +151,11 @@ 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 - , isDiscord --> doShiftAndViewIfMoved chatWS + [ isSpotify --> doShiftAndViewIfMoved multimediaWS + , isYouTube --> doShiftAndViewIfMoved multimediaWS + , isDiscord --> doShiftAndViewIfMoved chatWS + , isWhatsApp --> doShiftAndViewIfMoved chatWS + , isElement --> doShiftAndViewIfMoved chatWS ] -- If the title changes in the background, we don't want to greedy view that workspace.