20 Commits

Author SHA1 Message Date
slotThe
2469269119 New module: XMonad.Prelude
This is a convenience module in order to have less import noise.  It
re-exports the following:

  a) Commonly used modules in full (Data.Foldable, Data.Applicative, and
     so on); though only those that play nicely with each other, so that
     XMonad.Prelude can be imported unqualified without any problems.
     This prevents things like `Prelude.(.)` and `Control.Category.(.)`
     fighting with each other.

  b) Helper functions that don't necessarily fit in any other module;
     e.g., the often used abbreviation `fi = fromIntegral`.
2021-05-13 17:44:47 +02:00
slotThe
6ece010c01 Use reverseS instead of self-defined functions 2021-05-13 17:43:32 +02:00
ivanbrennan
aa3939e66b
XMonad.Layout.BoringWindows: siftUp, siftDown
Provide boring-aware versions of the 'siftUp' and 'siftDown' functions.
Since these actions never affect the position of boring windows, they
work well with layouts that decide which windows are visible/hidden
based on stack position, such as LimitWindows.
2020-09-14 17:37:38 -04:00
ivanbrennan
c2dd9b0b7a
skip boring: extract common iterate/filter logic 2020-09-10 06:40:14 -04:00
ivanbrennan
610fb0e200
skipBoring: drop zeroth iteration before filtering
The effect is the same, but this seems to express the intent more
clearly, and it will make it easier to factor out the shared behavior
with skipBoringSwapUp.
2020-09-10 06:39:50 -04:00
ivanbrennan
53b0edae28
BoringWindows: swapUp, swapDown
Provide boring-aware versions of 'swapUp' and 'swapDown'.

Note that 'iterate f x' produces a list whose zeroth element is
'x' prior to any application of 'f'. The 'focusUp' and 'focusDown'
operations reject this iteration by checking in the filter predicate
that the focus actually changed:

  filter ((`notElem` W.focus st:bs) . W.focus)

We can't do that for swaps, since our focus never changes, so we drop
the zeroth iteration prior to any predicate-based filtering.

The filter predicate checks whether the window immediately below the
our focus is boring. If so, we've performed an uninteresting upwards
swap and should continue swapping until we either swap past a window
that is not boring or wrap around the top of the stack.

It's particularly important that we accept the wrapping case regardless
of any boring neighbor, otherwise we risk missing a legitimate
non-boring swap. Consider, for example, the following stack:

  focus: A
  up: []
  down: [B, boringC]

A swapUp yields:

  focus: A
  up: [boringC, B]
  down: []

This should be considered non-boring, since the non-boring windows
swapped order: A B -> B A. If we were to reject it, we'd swap A up past
boringC and up again past B, putting us back where we started.

Put another way, if our focus was at the top of the stack, then all
other windows were necessarily below it. We want a swapUp to place our
focus below the lowest non-boring window. A wrap around to the bottom of
the stack guarantees that is the case.
2020-09-10 06:39:47 -04:00
Ingolf Wagner
1a3d58143e
XMonad.Layout.BoringWindows: add markBoringEverywhere
to mark the currently focused window boring on all layouts,
when using XMonad.Actions.CopyWindow.
2019-11-21 17:42:01 +13:00
slotThe
f3024e6779 Remove unnecessary imports of Control.Applicative 2019-10-08 10:21:15 +02:00
Daniel Wagner
daa2731d3d eliminate references to defaultConfig 2013-05-28 00:58:25 +00:00
Adam Vogt
129af43738 Note that Simplest works well with BoringWindows 2010-06-22 03:08:50 +00:00
Adam Vogt
9f66ef9975 Clean imports for L.BoringWindows 2009-11-03 14:06:49 +00:00
Adam Vogt
4769530d9f I maintain L.BoringWindows 2009-11-03 14:05:09 +00:00
Wirt Wolff
06a1322366 Docs: use myLayout like template rather than plural
Despite myLayouts currently being more popular in examples, make
them all myLayout as in man/xmonad.hs to avoid mixing them in the
same module as was done a few places, leading to confusion for some users.
2009-10-23 04:26:51 +00:00
Adam Vogt
74a03cd8fb Refer to modm as the current modMask
This makes the config suggestions consistent with the current template.
2009-10-22 04:11:26 +00:00
Jan Vornberger
41a53e7d15 Added focusMaster to BoringWindows 2009-10-15 23:35:18 +00:00
Adam Vogt
0dd1cf1ea8 Document and extend BoringWindows to support multiple sources of boring.
The Replace and Merge messages are added to support layouts sending a list of
windows that should be skipped over. The sources are tagged by a string key, so
it is possible though unlikely for different sources of boring windows to
interfere with eachother.
2009-04-06 04:13:01 +00:00
daniel
04a5f4392e eliminate a haddock warning in BoringWindows 2009-02-21 23:58:36 +00:00
David Roundy
1f2162781f remove myself as maintainer from modules I don't maintain or use. 2008-08-28 15:18:30 +00:00
Devin Mullins
1d93dfba51 fix compile warnings in BoringWindows 2008-05-15 05:17:28 +00:00
David Roundy
60f269f0b3 add BoringWindows module to make certain windows skipped when rotating focus. 2008-05-14 16:28:46 +00:00