Compare commits

..

3 commits

Author SHA1 Message Date
36af139254
packages/ruler: update 2025-11-22 13:53:04 +08:00
8e6ce9e5df
vanadium/xmonad: useless refactor
Why not, it's Saturday.
2025-11-22 10:13:02 +08:00
4bb8909218
vanadium/xmonad: make evolution handling smarter
How many window title are there 😭
2025-11-21 23:44:37 +08:00
2 changed files with 18 additions and 8 deletions

View file

@ -86,7 +86,14 @@ isEvolution :: Query Bool
isEvolution = className ~? "gnome.Evolution"
isEvolutionComposer :: Query Bool
isEvolutionComposer = isEvolution <&&> title =? "Compose Message"
isEvolutionComposer =
isEvolution <&&>
(fmap or . sequence)
[ title =? "Compose Message"
, title ^? "Re: " -- reply message composer
, title ^? "Appointment" -- calendar event editor
, title ^? "Meeting" -- calendar event editor
]
isFirefox :: Query Bool
isFirefox = className =? "firefox"
@ -184,13 +191,16 @@ doShiftAndGreedyView n = doF . go =<< ask
where go :: Window -> WindowSet -> WindowSet
go w s = W.greedyView n $ W.shiftWin n w s
hasProp :: (Window -> WindowSet -> Bool) -> Query Bool
hasProp f = f <$> ask <*> (liftX $ gets windowset)
queryWindowSet :: Query WindowSet
queryWindowSet = liftX $ gets windowset
windowIsInCurrentWorkspace :: Query Bool
windowIsInCurrentWorkspace = hasProp $ \w s -> case W.findTag w s of
Just from | from == W.currentTag s -> True
_ -> False
windowIsInCurrentWorkspace = do
w <- ask
s <- queryWindowSet
pure $ case W.findTag w s of
Just from | from == W.currentTag s -> True
_ -> False
myStartupHook :: X ()
myStartupHook = do

View file

@ -11,8 +11,8 @@ let
domain = "git.confusedcompiler.org";
owner = "leana8959";
repo = "ruler";
rev = "00b6c4f1b5d764b049028ba4207ca1dc8ad74f2b";
hash = "sha256-CI9jKcNoFqv4AgQIFFkqafcg2ybs2MN+RaEnuv72Mbc=";
rev = "0cad6d87e2e607b39fe72fc292924c069e661293";
hash = "sha256-AIjGG2FxMiojO1E8jJxBXs9ZaRy3OEAtEp5CwicllRE=";
}) { };
cabalOverrides = o: {