
Hi all, i've a workspace for pidgin/skype and i wonder if their roster window should avoid focus switching (focusUp and focusDown) letting me to focus only the other windows (chats, options, ...). Is there a way to prevent a window being focused (eg. by classname, role, ...)? thanks to all, ff0000

I think you're looking for XMonad.Layout.BoringWindows
Henrique G. Abreu
On Mon, Feb 1, 2010 at 20:13, Alessandro Massignan
Hi all,
i've a workspace for pidgin/skype and i wonder if their roster window should avoid focus switching (focusUp and focusDown) letting me to focus only the other windows (chats, options, ...). Is there a way to prevent a window being focused (eg. by classname, role, ...)?
thanks to all, ff0000 _______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

* On Monday, February 01 2010, Alessandro Massignan wrote:
Hi all,
i've a workspace for pidgin/skype and i wonder if their roster window should avoid focus switching (focusUp and focusDown) letting me to focus only the other windows (chats, options, ...). Is there a way to prevent a window being focused (eg. by classname, role, ...)?
thanks to all, ff0000
This can be accomplished with XMonad.Layout.BoringWindows [1]. While the module doesn't export functionality to directly set target windows as boring, you can work around that in your config with something like: ] import XMonad ] import qualified XMonad.StackSet as W ] import XMonad.Layout.BoringWindows ] ] -- | Variant of 'markBoring', if 'XMonad.Layout.BoringWindows.IsBoring' ] -- was exported we could write much shorter: ] -- > markBoring' = sendMessage . IsBoring ] markBoring' :: Window -> X () ] markBoring' w = do ] st@XState { windowset = ws } <- get ] env <- ask ] (_,st') <- io $ runX env ] st{ windowset = W.insertUp w ws } ] markBoring ] ] -- this should encourage consideration of some alternative to the built-in ] -- records: all this does is set the current layout in st to the one gotten ] -- from st' ] put $ st{ windowset = ] ws{ W.current = ] (W.current ws){ W.workspace = ] (W.workspace $ W.current ws){ W.layout = ] W.layout $ W.workspace ] $ W.current $ windowset st' ] }}}} ] ] doBoring :: ManageHook ] doBoring = do ] w <- ask ] liftX $ markBoring' w ] idHook Then use doBoring as other ManageHooks. This also requires that you modify your layout and add some keybindings as described in the BoringWindows documentation. However, if you reset your layout (mod-shift-space), then you would have to run that manageHook over all the windows present in your workspace to get your correct behavior back. Ex. you could use the following rerunMH function to run a managehook (the one you defined using doBoring) on all the windows in your current workspace: ] rerunMH :: ManageHook -> X () ] rerunMH mhook = withWindowSet $ mapM_ (runQuery mhook) . W.index This might make sense to run after resetting layouts (mod-shift-space) as this fragment that fits in some keybindings does (for a specific managehook): ] ,((modm .|. shiftMask,xK_space), ] do { setLayout . Layout . layoutHook =<< ask ] ; rerunMH (className =? "foo" --> doBoring) ] } ] ) Hope this helps, -- Adam [1] http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-BoringWindows.htm...

Thanks Henrique and Adam, helps deep in Hask-Hell :-) Ok, i'm still a total newbie and the code snippet looks a bit weird to my eyes, but this encourage me to go on! :-) I'll give a try to BoringWindows and i think i'll succeed, because XMonad is a divine gift and, finally, i come to the definitive WM ;-) Thanks again! ff0000
participants (3)
-
Adam Vogt
-
Alessandro Massignan
-
Henrique G. Abreu