External Publication
Visit Post

[ANN] Rivulet Window Manager

Haskell Community [Unofficial] April 11, 2026
Source

A friend of mine offered this funny example of what’s possible with the Rivulet config:

-- ConfigM is a monad but you refuse to use (>>=) on principle

myConfig :: ConfigM ()
myConfig =
    gaps        <$> pure 4
                <*  borders 2 (0xFF000000, 0xFF0000FF)
                <*  layout Tall
                <*  (keybinds $
                        bind <$> pure [Super]
                             <*> pure q
                             <*> pure closeFocused)

So I got to thinking and it would be pretty funny to explore some esoteric uses of the config being just Haskell. For example,

realGaps :: Int
realGaps = unsafePerformIO $ do
    t <- getCurrentTime
    -- gaps are 4 most of the time but on Tuesdays they are 5
    let day = dayOfWeek (utctDay t)
    pure $ if day == Tuesday then 5 else 4

gaps realGaps

or keybindings as a Markov chain:

-- keybindings probabilistically select the next action
import System.Random (randomRIO)

markov :: Action
markov = do
    n <- liftIO $ randomRIO (0 :: Int, 2)
    [focusNext, focusPrev, closeFocused] !! n

There is likely some really funny things you could do with this DSL. I wonder what other silly things one could come up with, like making your entire config a Foldable instance or something.

Discussion in the ATmosphere

Loading comments...