0

I'm new to XMonad. I'd like to have 1px borders for all windows (so I can tell which one is active), except for the browser. In a conventional window manager, I typically have one maximized web browser window in a designated workspace. I'm very used to bringing the mouse cursor all the way to the top edge of the screen to select browser tabs. But if I have 1px border around the browser window, if I slide the mouse all the way to the top it ends up over this border pixel and cannot select the tabs.

Is there a way to define different rules for specific windows regarding border width, or any other such properties?

Alternatively, is there a way to not have a border around any window, if it's the only one on the workspace?

SU3
  • 5,064
  • 3
  • 35
  • 66

1 Answers1

0

Yes, all of it is possible.

Import xmonad-contrib's NoBorders Layout Extension using

import XMonad.Layout.NoBorders

Then, in your manageHook you can use hasBorder with conditions like checking the program's className (you may want to use XOrg's Property displayer xprop to find out your browser's actual className)

className =? "firefox" --> hasBorder False

Alternatively, you can launch your browser within a given layout and modify that layout in your layoutHook definition to not show borders at all using noBorders, or to remove them only in given one-window or fullsize-floating scenarios using smartBorders

noBorders Full ||| smartBorders Tall ||| ...
pmf
  • 24,478
  • 2
  • 22
  • 31
  • Does `className =? "firefox" --> hasBorder False` alone solve the problem? I tried but it didn't work. When I read the source code, I find the `hasBorder` function only broadcast the `HasBorder` message---some code should handle the message and do set the border as 0 width. I assume I need to have `noBorders` or `smartBorders` or `lessBorders` to handle the message. Is this correct? – Xiaokui Shu Oct 26 '21 at 02:21
  • 1
    Yes, you need to modify your layout with one of those. Any will do but you would hardly see the effect with `noBorders` as then all other windows would lose their borders too. – pmf Oct 29 '21 at 09:01