Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load a Haskell program as config (like xmonad)

I know that xmonad’s configuration file is essentially a small Haskell program. I would like to do the same but don't seem to be able to understand from xmonad’s code how it is done. Would anyone please care to explain this to me in a slightly more foolproof way?

like image 641
Kamil S. Avatar asked Oct 15 '13 22:10

Kamil S.


People also ask

How does xmonad work?

XMonad is a minimal window manager, meaning it doesn't set a background, start a status bar, display a splash screen or play a soothing sound effect when it starts up. Once xmonad has started, the only thing it does is listen for your first command.

How do I recompile xmonad?

xmonad/xmonad. hs are made, use the Mod+q shortcut to recompile and have them take effect. Tip: The default configuration for xmonad is quite usable and it is achieved by simply running without an xmonad.

How do I quit xmonad?

mod-shift-q will quit xmonad.


1 Answers

xmonad is a library for writing window managers. The default window manager includes a keybinding which looks in a standard place for the source code of a new window manager, invokes GHC to build this source, then execs the newly built window manager. State is preserved by passing the current state on the command line and letting the new process deal with converting the information from the old process into the format needed for the new one (and sometimes this doesn't work, and the state is lost).

The whole pattern is bundled together as a library in dyre.

like image 175
Daniel Wagner Avatar answered Sep 21 '22 12:09

Daniel Wagner