Commit Graph

3289 Commits

Author SHA1 Message Date
ivanbrennan
8fe0eabaf8 add tests/RotateSome.hs to extra-source-files 2020-09-19 14:05:49 -04:00
Brent Yorgey
010cd4ff5f Merge pull request #382 from ivanbrennan/boring-sift
BoringWindows: siftUp, siftDown
2020-09-19 11:12:25 -05:00
ivanbrennan
957f4518b9 surfaceNext, surfacePrev exclude floating windows
I was naively passing the workspace to runLayout without filtering out
floating windows from its stack, like XMonad.Operations.windows does.
The fact that 'windows' does this filtering explains how layouts like
those in LimitWindows continue to behave correctly in the presence of
floating windows.

This fixes some incorrect behavior where the presence of a floating
windows caused visible windows (other than the focused one) to be
included in the surfaceRing.
2020-09-19 11:29:30 -04:00
Tom Smeets
4b65f9eef0 TreeSelect: Resolve issue #362 with origin offset being ignored
The config values `ts_originX` and `ts_originY` were not behaving like documented. They weren't doing anything at all.
This should fix that.
2020-09-18 21:31:10 +02:00
ivanbrennan
e88e7ee1f0 CHANGES: add XMonad.Actions.RotateSome 2020-09-18 12:03:45 -04:00
ivanbrennan
c5745b6299 add RotateSome property tests
Verify that rotateSome behaves as expected and never fails to pattern
match.

In order to run these tests, I ran a custom script:

  scripts/run-tests.sh tests/RotateSome.hs

where the script contained the following:

  set -eu

  toplevel=$(git rev-parse --show-toplevel)
  XMONAD="${XMONAD:-$toplevel/../xmonad}"
  main=$(realpath -e "$1")

  instances_target="$XMONAD/tests/Instances.hs"
  instances_symlink="$toplevel/tests/Instances.hs"

  properties_target="$XMONAD/tests/Properties"
  properties_symlink="$toplevel/tests/Properties"

  utils_target="$XMONAD/tests/Utils.hs"
  utils_symlink="$toplevel/tests/Utils.hs"

  trap "
      rm '$instances_symlink' '$utils_symlink' '$properties_symlink' || true
  " EXIT INT QUIT TERM

  ln -s "$instances_target" "$instances_symlink"
  ln -s "$properties_target" "$properties_symlink"
  ln -s "$utils_target" "$utils_symlink"

  runghc -DTESTING \
      -i"$toplevel" \
      -i"$toplevel/tests" \
      "$main"
2020-09-18 11:31:50 -04:00
ivanbrennan
f06ee5e1ff add XMonad.Actions.RotateSome
This module provides a pure function, 'rotateSome', as well as a pair of
X actions that use it to rotate unshown windows through the focused
stack position while leaving other windows in place. I find this useful
in combination with layouts such as LimitWindows, which determine window
visibility based on stack position.
2020-09-17 22:51:16 -04:00
ivanbrennan
db3e5d85b5 CHANGES: additions to XMonad.Layout.BoringWindows 2020-09-14 17:56:41 -04: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
Brent Yorgey
fe027ce358 Merge pull request #380 from ivanbrennan/sift
XMonad.Actions.Sift
2020-09-14 14:00:50 -05:00
Brent Yorgey
3661471377 Merge pull request #378 from ivanbrennan/boring-swaps
BoringWindows: swapUp, swapDown
2020-09-14 13:50:33 -05:00
ivanbrennan
33ad9e526d CHANGES: add XMonad.Actions.Sift 2020-09-12 13:49:35 -04:00
ivanbrennan
e2fa1ce8a1 add XMonad.Actions.Sift (siftUp, siftDown)
Provide swap-like functions that handle the wrapping case by exchanging
the windows at either end of the stack rather than rotating the stack.

https://github.com/xmonad/xmonad/issues/234
2020-09-12 09:35:35 -04:00
ivanbrennan
f94984c141 CHANGES: additions to XMonad.Layout.BoringWindows 2020-09-10 07:38:11 -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
Brent Yorgey
58feba91d9 Merge pull request #375 from ivanbrennan/minimize-export
Minimize: export type constructor
2020-08-30 14:04:47 -05:00
ivanbrennan
6e162280b9 CHANGES: XMonad.Layout.Minimize export Minimize 2020-08-30 14:58:34 -04:00
ivanbrennan
1c97ca63c3 export Minimize type constructor
Some users like to include type signatures in their configuration. The
Minimize type constructor was not exported, making it impossible to
write a type signature when using minimize.

With this change, a user can write an xmonad.hs like:

  import XMonad
  import XMonad.Layout.Minimize (Minimize, minimize)
  import XMonad.Layout.LayoutModifier

  myLayout :: ModifiedLayout
              Minimize
              (Choose Tall (Choose (Mirror Tall) Full))
              Window
  myLayout = minimize $ layoutHook def

  main :: IO ()
  main = xmonad def { layoutHook = myLayout }
2020-08-30 14:54:39 -04:00
Brent Yorgey
2ad0c04447 Merge pull request #373 from TheMC47/xmobarBorder
Added xmobarBorder utility function to add borders to strings
2020-08-29 15:31:51 -05:00
Yecine Megdiche
40b939f7a6 typo 2020-08-29 20:26:49 +02:00
Yecine Megdiche
ab04e29e42 added xmobarBorder 2020-08-29 19:44:01 +02:00
Brent Yorgey
51bc4f8c2f Merge pull request #370 from felixonmars/patch-1
Depend on semigroups only on GHC < 8.0
2020-08-15 11:28:12 -05:00
Brent Yorgey
07717e5dea Merge pull request #368 from sam-barr/master
Export AvoidStruts constructor and doSink
2020-08-13 17:41:52 -05:00
Felix Yan
e61a408e9d Depend on semigroups only on GHC < 8.0
They are not needed on newer GHC.
2020-08-11 17:40:27 +08:00
sam-barr
c60d8fc29d Merge branch 'master' into master 2020-08-06 07:48:49 -05:00
Brent Yorgey
15dbfeff32 Merge pull request #365 from frozencemetery/xf86bluetooth
EZConfig: Learn about XF86Bluetooth
2020-08-06 07:00:59 -05:00
sam-barr
dcf5fad5f9 Expose internal state of AvoidStruts layout modifier
Updated Changes.md

Export doSink
2020-08-05 19:31:52 -05:00
Brent Yorgey
4a6bbb63b4 Merge pull request #367 from elkowar/fix/window-swallowing-bug
Fix rare issues with windows wrongly dissapearing after windowswallowing
2020-07-27 05:19:34 -05:00
elkowar
8059d4c38c Fix rare issues with windows wrongly dissapearing after windowswallowing 2020-07-27 11:50:16 +02:00
Geoff deRosenroll
c7afc2904b Add XMonad.Util.ClickableWorkspaces module (#364)
This module enables clickable workspace tags in XMobar in a relatively unobtrusive fashion.
Inspired by https://arch-ed.dk/xmobar-clickable-workspaces
2020-07-24 01:11:48 +02:00
Robbie Harwood
04ccc4d972 EZConfig: Learn about XF86Bluetooth 2020-07-22 16:14:38 -04:00
Brent Yorgey
3dc49721b6 Merge pull request #357 from elkowar/window_swallowing
Add XMonad.Hooks.WindowSwallowing
2020-06-23 09:05:23 -05:00
Brent Yorgey
4d6209e17a Merge pull request #360 from Xandaros/iss359
Export EZConfig parsers
2020-06-22 06:19:03 -05:00
Martin Zeller
abfeff5db7 Export EZConfig parsers 2020-06-22 13:01:48 +02:00
Leon Kowarschick
5869af1c56 Fix floating state not correctly being cleaned after swallowing and make handleEventHook take Query Bool rather than [Query Bool] 2020-06-21 11:54:40 +02:00
Leon Kowarschick
ba247afd0a Add XMonad.Hooks.WindowSwallowing 2020-06-20 14:00:54 +02:00
Brent Yorgey
e3632cb0b4 Merge pull request #355 from wz1000/zsh-prompt
Add XMonad.Prompt.Zsh
2020-06-19 18:02:19 -05:00
Brent Yorgey
9fa69a5603 Merge pull request #356 from elkowar/hidden_layout_pop_specific
Add restoreHiddenWindow function to XMonad.Layout.Hidden
2020-06-19 17:59:39 -05:00
Brent Yorgey
5c8ff36bcb Merge pull request #351 from elkowar/master
Make XMonad.Util.NamedScratchpad more flexible
2020-06-18 07:06:21 -05:00
Leon Kowarschick
65036457cc Add restoreHiddenWindow function to XMonad.Layout.Hidden, restoring a specific window 2020-06-13 15:01:25 +02:00
Zubin Duggal
8c39850dc0 Add XMonad.Prompt.Zsh 2020-06-13 04:07:09 +05:30
Leon Kowarschick
5f3edb110e Refactor someNamedScratchpadOption to use Data.NonEmpty and to improve readability 2020-06-06 14:55:31 +02:00
Brent Yorgey
8ba646aec6 Merge pull request #340 from igor04/max-magnifier-off
Add maxMagnifierOff to Magnifier layout
2020-06-05 15:38:59 -05:00
ElKowar
22fcf69e83 Add PR-template checkbox about updating XMonad.Doc.Extending (#353) 2020-06-03 20:33:57 +05:30
Leon Kowarschick
a861a8f954 Add more customizability to how scratchpads are initially started in XMonad.Util.NamedScratchpad 2020-06-03 10:35:28 +02:00
Brent Yorgey
24d2f26302 Merge pull request #344 from elkowar/master
add new XMonad.Actions.TiledWindowDragging module
2020-06-01 15:36:41 -05:00
Brent Yorgey
aa3f93afea Merge pull request #350 from davama/master
Add Ebay Function to X.A.Search
2020-06-01 14:25:50 -05:00
Dave
faf89612aa Update Search.hs
Add ebay function
2020-06-01 12:00:04 -04:00