vanadium/xmonad: add more shift rules

This commit is contained in:
Primrose 2025-11-17 09:24:26 +08:00
parent 5f1cea7f25
commit c8dee130a6
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -87,6 +87,18 @@ isFirefox = className =? "firefox"
isSpotify :: Query Bool isSpotify :: Query Bool
isSpotify = isFirefox <&&> title ~? "Spotify" 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 :: Query Bool
isFirefoxPip = isFirefox <&&> title =? "Picture-in-Picture" isFirefoxPip = isFirefox <&&> title =? "Picture-in-Picture"
@ -111,6 +123,7 @@ myActivateHook =
composeOne composeOne
[ isDiscord -?> mempty [ isDiscord -?> mempty
, isEvolution -?> mempty , isEvolution -?> mempty
, isSignal -?> mempty
, isSioyek -?> mempty , isSioyek -?> mempty
, isFeh -?> mempty , isFeh -?> mempty
, return True -?> doFocus , return True -?> doFocus
@ -123,8 +136,9 @@ myManageHook =
, isFeh --> customFloating buttomRightFloat , isFeh --> customFloating buttomRightFloat
, isMinder --> customFloating centeredFloat , isMinder --> customFloating centeredFloat
, isFirefoxPip --> doFloat , isFirefoxPip --> doFloat
, isDiscord --> (doF $ W.shift chatWS) , isDiscord --> doShift chatWS
, isEvolution --> (doF $ W.shift chatWS) , isEvolution --> doShift chatWS
, isSignal --> doShift chatWS
] ]
<> composeOne <> composeOne
[ isFirefox -?> insertPosition Master Newer [ isFirefox -?> insertPosition Master Newer
@ -137,8 +151,11 @@ myEventHandleHook :: Event -> X All
myEventHandleHook = myEventHandleHook =
-- TODO: is there a way to always open certain sites in new windows in firefox? -- TODO: is there a way to always open certain sites in new windows in firefox?
onTitleChange $ composeAll onTitleChange $ composeAll
[ isSpotify --> doShiftAndViewIfMoved multimediaWS [ isSpotify --> doShiftAndViewIfMoved multimediaWS
, isDiscord --> doShiftAndViewIfMoved chatWS , 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. -- If the title changes in the background, we don't want to greedy view that workspace.