From bbf6651440eba615d70a41a40046f629332c1037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sat, 6 Sep 2025 20:36:58 +0800 Subject: [PATCH] vanadium/xmonad: refactor opacity rules --- .../vanadium/home/xmonad/xmonad.hs | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index 5028d1f0..043165f1 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -49,19 +49,31 @@ main = , logHook = let + isOneOf :: Eq a => Query a -> [a] -> Query Bool + isOneOf q = fmap or . traverse (q =?) + + isFocused :: Query Bool + isFocused = fmap not isUnfocused + fadeHook = composeOne - [ className ~? "steam" -?> opaque + [ -- easier to paint over stuff + isFloating + <&&> isFocused + <&&> title ~? "Wplace" + -?> transparency 0.5 - -- easier to paint over stuff - , isFloating - <&&> fmap not isUnfocused - <&&> title ~? "Wplace" -?> transparency 0.5 - - , className =? "firefox" -?> opaque + -- matches the second string of the WM_CLASS + , className `isOneOf` + [ "firefox" + , "Signal" + , "steam" + , "discord" + ] + -?> opaque + , isFloating -?> ifM isFocused (transparency 0.04) (transparency 0.08) , isUnfocused -?> transparency 0.02 - , isFloating -?> transparency 0.08 ] in fadeWindowsLogHook fadeHook