A third border color for the last focused window of a non-active screen

Hi list I have a question regarding the colors of window borders. As far as i can see there are the two values normalBorderColor and focusedBorderColor in the config, which define the focused and not-focused colors of window borders. At my workdesk I have a dual-head setup, so I select the two screens with mod-w and mod-e. Now every time I select the other screen the window of this screen which has been focused when i left the screen gets focused again. So my question is, is there any way how I could choose a third color for the last focused window of a screen which is not selected at the moment. Like for example in the following scenario: - I have 4 windows on each of the two screens - The right screen is selected and its top right window is focused - Now i select the left screen, so the top right window of the right screen gets inactive and the last active window of the left screen gets focused What i would like in this situation is that the top right window of the right screen gets a third border color, so that next time when I switch back to the right screen I can see in advance which of its windows will be focused. Unfortunately my Haskell isn't very good. Is there maybe any easy way how i could achieve that? Thanks, Mauro

On Thu, Jun 21, 2012 at 9:52 PM, Mauro Stettler
Hi list
I have a question regarding the colors of window borders. As far as i can see there are the two values normalBorderColor and focusedBorderColor in the config, which define the focused and not-focused colors of window borders. At my workdesk I have a dual-head setup, so I select the two screens with mod-w and mod-e. Now every time I select the other screen the window of this screen which has been focused when i left the screen gets focused again. So my question is, is there any way how I could choose a third color for the last focused window of a screen which is not selected at the moment.
Hi Mauro, It is possible to set the border colour after xmonad sets it. One example of this already being done in contrib is in X.L.WindowNavigation [1]. The parts to focus on are the definitions/usages of `sc :: Pixel -> Window -> X ()' and stringToPixel. Between those two, you can write a function that sets a border color. Once you have that function, you can set the border colour on the unfocused screen with a logHook. You can get the Window that corresponds to the unfocused screen(s) using: focusOfVisible :: X [Window] focusOfVisible = gets (mapMaybe (fmap W.focus . W.stack . W.workspace) . W.visible . windowset) Then just put the pieces together to write that logHook: setBC :: String -> X () setBC col = do { d <- asks display; px <- stringToPixel d col; ws <- focusOfVisible; mapM_ (sc px) ws } It's quite possible that there are some errors, since I didn't test this code. Even if it does work, it could be improved by keeping track of which windows have the different colour set, for example by storing the list of windows whose borders do get set in XMonad.Util.ExtensibleState. [1] http://xmonad.org/xmonad-docs/xmonad-contrib/src/XMonad-Layout-WindowNavigat... -- Adam
participants (2)
-
adam vogt
-
Mauro Stettler