Commit Graph

1501 Commits

Author SHA1 Message Date
slotThe
9db74715f2 X.Layout: Simplify JumpToLayout implementation
The `choose` combinator is very general; much more so than the
combination of `switch`, `swap`, and `passOnM`.

We can thus replace most of the implementation with calls to `choose`
and properly put everything related to `JumpToLayout` under one guard.
Plus, we don't need to define any extra functions that would have to be
tested in some way.

Co-authored-by: Tomas Janousek <tomi@nomi.cz>
2021-06-04 18:17:13 +01:00
slotThe
5b064f474d Update CHANGES.md 2021-06-04 18:17:11 +01:00
slotThe
bffa6dc2ce Merge X.L.LayoutCombinators.(|||) into X.L.(|||)
The functionality of the former are quite handy to have in core and we
can do so with minimal code changes.

The drawbacks of this approach are

  1. We can't merge JumpToLayout into ChangeLayout because people may
     have imported JumpToLayout(..), which we can't simulate with type
     aliases, patterns, and the like.

  2. Because the internal structure of X.L.LayoutCombintors.(|||) is a
     bit different, this creates a regression for people who used
     NextLayoutNoWrap or Wrap in their configs.  We could work around
     this by creating fake instances of these fields in the new
     JumpToLayout constructor and simply not doing anything with them,
     but since this seems like quite an advanced and specific use-case,
     failing fast and hard (as opposed to adding deprecation messages
     and then "silently" not handling these messages) seems preferrable
     here.

Related: https://github.com/xmonad/xmonad-contrib/pull/493
Related: https://github.com/xmonad/xmonad-contrib/issues/116
2021-06-04 18:17:04 +01:00
Tomas Janousek
341dea5907 Call xrrUpdateConfiguration to sync Xlib's view of screen config
Xrandrint.h says:

    /*
     * if a configure notify on the root is recieved, or
     * an XRRScreenChangeNotify is recieved,
     * XRRUpdateConfiguration should be called to update the X library's
     * view of the screen configuration; it will also invalidate the cache
     * provided by XRRScreenConfig and XRRConfig, and force a round trip
     * when next used.  Returns invalid status if not an event type
     * the library routine understand.
     */

If any user code needs that info/cache to be correct, we need to call
this.
2021-06-01 18:45:36 +01:00
Tomas Janousek
676530307b Clean up uses of setClientMessageEvent
In sendRestart, switch to the new setClientMessageEvent' and pass no
data, as no data are expected. Passing currentTime was confusing, as
it's only interpreted as time in some ClientMessage types.

In killWindow, it's the other way around.
2021-06-01 18:41:21 +01:00
Tomas Janousek
09425bbe43 Bump version number (pre-release 0.16.999) 2021-06-01 18:37:19 +01:00
Tomas Janousek
1805666e9d Bump X11 dependency
We have a bunch of open PRs that need features added in X11-1.10.

Related: https://github.com/xmonad/xmonad/pull/274
Related: https://github.com/xmonad/xmonad/pull/273
Related: https://github.com/xmonad/xmonad-contrib/pull/545
Related: https://github.com/xmonad/xmonad-contrib/pull/546
Related: https://github.com/xmonad/xmonad-contrib/pull/399
2021-06-01 18:37:19 +01:00
slotThe
40cd2081da Upcase tutorial file, mention it in README
Related: https://github.com/xmonad/xmonad/pull/278#issuecomment-850717606
2021-05-29 07:41:18 +02:00
slotThe
66514127f3 Merge pull request #278 from slotThe/new-tutorial
Add New Tutorial
2021-05-28 17:43:03 +02:00
slotThe
fdc3bf0484 tutorial.md: Point IRC channel to libera.chat
The reference to the freenode matrix channel is deleted for now; though
it may be added back in later-on, as the matrix team is working towards
bridging Libera.  We may also link the other matrix channel at some
point.

Related: https://github.com/xmonad/xmonad-web/pull/21
2021-05-28 16:52:09 +02:00
slotThe
f97d2527ff tutorial.md: Use logTitles
Ever since 322e06eed9c4b23a465d2857df462b8a2d716246 `ppTitleUnfocused`
does not exist anymore, as it was moved to `X.U.Loggers.logTitles`.
This makes the tutorial aware of that.
2021-05-28 16:52:09 +02:00
slotThe
7199d953a7 Add tutorial.md 2021-05-28 16:52:09 +02:00
slotThe
15653d4669 Add INSTALL.md 2021-05-28 16:50:06 +02:00
Tomas Janousek
d64a22d8db Switch IRC channel to irc.libera.chat
Since freenode has decided to kick us off because we said that we're
moving to Libera:

    Topic for #xmonad is "This channel has moved to ##xmonad. The topic is in violation of freenode policy: https://freenode.net/policies"
    Topic set by freenodecom (~com@freenode/staff) on Wed, 26 May 2021 04:59:51

it is high time we change the official channel on the website—even
though we don't even have OP on Libera yet.

Related: https://github.com/xmonad/xmonad-web/pull/26/
Co-authored-by: slotThe <soliditsallgood@mailbox.org>
2021-05-26 10:55:52 +01:00
Tomas Janousek
2e9f8dc831 ci: Refresh caches once a month
GitHub Actions writes caches on the first miss and then never updates
them again. If the CI is used frequently, the caches never expire and
as they get old, become less useful.

To avoid this, force refreshing the caches once a month.

Related: 52751f47d0
2021-05-24 23:19:30 +01:00
Tomas Janousek
e8bfc5bb69 ci: Prevent ~/.stack/pantry cache from being empty
When building with an LTS version that has exactly the dependencies we
need (X11-1.9.2), stack doesn't need to download the Hackage index. If
GitHub Actions cache locking chooses this job as the one that writes the
cache, then the "stack-pantry-Linux" cache entry stays empty, possibly
forever.

Force Hackage index update to prevent this from happening.

Related: d1a4820b55
2021-05-24 23:13:45 +01:00
Joan Milev
9e5b16ed8a Remove all instances of deriving Typeable
The derivation of Typeable has been automatic for quite a while now.

Related: https://github.com/xmonad/xmonad-contrib/issues/548
2021-05-24 22:56:36 +01:00
Tomas Janousek
d72da951c9 Use -Wno-* instead of the obsolete -fno-warn-* 2021-05-24 11:19:53 +01:00
Tomas Janousek
90101613e7 Unclobber dirs/Dirs in import XMonad
"dirs" is used several times in xmonad-contrib as a short for
"directions" and when I tried renaming those uses, I had a really hard
time coming up with something nice/meaningful. Therefore I think it's
best if we rename this instead, "dirs" is a valuable part of the
namespace. :-)

Fixes: 735fb58f6c ("Revise XDG handling")
2021-05-24 11:15:00 +01:00
Tomas Janousek
6caac22df1 ci: git-friendly apt deps in cabal.haskell-ci 2021-05-23 18:33:00 +01:00
Tomas Janousek
e9987b1adf Merge branches 'pr/grabkeys-nosymbol', 'pr/extensible-config' and 'pr/funding' 2021-05-21 11:49:52 +01:00
Tomas Janousek
383ffb772e Prevent grabKey from accidentally grabbing all unbound keys
grabKeys doesn't check that a KeySym is valid before looking up the
KeyCode(s) it's bound to. In particular, KeySym 0 (NoSymbol) gets mapped to every
unbound KeyCode, since that's what XKeycodeToKeysym returns for those.

This can most easily be reproduced using `statusBar` in xmonad-contrib,
with def as the key-mapping function; this unexpectedly invokes the
following instances:

    instance Default b => a -> b where def = const def
    instance (Default a, Default b) => (a, b) where def = (def, def)
    instance Default CInt where def = 0

thus producing a function which binds `toggleStruts` to the (KeyMask,
KeySym) pair (0, 0) (and demonstrating why Default is a dangerous
abstraction). The person who reported this used xmodmap to clear KeySyms
from their numpad keys, and then xmonad would bind strut toggling to the
entire numpad.

Note that it is not reliably possible to override `def` in this
situation (without introducing a new type); the only thing we can do is
try to avoid the aftermath, and I would expect that an inadvertent 0
KeySym is the most common error here anyway.

Fixes: https://github.com/xmonad/xmonad/issues/293
Fixes: 40cb12ce17 ("Grab all keycodes linked to each keysym, not just one")
Co-authored-by: Brandon S Allbery KF8NH <allbery.b@gmail.com>
2021-05-21 11:41:52 +01:00
Tomas Janousek
6379307baa Add Sponsor button to GitHub
These past months I've spent a lot of time working on xmonad¹ and I feel
like I've done a lot. This is, however, not sustainable long term. :-(

¹) primarily xmonad-contrib and the community in general

I'd like to try making my GitHub Sponsors profile a bit more visible,
hoping that would allow me to continue dedicating time to xmonad.

I know that the correct approach probably is for the xmonad project to
find a fiscal sponsor like the Software Freedom Conservancy or Open
Collective or something and accept donations as a project, and then
redistribute that to people, but I don't think the project has enough
momentum to do something as complicated as that. :-/

Related: https://github.com/xmonad/xmonad-contrib/pull/544
2021-05-18 16:53:07 +01:00
Tomas Janousek
d620639f7d Add support for extensible config in contrib modules
It's often difficult to make contrib modules work together. When one
depends on a functionality of another, it is often necessary to expose
lots of low-level functions and hooks and have the user combine these
into a complex configuration that works. This is error-prone, and
arguably a bad UX in general.

This commit presents a simple solution to that problem inspired by
"extensible state": extensible config. It allows contrib modules to
store custom configuration values inside XConfig. This lets them create
custom hooks, ensure they hook into xmonad core only once, and possibly
other use cases I haven't thought of yet.

For more, see the related pull request to xmonad-contrib.

Related: https://github.com/xmonad/xmonad-contrib/pull/547
2021-05-17 17:46:48 +01:00
Tomas Janousek
a5cee9bac2 ci: Fix failing installation of GHC
Since actions/virtual-environments#3268, the GHC PPA is no longer
enabled by default. :-(

(It would be better to use the haskell/actions/setup action, but it
insists on doing `cabal update` even if all we need is to install GHC
and Stack, which adds noticeable delay:
https://github.com/haskell/actions/issues/29)
2021-05-14 19:20:16 +01:00
github-actions
131fd3669f man: Update 2021-04-27 11:05:32 +01:00
Tomas Janousek
56f810d182 GenerateManpage: Drop all dependencies except base and invoke in CI
pandoc's API changes often enough that distros like Debian were patching
our GenerateManpage.hs to work with their version of pandoc, and it
doesn't build against any Stackage LTS except the recently released
LTS-17. Also, building pandoc from source takes quite some time and
resources.

But for what benefit? We're not using any special pandoc functionality
whatsoever. It's just that it was all in Haskell and the entire build
was orchestrated by cabal, but is all that complexity and resource
consumption worth it? I think not.

(Frankly, this whole thing was just a massive waste of time as the help
text in Config.hs isn't generated at all, so we still need to do this
manually. And then, the default key-bindings in core are unlikely to
change ever again.)

Let's simplify this:

* drop all dependencies except base and just run it through runhaskell

* add a Makefile and GH Actions workflow that invokes this after push

* only ship the results in release tarball, not the scripts which are
  considered our dev infrastructure

Closes: https://github.com/xmonad/xmonad/issues/283
Related: https://github.com/xmonad/xmonad/pull/260
Related: https://github.com/xmonad/xmonad/pull/261
Related: https://github.com/xmonad/xmonad/pull/265
Related: https://github.com/xmonad/xmonad/pull/266
Related: https://github.com/xmonad/xmonad/pull/267
Related: https://github.com/xmonad/xmonad/pull/268
2021-04-27 11:05:32 +01:00
Tomáš Janoušek
46f637e0be Merge pull request #289 from slotThe/maintainers
Update MAINTAINERS.md: add twitter, website references
2021-04-08 21:14:57 +01:00
slotThe
095d0e37d6 Update MAINTAINERS.md: add twitter, website references
Relevant mailing list discussion for the website part is available at
[1].

[1]: https://mail.haskell.org/pipermail/xmonad/2020-February/015358.html
2021-04-08 19:29:38 +02:00
Tomáš Janoušek
7e798afd11 Merge pull request #288 from slotThe/minimal-pragma
Add `MINIMAL` for `ExtensionClass` and `LayoutClass`
2021-04-07 18:33:07 +01:00
slotThe
669a9aed9e LayoutClass: update documentation
Make it clearer that we in fact do not require implementations for a
minimal complete definition, but that the default implementations have a
certain kind of dependency structure.
2021-04-07 10:12:15 +02:00
slotThe
c869129c71 ExtensionClass: Use MINIMAL pragma 2021-04-07 10:12:14 +02:00
Tomáš Janoušek
b8523a3c9b Merge pull request #202 from wygulmage/stack_instances
Add Functor, Foldable, and Traversable instances for StackSet.Stack
2021-04-04 09:56:45 +01:00
Tomas Janousek
400730fe3b Disable quickcheck-classes when building with stack
Stack doesn't support automatic flags: it doesn't backtrack when
dependency resolution fails using the default value of an automatic
flag, it just fails the build plan construction. We can't use automatic
flags to check if quickcheck-classes is available, and since the code is
tested by the haskell-ci.yml cabal workflow anyway, let's just disable
it here. It's not worth the hassle trying to enable it for select LTS
versions only. It's too much noise already, actually. :-(

Further reading:
https://cabal.readthedocs.io/en/latest/cabal-package.html#resolution-of-conditions-and-flags
https://github.com/commercialhaskell/stack/issues/1313#issuecomment-157259270
2021-04-03 17:13:25 +01:00
Tomas Janousek
6c5204b91c Simplify quickcheck-classes tests for Stack
We don't need the compat hacks for GHC 8.4.
2021-04-03 17:13:25 +01:00
Tomas Janousek
910d99cb74 Update CHANGES 2021-04-03 17:13:25 +01:00
Tomas Janousek
031bbd6230 Make quickcheck-classes dependency optional 2021-04-03 17:13:25 +01:00
Keith
05e8c204e9 Add quickcheck-classes tests for Stack
The tests are implemented by using a newtype wrapper `TestStack`. This is to
avoid creating `Eq1` and `Show1` instances for `Stack` itself, which are needed
by quickcheck-classes to run with GHC less than 8.5. Tests are automatically
generated by `traversalLaws` and `foldableLaws` using the `Arbitrary` instance
for `TestStack`.
2021-04-03 17:13:25 +01:00
Keith
2c91ea1621 Add Foldable, Functor, and Traversable instances for Stack
`Functor` is provided by DeriveFunctor.
`Foldable` uses `integrate` (`Stack`'s `toList`).
`Traversable` uses the `Reverse` Applicative to traverse the `up` list in
reverse order.
2021-04-03 17:13:25 +01:00
Tomas Janousek
5cdf428f55 ci: Enable -Werror
We don't want to ignore warnings do we?
2021-03-31 12:00:30 +01:00
Tomas Janousek
22b579bd14 Drop deprecated migrateState
migrateState is only necessary when _live_ upgrading from xmonad 0.12,
so I believe we can drop it now.

This fixes a compilation warning that we'd otherwise have to suppress.
2021-03-31 12:00:30 +01:00
Tomas Janousek
14d9fa247a Drop "testing" cabal flag
Since 8863761d66 (early 2014), the test
suite is a proper cabal test-suite and needs the "xmonad" library to be
built, and thus the flag serve no purpose.

Related: https://github.com/xmonad/xmonad/issues/283
2021-03-31 12:00:30 +01:00
Tomas Janousek
cfe99998fc ci: Cache pantry (hackage metadata) separately
This further reduces our usage of cache storage by caching the metadata
only once per repo. Now the metadata cache is ~250MB and the individual
caches with built dependencies are ~5M each.

Related: https://github.com/xmonad/X11/pull/75
Related: https://github.com/xmonad/xmonad/issues/283
2021-03-31 12:00:30 +01:00
Tomas Janousek
9fce3805fc ci: Use system GHC in Stack to not waste GH Actions cache space
Stack installation of GHC takes more than a gigabyte, so caching it
wastes space (GitHub docs say it will be aggressively evicted after
reaching the 5G limit) and also time (compression, decompression).

Related: https://github.com/xmonad/X11/pull/75
Related: https://github.com/xmonad/xmonad/issues/283
2021-03-31 12:00:30 +01:00
Tomas Janousek
fd243ca1c1 ci: Refresh tested-with
Related: https://github.com/xmonad/X11/pull/75
Related: https://github.com/xmonad/xmonad/issues/283
2021-03-31 12:00:30 +01:00
Tomas Janousek
c90df53081 tests: Fix build with GHC 9
Related: https://github.com/xmonad/xmonad/issues/283
2021-03-31 12:00:30 +01:00
Tomas Janousek
e4659c2475 ci: Move apt deps to cabal.haskell-ci and regenerate haskell-ci
Related: https://github.com/xmonad/X11/pull/75
Related: https://github.com/xmonad/xmonad/issues/283
2021-03-31 11:59:13 +01:00
Tomas Janousek
caae51c399 ci: Minor cleanup
* rename workflow to Stack

* test all branches (provides feedback before opening a PR)

* split into buildenv deps and stack build

* make the deps list more git-friendly; tweak the deps

* use stack from github environment (I've seen the curl fail intermittently)

* use `*.cabal` to minimize diff between our repos

Related: https://github.com/xmonad/X11/pull/75
Related: https://github.com/xmonad/xmonad/issues/283
2021-03-31 11:58:07 +01:00
Tomas Janousek
fb390fa9cc Revert "Revert "Re-enable lts based testing""
This reverts commit 8a8d5f71b1.

There will be a separate GH Actions workflow for rebuilding the manpage,
and generatemanpage will be dropped from xmonad.cabal (see
https://github.com/xmonad/xmonad/issues/283) therefore the revert no
longer makes sense and the stack workflow can indeed be reverted back to
a working state so we can continue from there.

For more information, see the following revenge revert storm:

Related: https://github.com/xmonad/xmonad/issues/283
Related: https://github.com/xmonad/xmonad/pull/260
Related: https://github.com/xmonad/xmonad/pull/261
Related: https://github.com/xmonad/xmonad/pull/265
Related: https://github.com/xmonad/xmonad/pull/266
Related: https://github.com/xmonad/xmonad/pull/267
Related: https://github.com/xmonad/xmonad/pull/268
2021-03-31 11:52:57 +01:00
Tomáš Janoušek
4a0b166998 Merge pull request #275 from liskin/pr/notifications-obscured-by-floats
Fix obscuring notifications when moving floats
2021-03-21 21:30:36 +00:00