Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove border from fullscreen floating windows only (XMonad configuration)

I would like to

  1. remove borders (only) from floating windows covering the full screen (like mplayer), and
  2. use a different border color (normalBorderColor) when there is only one window in a workspace.

Currently, I am using smartBorders from XMonad.Layout.NoBorders to remove the border from mplayer, and to remove the border of a window when that window is the only window in a workspace. However, when I switch between two workspaces which both have a single non-floating window (regardless of mode (tall/mirror/full)), then I see the window (in the workspace I am changing into) "jump" a bit, as its border is drawn, and then removed a brief moment thereafter (the effect is more visible if you set your borderWidth to a large number).

The relevant part of my ~/.xmonad/xmonad.hs is given below.

import XMonad.Hooks.ManageDocks
import XMonad.Layout.NoBorders
myLayout = tiled ||| Mirror tiled ||| Full
  where
    tiled   = Tall 1 (3/100) (3/5)                                 
main = xmonad $ defaultConfig 
                 { layoutHook = avoidStruts $ smartBorders $ myLayout 
                 , borderWidth = 4
                 , normalBorderColor  = "#000000" -- black
                 , focusedBorderColor = "#ff3f3f" -- reddish
                 }

Do you folks know how I achieve this effect? (is part 2. even possible?) Suggestions and pointers to extensions and/or existing configurations that achieve a similar effect greatly appreciated.

like image 978
willardthor Avatar asked Nov 21 '12 17:11

willardthor


1 Answers

I solved pt. 1 using the Ambiguity constructor named OnlyFloat from XMonad.Layout.NoBorders.

import XMonad.Hooks.ManageDocks
import XMonad.Layout.NoBorders
myLayout = tiled ||| Mirror tiled ||| Full
  where
    tiled   = Tall 1 (3/100) (3/5)                                 
main = xmonad $ defaultConfig 
                 { layoutHook = lessBorders OnlyFloat $ avoidStruts $ myLayout 
                 , borderWidth = 4
                 , normalBorderColor  = "#000000" -- black
                 , focusedBorderColor = "#ff3f3f" -- reddish
                 }

I haven't addressed pt. 2. Furthermore, when I switch into a workspace, the border color of the focused window "flickers", since initially, the window is not focused (an thus its border is colored as per normalBorderColor), whereafter the window becomes focused (and thus its border gets the color focusedBorderColor).

like image 127
willardthor Avatar answered Oct 23 '22 06:10

willardthor