Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use Xmonad-contrib's Fade Inactive and xcompmgr to make the unfocused windows transparent.

Occasionally, I'd like to have a inactive window fully opaque such as when I'm watching a video.

Does anyone have a strategy for having multiple opaque windows using Fade Inactive?

share|improve this question
add comment

2 Answers 2

I'm working on it. :) If you're running xmonad from darcs, try http://www.ece.cmu.edu/~allbery/FadeWindows.tgz. (Note that one thing you'll be testing is whether it has more dependencies than are included in the tarball; it's still a work in progress.) It requires a recent patch to the xmonad core, which I'm not entirely sure has been applied upstream yet.

This archive should be unpacked in your ~/.xmonad and will place two Haskell source files in ~/.xmonad/lib/XMonad/Hooks. (Feel free to unpack somewhere else and verify before copying them to their correct place.) Documentation is Haddock markup in lib/XMonad/Hooks/FadeWindows.hs. Note especially how to check for the necessary ManageHook patch.

share|improve this answer
1  
By the way, as a quick hack you can bind a key to spawn "xprop -set _NET_WINDOW_OPACITY 4294967295"; when you run it, the cursor will change to crosshairs, click on the window you want to make opaque. You'll generally have to repeat it after focus or workspace changes, which is why it's a hack and not a solution. –  geekosaur Mar 20 '11 at 19:16
    
I ran into some issues compiling MoreManagerHelpers in your packages using the 2011.2.0.0 Haskell Platform –  Zaki Manian Mar 21 '11 at 0:02
    
Pastebin them, and/or visit #xmonad on FreeNode. –  geekosaur Mar 21 '11 at 4:36
add comment
up vote 0 down vote accepted

I figured out a solution with the help of this Xmonad.hs examples

http://code.google.com/p/xmonad/issues/attachmentText?id=393&aid=4341235945524725336&name=xmonad.hs&token=cc0422d6dd7c329bce14d1f4ca93a3db

You can create a list of windows that aren't faded via FadeIf

an examples xmonad.hs would look like this

import XMonad
import XMonad.Hooks.FadeInactive
import Control.Monad (filterM,liftM, join)
import Data.IORef
import Data.List
import qualified Data.Set as S
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig(additionalKeys,removeKeys)

myFadeHook toggleFadeSet = fadeOutLogHook $ fadeIf (testCondition toggleFadeSet) 0.7
doNotFadeOutWindows = title =? "Call with " <||> className =? "xine" <||> className =? "MPlayer"

testCondition :: IORef (S.Set Window) -> Query Bool
testCondition floats =
    liftM not doNotFadeOutWindows <&&> isUnfocused
    <&&> (join . asks $ \w -> liftX . io $ S.notMember w `fmap` readIORef floats)

toggleFadeOut :: Window -> S.Set Window -> S.Set Window
toggleFadeOut w s | w `S.member` s = S.delete w s
                  | otherwise = S.insert w s


main = do
  toggleFadeSet <- newIORef S.empty
  xmonad $ defaultConfig
  {
  logHook = myFadeHook toggleFadeSet
  , modMask = mod4Mask
  } `additionalKeys`
  [
  ((mod4Mask, xK_f), withFocused $ io . modifyIORef toggleFadeSet . toggleFadeOut
  ]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.