This makes it possible to query the current layout state, which might be
useful to e.g. show the current X.L.WorkspaceDir in xmobar.
Example of use (assuming myLayout is the layout that is assigned to
layoutHook):
asMyLayout (Layout l) = (`asTypeOf` myLayout) <$> cast l
…
layout <- asMyLayout . W.layout . W.workspace . W.current <$> gets windowset
case layout of
Just (WorkspaceDir d) -> …
Unfortunately this requires adding the Typeable constraint to a bunch of
classes in xmonad-contrib, so we need to merge those changes there first
(fortunately it doesn't need to go in lockstep, adding a Typeable
constraint to those classes in xmonad-contrib is harmless).
A side effect of that change is that our code no longer compiles with GHC
versions prior to 8.0.x. We could work around that, no doubt, but the resulting
code would require CPP and Cabal flags and whatnot. It feels more reasonable to
just require a moderately recent compiler instead of going through all that
trouble.
Particularly with the addition of build scripts, it can be tricky to figure out
what XMonad is doing when attempting recompilation. This makes it clearer by
adding some logging.
Due to this logging, I noticed that the lag of xmonad start was because it was
always recompiling! When I startup my computer, I do not want it to delay
rebuilding my window manager. This also fixes that issue such that it only
recompiles XMonad if it is going to reinvoke due to getProgName not being the
expected string.
This is slight change to the original implementation. This version
forces a recompile if XMonad detects a custom build script. The
previous version took into consideration the time stamps of the source
files.
For a custom build script, the source files may be located in another
location, or there could be dependencies unknown to XMonad. Better to
just always call the build script and let it work out if something
needs to be built.
The xmonadNoArgs function is now exposed as launch. This allows users
to start xmonad from a custom binary and skip the configuration
complication check. (This is related to issue #62.)
In order to make the new launch function easier to use, resume state
has been removed from the command line and is now stored in a
temporary file. As a bonus this fixes issue #12.
This commit also includes a method of migrating from older command
line state to the newer state file. This should allow you have an
older xmonad instance start a newer xmonad and maintain state.
Users can specify directory overrides via environment variables. If
those aren't set, xmonad now prefers XDG directories. If ~/.xmonad
exists and none of the others do, it will be used instead.
See: xmonad/xmonad#61
This is a continuation of the work done by Adam Sjøgren (@asjo) to
resolve an issue where RGBA windows have transparent borders. It also
fixes bugs related to windows suddenly disappearing right before
xmonad calls getWindowAttributes.
For more information see xmonad/xmonad#9