TUTORIAL: Add separators for < 0.17.0 instructions

At least one of the instructions spans multiple paragraphs, which makes
it difficult to make out when this kind of interlude ends and the rest
of the text picks back up.  Introducing separators, while slightly
visually jarring, solves this problem.  As such, make sure that these
sections are reasonably far apart and group ones that are close
together.
This commit is contained in:
Tony Zorman 2022-09-08 19:10:14 +02:00
parent fb1f33258e
commit fd9de8903f

View File

@ -379,12 +379,16 @@ effect (and some applications, like chromium, will misbehave and need
some [Hacks] to make this work), we will also add the relevant function
to get "proper" fullscreen behaviour here.
---
_IF YOU ARE ON A VERSION `< 0.17.0`_: The `ewmhFullscreen` function does
not exist in these versions. Instead of it, you can try to add
`fullscreenEventHook` to your `handleEventHook` to achieve similar
functionality (how to do this is explained in the documentation of
[XMonad.Hooks.EwmhDesktops]).
---
To use the two combinators, we compose them with the `xmonad` function
in the following way:
@ -430,7 +434,7 @@ Much better!
## Make XMonad and Xmobar Talk to Each Other
Onto the main dish. First, we have to import the necessary modules.
Add the following to your list of imports:
Add the following to your list of imports
``` haskell
import XMonad.Hooks.DynamicLog
@ -438,23 +442,27 @@ import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
```
_IF YOU ARE ON A VERSION `< 0.17.0`_: The `XMonad.Hooks.StatusBar` and
`XMonad.Hooks.StatusBar.PP` modules don't exist yet. You can find
everything you need in the `XMonad.Hooks.DynamicLog` module, so remove
these two imports.
Replace your `main` function above with:
and replace your `main` function above with:
``` haskell
main :: IO ()
main = xmonad $ ewmhFullscreen $ ewmh $ xmobarProp $ myConfig
```
_IF YOU ARE ON A VERSION `< 0.17.0`_: The `xmobarProp` function does not
exist in these versions. Instead of it, use `xmobar` via
`main = xmonad . ewmh =<< xmobar myConfig` and carefully read the part
about pipes later on (`xmobar` uses pipes to make xmobar talk to
xmonad).
---
_IF YOU ARE ON A VERSION `< 0.17.0`_: The `XMonad.Hooks.StatusBar` and
`XMonad.Hooks.StatusBar.PP` modules don't exist yet. You can find
everything you need in the `XMonad.Hooks.DynamicLog` module, so remove
these two imports.
Further, the `xmobarProp` function does not exist in older versions.
Instead of it, use `xmobar` via `main = xmonad . ewmh =<< xmobar
myConfig` and carefully read the part about pipes later on (`xmobar`
uses pipes to make xmobar talk to xmonad). Do note the lack of
`ewmhFullscreen`, as explained above!
---
As a quick side-note, we could have also written
@ -540,11 +548,15 @@ when things are not being read! For this reason we have to use
(this is useful, for example, for [XMonad.Util.ClickableWorkspaces],
which is a new feature in `0.17.0`).
---
_IF YOU ARE ON A VERSION `< 0.17.0`_: As discussed above, the `xmobar`
function uses pipes, so you actually do want to use the `StdinReader`.
Simply replace _all_ occurences of `XMonadLog` with `StdinReader`
below (don't forget the template!)
---
## Configuring Xmobar
Now, before this will work, we have to configure xmobar. Here's a nice
@ -660,6 +672,8 @@ main = xmonad
$ myConfig
```
---
_IF YOU ARE ON A VERSION `< 0.17.0`_: `xmobar` has a similar definition,
relying on `statusBar` alone: `xmobar = statusBar "xmobar" xmobarPP
toggleStrutsKey`. Sadly, the `defToggleStrutsKey` function is not yet
@ -675,6 +689,8 @@ main = xmonad
toggleStrutsKey XConfig{ modMask = m } = (m, xK_b)
```
---
The `defToggleStrutsKey` here is just the key with which you can toggle
the bar; it is bound to `M-b`. If you want to change this, you can also
define your own:
@ -771,6 +787,8 @@ myXmobarPP = def
lowWhite = xmobarColor "#bbbbbb" ""
```
---
_IF YOU ARE ON A VERSION `< 0.17`_: Both `logTitles` and `xmobarBorder`
are not available yet, so you will have to remove them. As an
alternative to `xmobarBorder`, a common way to "mark" the currently
@ -778,6 +796,8 @@ _IF YOU ARE ON A VERSION `< 0.17`_: Both `logTitles` and `xmobarBorder`
`ppCurrent = wrap (blue "[") (blue "]")` and see if you like it. Also
read the bit about `ppOrder` further down!
---
That's a lot! But don't worry, take a deep breath and remind yourself
of what you read above in the documentation of the [PP record]. Even if
you haven't read the documentation yet, most of the fields should be