From c8dee130a63e72ff590cd89c18b52b3cd159390d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 17 Nov 2025 09:24:26 +0800 Subject: [PATCH 1/4] vanadium/xmonad: add more shift rules --- .../vanadium/home/xmonad/xmonad.hs | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index 898245aa..24195a86 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -87,6 +87,18 @@ 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" + isFirefoxPip :: Query Bool isFirefoxPip = isFirefox <&&> title =? "Picture-in-Picture" @@ -111,6 +123,7 @@ myActivateHook = composeOne [ isDiscord -?> mempty , isEvolution -?> mempty + , isSignal -?> mempty , isSioyek -?> mempty , isFeh -?> mempty , return True -?> doFocus @@ -123,8 +136,9 @@ myManageHook = , isFeh --> customFloating buttomRightFloat , isMinder --> customFloating centeredFloat , isFirefoxPip --> doFloat - , isDiscord --> (doF $ W.shift chatWS) - , isEvolution --> (doF $ W.shift chatWS) + , isDiscord --> doShift chatWS + , isEvolution --> doShift chatWS + , isSignal --> doShift chatWS ] <> composeOne [ isFirefox -?> insertPosition Master Newer @@ -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. From a27f5ffefe61700dbe7235c8ff33f174f9ee7952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 17 Nov 2025 15:35:17 +0800 Subject: [PATCH 2/4] vanadium/xmonad: copy float helper windows everywhere --- nix/configurations/vanadium/home/xmonad/xmonad.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index 24195a86..722046fc 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 @@ -99,8 +100,9 @@ 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" @@ -133,9 +135,9 @@ myManageHook :: ManageHook myManageHook = composeAll [ isNautilusPreviewer --> customFloating centeredFloat - , isFeh --> customFloating buttomRightFloat + , isFeh --> doF copyToAll <> customFloating buttomRightFloat , isMinder --> customFloating centeredFloat - , isFirefoxPip --> doFloat + , isFirefoxPip --> doF copyToAll <> customFloating buttomRightFloat , isDiscord --> doShift chatWS , isEvolution --> doShift chatWS , isSignal --> doShift chatWS From 1409a5e064e2e52f2bb4d069c74ec9eb3dbeaee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 17 Nov 2025 16:29:47 +0800 Subject: [PATCH 3/4] vanadium/xmonad: use composeOne for non overlapping rules --- .../vanadium/home/xmonad/xmonad.hs | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index 722046fc..7f5cf5f7 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -133,17 +133,15 @@ myActivateHook = myManageHook :: ManageHook myManageHook = - composeAll - [ 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 - ] - <> 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 ] From 06c9fe9f1e1c600f3a5a8fa1d92dee67d5953145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 17 Nov 2025 16:38:06 +0800 Subject: [PATCH 4/4] vanadium/xmonad: run hlint --- .../lib/XMonad/Layout/ResizableTile/FixDescription.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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)