Xmonad Explained

xmonad
Screenshot Alt:XMonad in tiling mode with two URXVT terminals and pcmanFM open
Author:Spencer Janssen, Don Stewart, Jason Creighton
Released:[1]
Programming Language:Haskell
Operating System:POSIX compatible
Platform:Cross-platform
requires an X Window System and GHC
Size:56 KB (source code)[2]
Language:English
Genre:Window manager
License:BSD 3-clause

xmonad is a dynamic window manager (tiling) for the X Window System, noted for being written in the functional programming language Haskell.

Window manager

Begun in March 2007, version 0.1 was announced[3] in April 2007 as 500 lines of Haskell[4] (which have since grown to 2000 lines). xmonad is a tiling window manager—akin to dwm, larswm, and StumpWM. It arranges windows in a non-overlapping pattern, and enables managing windows without using the mouse. xmonad is packaged and distributed on a wide range of Unix-like operating systems, such as a large number of Linux distributions, and Berkeley Software Distribution (BSD) systems.

While originally a clone of dwm (derivative in areas such as default keybindings), xmonad now supports features not available to dwm users[5] [6] such as per-workspace layout, tiling reflection, state preservation, layout mirroring, GNOME support and per-screen status bars; it can be customised by modifying an external configuration file and 'reloaded' while running.[7] xmonad features have begun to influence other tiling window managers: dwm has borrowed "urgency hooks" from xmonad,[8] has also included Xinerama support (for multihead displays) with release 4.8, and patches exist to reimplement xmonad's Fibonacci layout.[9]

Haskell project

See main article: Haskell. In 2023 the man page stated:

By utilising the expressivity of a modern functional language with a rich static type system, xmonad provides a complete, featureful window manager [...], with an emphasis on correctness and robustness. Internal properties of the window manager are checked using a combination of static guarantees provided by the type system, and type-based automated testing. A benefit of this is that the code is simple to understand, and easy to modify.[10]

Since xmonad's inception, when its small code size of 500 lines of code was advertised, it has grown to ca. 2000 lines in 2023.

Extensions to the core system, including emulation of other window managers, and unusual layout algorithms, such as window tiling based on the Fibonacci spiral—have been implemented by the active community[11] and are available as a library.[12]

Along with obviating the need for a mouse, the xmonad developers make heavy use of semi-formal methods and program derivation for improving reliability and enabling a total line of code count less than 1200, as of version 0.7; window manager properties (such as the behavior of window focus) are checked through use of QuickCheck. This emphasis makes xmonad unusual in a number of ways; besides being the first window manager written in Haskell, it is also the first to use the zipper data structure for automatically managing focus, and its core has been proven to be safe with respect to pattern matches,[13] contributing further to reliability. The developers write:

xmonad is a tiling window manager for the X Window system, implemented, configured and dynamically extensible in Haskell. This demonstration presents the case that software dominated by side effects can be developed with the precision and efficiency we expect from Haskell by utilising purely functional data structures, an expressive type system, extended static checking and property-based testing. In addition, we describe the use of Haskell as an application configuration and extension language.[14]

The code is separated into side-effect free code, and a thin wrapper for the side-effects. According to Alejandro Serrano Mena, there are two ways of implementing domain-specific languages for actions in Haskell applications and libraries: "developing a combinator library" or "rolling your own monad", with xmonad being a successful example of the latter.[15] xmonad was regarded as one of the most well known Haskell projects in a 2013 functional programming book.[16]

Reception

Linux Magazine included xmonad in a list of "My Top Resources of 2009".[17] In 2012, How-To Geek described xmonad as having good, but complex, ability to be configured,[18] and it was included in a 2013 list of eight desktop environments for Linux.[19] Lifehacker wrote that the basic operations of xmonad's user interface can be taught using a small set of instructions. A high level of customisation and speed were noted by Network World, and in MakeUseOf xmonad was reviewed positively compared to Openbox.[20]

In 2016 Ars Technica said xmonad and Awesome had more advanced tiling ability than Cinnamon.[21] In 2017 it was described as powerful, with application as a windows manager for big data, while in an article on opensource.com on the other hand, dwm was chosen over xmonad.[22] A TechRadar review of the "Best Linux desktop of 2018" said "If there's one desktop environment that stands out from all the others we have here, it's this one."[23]

Due to the small number of lines of code of the Xmonad application, the use of the purely functional programming language Haskell, and recorded use of a rigorous testing procedure it is sometimes used as a baseline application in other research projects. This has included re-implementation of xmonad using the Coq proof assistant, a determination xmonad is an imperative program, and studies of package management relating to the NixOS linux distribution.

See also

References

Works cited

Further reading

External links

Notes and References

  1. Web site: Initial import: xmonad/xmonad@b2c1430 . GitHub.
  2. Web site: xmonad: download . suckless.org . December 17, 2012 . https://web.archive.org/web/20121226061104/http://xmonad.org/download.html . 2012-12-26 . live.
  3. Announce: xmonad 0.1 . 2007-04-22 . 2021-08-30 . Haskell-cafe . Janssen . Spencer . https://web.archive.org/web/20210830165259/https://mail.haskell.org/pipermail/xmonad/2007-April/000093.html . 2021-08-30 . live.
  4. Web site: Xmonad: a Tiling Window Manager Written in Haskell . . 2007-05-22 . 2007-09-23 . https://web.archive.org/web/20080411134807/http://www.osnews.com/story/17744/Xmonad-a-Tiling-Window-Manager-Written-in-Haskell/ . 2008-04-11 . live.
  5. Web site: Keyboard-Driven Environments Open a New Window . . 2007-05-31 . 2007-05-31 . https://web.archive.org/web/20070604030724/http://www.osnews.com/story.php/18009/Keyboard-Driven-Environments-Open-a-New-Window . 2007-06-04 . live.
  6. Web site: xmonad 0.4 Released . . 2007-10-19 . 2007-12-23 . https://web.archive.org/web/20071222205622/http://www.osnews.com/story.php/18794/xmonad-0.4-Released . 2007-12-22 . live.
  7. Through a combination of swiftly re-compiling and then execing the new xmonad binary; see Web site: Haskell Weekly News: April 27, 2007 . Haskell Weekly News . 2007-04-27 . 2007-05-23 . https://web.archive.org/web/20070529082510/http://sequence.complete.org/hwn/20070427 . 2007-05-29 . dead.
  8. See the developer discussion on the dwm mailing list
  9. http://dwm.suckless.org/patches/fibonacci Suckless.org: Fibonacci layouts patch
  10. Web site: Manpage of xmonad . xmonad.org . 2021-10-27 . 2023-09-01 . https://web.archive.org/web/20230813203216/https://xmonad.org/manpage.html . 2023-08-13 . live.
  11. xmonad users generate significant traffic in the
    1. xmonad
    Internet Relay Chat (IRC) channel and the xmonad mailing list; also, there are many commits to the extension library from non-core devs (see the xmonad statistic page)
  12. Web site: xmonad: Contributed code . xmonad.org . 2007-05-22 . 2007-05-23 . https://web.archive.org/web/20070916213057/http://xmonad.org/contrib.html . 2007-09-16 . live.
  13. Web site: Neil Mitchell's Haskell Blog: Does XMonad crash? . Neil . Mitchell . 9 May 2007 . 2007-05-17 . https://web.archive.org/web/20070514162938/http://neilmitchell.blogspot.com/2007/05/does-xmonad-crash.html . 2007-05-14 . live.
  14. Stewart & Janssen, 2007
  15. Book: Mena, Alejandro Serrano . Beginning Haskell: A Project-Based Approach . 5 March 2014 . . Google Books . 385 . 9781430262510 . 2018-09-24 . https://web.archive.org/web/20180924224747/https://books.google.co.uk/books?id=IZsQAwAAQBAJ . 2018-09-24 . live.
  16. Book: Das Curry-Buch – Funktional programmieren lernen mit JavaScript . Jens . Ohlig . Hannes . Mehnert . Stefanie . Schirmer . 24 September 2018 . 177 . . Google Books . 978-3868993691.
  17. News: Zawodny . Jeremy . 2009-12-06 . My Top Resources of 2009 . . usurped . https://web.archive.org/web/20180923123856/http://www.linux-mag.com/id/7639/ . 2018-09-23 . 2018-09-23.
  18. Web site: How to Use Xmonad, a Tiling Window Manager for Linux . Chris . Hoffman . 2012-05-24 . How-To Geek . 2018-09-17 . https://web.archive.org/web/20180918012122/https://www.howtogeek.com/114728/how-to-use-xmonad-a-tiling-window-manager-for-linux/ . 2018-09-18 . live.
  19. Web site: Linux Users Have a Choice: 8 Linux Desktop Environments . 2013-05-18 . Chris . Hoffman . How-To Geek . 2018-09-24 . https://web.archive.org/web/20170713231200/https://www.howtogeek.com/163154/linux-users-have-a-choice-8-linux-desktop-environments/ . 2017-07-13 . live.
  20. Web site: Need A Fresh Desktop Environment for Linux? Try Openbox Or xmonad. makeuseof.com . Danny . Stieben . 2018-09-18 . 2018-09-24 . https://web.archive.org/web/20171123122104/http://www.makeuseof.com/tag/need-a-fresh-desktop-environment-for-linux-try-openbox-or-xmonad/ . 2017-11-23 . live.
  21. Web site: Mint 18 review: "Just works" Linux doesn't get any better than this . 2016-08-04 . . 2018-09-17 . https://web.archive.org/web/20180917215343/https://arstechnica.com/information-technology/2016/08/mint-18-review-just-works-linux-doesnt-get-any-better-than-this/2/ . 2018-09-17 . live.
  22. Web site: Top 4 reasons I use dwm for my Linux window manager. 2017-07-18 . . . 2018-09-17 . https://web.archive.org/web/20180918054405/https://opensource.com/article/17/7/top-4-reasons-i-use-dwm-linux-window-manager . 2018-09-18 . live.
  23. Web site: Best Linux desktop of 2018. . 2018-01-15 . . 2018-09-17 . https://web.archive.org/web/20180918012109/https://www.techradar.com/uk/news/best-linux-desktop . 2018-09-18 . live.