From 616335c7f39ea6fad22dc315d0d71d71df214894 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Fri, 23 May 2008 23:39:37 +0200 Subject: made fadeInactiveLogHook take an argument amount to fade darcs-hash:20080523213937-18f27-9792e7d03fb203944e7422ae30cdb2494d7d7ce3.gz --- XMonad/Hooks/FadeInactive.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'XMonad/Hooks/FadeInactive.hs') diff --git a/XMonad/Hooks/FadeInactive.hs b/XMonad/Hooks/FadeInactive.hs index c7fc75e..0ac66ca 100644 --- a/XMonad/Hooks/FadeInactive.hs +++ b/XMonad/Hooks/FadeInactive.hs @@ -29,10 +29,12 @@ import Control.Monad (forM_) -- > import XMonad.Hooks.FadeInactive -- > -- > myLogHook :: X () --- > myLogHook = fadeInactiveLogHook +-- > myLogHook = fadeInactiveLogHook fadeAmount +-- > where fadeAmount = 0xdddddddd -- > -- > main = xmonad defaultConfig { logHook = myLogHook } -- +-- fadeAmount can be any integer -- you will need to have xcompmgr -- or something similar for this to do anything -- @@ -53,9 +55,9 @@ setOpacity w t = withDisplay $ \dpy -> do io $ changeProperty32 dpy w a c propModeReplace [fromIntegral t] -- | --- fades a window out by setting the opacity to an arbitrary amount -fadeOut :: Window -> X () -fadeOut = flip setOpacity 0xdddddddd +-- fades a window out by setting the opacity +fadeOut :: Integer -> Window -> X () +fadeOut amt = flip setOpacity amt -- | -- makes a window completely opaque @@ -63,10 +65,10 @@ fadeIn :: Window -> X () fadeIn = flip setOpacity 0xffffffff -- | --- lowers the opacity of inactive windows -fadeInactiveLogHook :: X () -fadeInactiveLogHook = withWindowSet $ \s -> - forM_ (concatMap visibleWins $ W.current s : W.visible s) fadeOut >> +-- lowers the opacity of inactive windows to the specified amount +fadeInactiveLogHook :: Integer -> X () +fadeInactiveLogHook amt = withWindowSet $ \s -> + forM_ (concatMap visibleWins $ W.current s : W.visible s) (fadeOut amt) >> withFocused fadeIn where visibleWins = maybe [] unfocused . W.stack . W.workspace -- cgit v1.2.3