1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
3 ;;; Copyright © 2015 Siniša Biđin <sinisa@bidin.eu>
4 ;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2015 xd1le <elisp.vim@gmail.com>
6 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
7 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
8 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Al McElrath <hello@yrns.org>
10 ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
11 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
12 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
13 ;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
14 ;;; Copyright © 2016 Ivan Vilata i Balaguer <ivan@selidor.net>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages wm)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages linux)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system haskell)
39 #:use-module (guix build-system python)
40 #:use-module (gnu packages haskell)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pulseaudio)
45 #:use-module (gnu packages xorg)
46 #:use-module (gnu packages xdisorg)
47 #:use-module (gnu packages documentation)
48 #:use-module (gnu packages xml)
49 #:use-module (gnu packages m4)
50 #:use-module (gnu packages docbook)
51 #:use-module (gnu packages image)
52 #:use-module (gnu packages pcre)
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages libevent)
55 #:use-module (gnu packages fribidi)
56 #:use-module (gnu packages maths)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages freedesktop)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages gperf)
62 #:use-module (gnu packages imagemagick)
63 #:use-module (gnu packages lua)
64 #:use-module (gnu packages suckless)
65 #:use-module (guix download)
66 #:use-module (guix git-download))
68 (define-public libconfuse
74 (uri (string-append "http://savannah.nongnu.org/download/confuse/"
75 "confuse-" version ".tar.gz"))
78 "0y47r2ashz44wvnxdb18ivpmj8nxhw3y9bf7v9w0g5byhgyp89g3"))))
79 (build-system gnu-build-system)
80 (home-page "http://www.nongnu.org/confuse/")
81 (synopsis "Configuration file parser library")
82 (description "libconfuse is a configuration file parser library. It
83 supports sections and (lists of) values (strings, integers, floats, booleans
84 or other sections), as well as some other features (such as
85 single/double-quoted strings, environment variable expansion, functions and
86 nested include statements).")
87 (license license:isc)))
95 (file-name (string-append name "-" version ".tar.gz"))
98 "https://github.com/baskerville/bspwm/archive/"
102 "1pig0h2jk8wipyz90j69c4bk37bfyq60asnn0v0bqld2p2vjvyqy"))))
103 (build-system gnu-build-system)
106 ("libxinerama" ,libxinerama)
108 ("xcb-util" ,xcb-util)
109 ("xcb-util-keysyms" ,xcb-util-keysyms)
110 ("xcb-util-wm" ,xcb-util-wm)))
112 '(#:phases (alist-delete 'configure %standard-phases)
113 #:tests? #f ; no check target
114 #:make-flags (list "CC=gcc"
115 (string-append "PREFIX=" %output))))
116 (home-page "https://github.com/baskerville/bspwm")
117 (synopsis "Tiling window manager based on binary space partitioning")
118 (description "bspwm is a tiling window manager that represents windows as
119 the leaves of a full binary tree.")
120 (license license:bsd-2)))
122 (define-public i3status
128 (uri (string-append "https://i3wm.org/i3status/i3status-"
132 "1497dsvb32z9xljmxz95dnyvsbayn188ilm3l4ys8m5h25vd1xfs"))))
133 (build-system gnu-build-system)
135 `(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
137 (modify-phases %standard-phases
139 #:tests? #f)) ; no test suite
141 `(("openlibm" ,openlibm)
142 ("libconfuse" ,libconfuse)
144 ("alsa-lib" ,alsa-lib)
145 ("pulseaudio" ,pulseaudio)
148 ("asciidoc" ,asciidoc)))
150 `(("pkg-config" ,pkg-config)))
151 (home-page "https://i3wm.org/i3status/")
152 (synopsis "Status bar for i3bar, dzen2, xmobar or similar programs")
153 (description "i3status is a small program for generating a status bar for
154 i3bar, dzen2, xmobar or similar programs. It is designed to be very efficient
155 by issuing a very small number of system calls, as one generally wants to
156 update such a status line every second. This ensures that even under high
157 load, your status bar is updated correctly. Also, it saves a bit of energy by
158 not hogging your CPU as much as spawning the corresponding amount of shell
160 (license license:bsd-3)))
168 (uri (string-append "https://i3wm.org/downloads/i3-"
172 "12ngz32swh9n85xy0cz1lq16aqi9ys5hq19v589q9a97wn1k3hcl"))))
173 (build-system gnu-build-system)
176 (let* ((docbook-xsl-name-version ,(string-append
177 (package-name docbook-xsl) "-"
178 (package-version docbook-xsl)))
179 (docbook-xsl-catalog-file (string-append
180 (assoc-ref %build-inputs "docbook-xsl")
182 docbook-xsl-name-version
184 (docbook-xml-catalog-file (string-append
185 (assoc-ref %build-inputs "docbook-xml")
186 "/xml/dtd/docbook/catalog.xml")))
187 ;; Reference the catalog files required to build the manpages.
188 (list (string-append "XML_CATALOG_FILES=" docbook-xsl-catalog-file " "
189 docbook-xml-catalog-file)
191 (string-append "PREFIX=" %output)
192 ;; This works around the following error:
193 ;; 'error: ‘for’ loop initial declarations are only allowed in C99
196 ;; The build system tries to build in a separate directory, but that
197 ;; seems to be unnecessary.
198 #:configure-flags '("--disable-builddir")
199 ;; The test suite appears to require the unpackaged Perl module AnyEvent.
203 ("xcb-util" ,xcb-util)
204 ("xcb-util-cursor" ,xcb-util-cursor)
205 ("xcb-util-keysyms" ,xcb-util-keysyms)
206 ("xcb-util-wm" ,xcb-util-wm)
207 ("xcb-util-xrm" ,xcb-util-xrm)
208 ("libxkbcommon" ,libxkbcommon)
211 ("asciidoc" ,asciidoc)
213 ("perl-pod-simple" ,perl-pod-simple)
214 ("docbook-xml" ,docbook-xml)
217 ("startup-notification" ,startup-notification)
223 ("pkg-config" ,pkg-config)
224 ;; For building the documentation.
225 ("docbook-xsl" ,docbook-xsl)))
226 (home-page "https://i3wm.org/")
227 (synopsis "Improved tiling window manager")
228 (description "A tiling window manager, completely written
229 from scratch. i3 is primarily targeted at advanced users and
231 (license license:bsd-3)))
233 (define-public python-i3-py
235 (name "python-i3-py")
239 ;; The latest release is not tagged in Git nor has an entry in PyPi,
240 ;; but there is still a clear commit for it, and it's been the last one
244 (url "https://github.com/ziberna/i3-py.git")
245 (commit "27f88a616e9ecc340e7d041d3d00782f8a1964c1")))
248 "1nm719dc2xqlll7vj4c4m7mpjb27lpn3bg3c66gajvnrz2x1nmxs"))
249 (file-name (string-append name "-" version "-checkout"))))
250 (build-system python-build-system)
252 `(#:tests? #f ; no tests yet
253 #:phases (modify-phases %standard-phases
254 (add-after 'install 'install-doc
255 ;; Copy readme file to documentation directory.
256 (lambda* (#:key outputs #:allow-other-keys)
257 (let ((doc (string-append (assoc-ref outputs "out")
258 "/share/doc/" ,name)))
259 (install-file "README.md" doc)
260 ;; Avoid unspecified return value.
264 (home-page "https://github.com/ziberna/i3-py")
265 (synopsis "Python interface to the i3 window manager")
266 (description "This package allows you to interact from a Python program
267 with the i3 window manager via its IPC socket. It can send commands and other
268 kinds of messages to i3, select the affected containers, filter results and
269 subscribe to events.")
270 (license license:gpl3+)))
272 (define-public python2-i3-py
273 (package-with-python2 python-i3-py))
275 (define-public quickswitch-i3
276 (let ((commit "ed692b1e8f43b95bd907ced26238ce8ccb2ed28f")
277 (revision "1")) ; Guix package revision
279 (name "quickswitch-i3")
280 (version (string-append "2.2-" revision "."
281 (string-take commit 7)))
284 ;; The latest commit is a few years old and just a couple commits
285 ;; after the last tagged release, so we use that latest commit
286 ;; instead of the release.
289 (url "https://github.com/proxypoke/quickswitch-for-i3.git")
293 "0447077sama80jcdg5p64zjsvafmz5rbdrirhm1adcdjhkh6iqc5"))
294 (patches (search-patches "quickswitch-fix-dmenu-check.patch"))
295 (file-name (string-append name "-" version "-checkout"))))
296 (build-system python-build-system)
298 `(#:tests? #f ; no tests yet
299 #:phases (modify-phases %standard-phases
300 (add-after 'install 'install-doc
301 ;; Copy readme file to documentation directory.
302 (lambda* (#:key outputs #:allow-other-keys)
303 (let ((doc (string-append (assoc-ref outputs "out")
304 "/share/doc/" ,name)))
305 (install-file "README.rst" doc)
306 ;; Avoid unspecified return value.
309 `(("python-i3-py" ,python-i3-py)
311 (home-page "https://github.com/proxypoke/quickswitch-for-i3")
312 (synopsis "Quickly change to and locate windows in the i3 window manager")
314 "This utility for the i3 window manager allows you to quickly switch to
315 and locate windows on all your workspaces, using an interactive dmenu
317 (license (license:non-copyleft "http://www.wtfpl.net/txt/copying/")))))
319 (define-public xmonad
323 (synopsis "Tiling window manager")
326 (uri (string-append "mirror://hackage/package/xmonad/"
327 name "-" version ".tar.gz"))
330 "1pfjssamiwpwjp1qqkm9m9p9s35pv381m0cwg6jxg0ppglibzq1r"))
331 (modules '((guix build utils)))
333 ;; Here we update the constraints on the utf8-string package in
334 ;; the Cabal file. We allow a newer version which is compatible
335 ;; with GHC 7.10.2. The same change is applied on Hackage. See
336 ;; <https://hackage.haskell.org/package/xmonad-0.11.1/revisions/>.
337 '(substitute* "xmonad.cabal"
338 (("utf8-string >= 0.3 && < 0.4")
339 "utf8-string >= 0.3 && < 1.1")))))
340 (build-system haskell-build-system)
342 `(("ghc-mtl" ,ghc-mtl)
343 ("ghc-utf8-string" ,ghc-utf8-string)
344 ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
345 ("ghc-x11" ,ghc-x11)))
348 (modify-phases %standard-phases
350 'install 'install-xsession
352 (let* ((xsessions (string-append %output "/share/xsessions")))
354 (call-with-output-file
355 (string-append xsessions "/xmonad.desktop")
362 Type=Application~%" ,name ,synopsis %output)))))))))
363 (home-page "http://xmonad.org")
365 "Xmonad is a tiling window manager for X. Windows are arranged
366 automatically to tile the screen without gaps or overlap, maximising screen
367 use. All features of the window manager are accessible from the keyboard: a
368 mouse is strictly optional. Xmonad is written and extensible in Haskell.
369 Custom layout algorithms, and other extensions, may be written by the user in
370 config files. Layouts are applied dynamically, and different layouts may be
371 used on each workspace. Xinerama is fully supported, allowing windows to be
372 tiled on several screens.")
373 (license license:bsd-3)))
375 (define-public ghc-xmonad-contrib
377 (name "ghc-xmonad-contrib")
382 (uri (string-append "mirror://hackage/package/xmonad-contrib/"
383 "xmonad-contrib-" version ".tar.gz"))
386 "1g5cw9vvnfbiyi599fngk02zlmdhrf82x0bndhypkn6kybab6yd3"))))
387 (build-system haskell-build-system)
389 `(("ghc-mtl" ,ghc-mtl)
390 ("ghc-old-time" ,ghc-old-time)
391 ("ghc-random" ,ghc-random)
392 ("ghc-utf8-string" ,ghc-utf8-string)
393 ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
395 ("ghc-x11-xft" ,ghc-x11-xft)
397 (home-page "http://xmonad.org")
398 (synopsis "Third party extensions for xmonad")
400 "Third party tiling algorithms, configurations, and scripts to Xmonad, a
401 tiling window manager for X.")
402 (license license:bsd-3)))
404 (define-public evilwm
411 (uri (string-append "http://www.6809.org.uk/evilwm/evilwm-"
415 "0ak0yajzk3v4dg5wmaghv6acf7v02a4iw8qxmq5yw5ard8lrqn3r"))
416 (patches (search-patches "evilwm-lost-focus-bug.patch"))))
417 (build-system gnu-build-system)
421 ("libxrandr" ,libxrandr)))
423 `(#:modules ((srfi srfi-26)
425 (guix build gnu-build-system))
426 #:make-flags (let ((inputs (map (cut assoc-ref %build-inputs <>)
427 '("libx11" "libxext" "libxrandr")))
428 (join (lambda (proc strs)
429 (string-join (map proc strs) " ")))
430 (dash-I (cut string-append "-I" <> "/include"))
431 (dash-L (cut string-append "-L" <> "/lib")))
432 `("desktopfilesdir=$(prefix)/share/xsessions"
433 ,(string-append "prefix=" (assoc-ref %outputs "out"))
434 ,(string-append "CPPFLAGS=" (join dash-I inputs))
435 ,(string-append "LDFLAGS=" (join dash-L inputs))))
436 #:tests? #f ;no tests
437 #:phases (modify-phases %standard-phases
438 (delete 'configure)))) ;no configure script
439 (home-page "http://www.6809.org.uk/evilwm/")
440 (synopsis "Minimalist window manager for the X Window System")
442 "evilwm is a minimalist window manager based on aewm, extended to feature
443 many keyboard controls with repositioning and maximize toggles, solid window
444 drags, snap-to-border support, and virtual desktops.")
445 (license (license:x11-style "file:///README"))))
447 (define-public fluxbox
451 (synopsis "Small and fast window manager")
454 (uri (string-append "mirror://sourceforge/fluxbox/fluxbox/"
455 version "/fluxbox-" version ".tar.xz"))
458 "1h1f70y40qd225dqx937vzb4k2cz219agm1zvnjxakn5jkz7b37w"))))
459 (build-system gnu-build-system)
461 `(#:make-flags '("CPPFLAGS=-U__TIME__") ;ugly, but for reproducibility
463 (modify-phases %standard-phases
465 'install 'install-xsession
467 (let ((xsessions (string-append %output "/share/xsessions")))
469 (call-with-output-file
470 (string-append xsessions "/fluxbox.desktop")
476 Exec=~a/bin/startfluxbox~@
477 Type=Application~%" ,name ,synopsis %output)))))))))
479 `(("pkg-config" ,pkg-config)))
481 `(("freetype" ,freetype)
487 ("libxinerama" ,libxinerama)
489 ("libxrandr" ,libxrandr)
490 ("libxrender" ,libxrender)))
491 (description "Fluxbox is a window manager. It is light on resources
492 and easy to handle yet full of features to make an easy and fast desktop
494 (home-page "http://fluxbox.org/")
495 (license license:expat)))
497 (define-public awesome
502 (origin (method url-fetch)
504 "https://awesome.naquadah.org/download/awesome-"
508 "0kynair1ykr74b39a4gcm2y24viial64337cf26nhlc7azjbby67"))
509 (modules '((guix build utils)
512 ;; Remove non-reproducible timestamp and use the date of the
513 ;; source file instead.
514 '(substitute* "common/version.c"
515 (("__DATE__ \" \" __TIME__")
518 (make-time time-utc 0
519 (stat:mtime (stat "awesome.c"))))
521 (patches (search-patches "awesome-reproducible-png.patch"))))
522 (build-system cmake-build-system)
523 (native-inputs `(("asciidoc" ,asciidoc)
524 ("docbook-xsl" ,docbook-xsl)
527 ("imagemagick" ,imagemagick)
528 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
529 ("pkg-config" ,pkg-config)
531 (inputs `(("cairo" ,cairo)
533 ("gdk-pixbuf" ,gdk-pixbuf)
535 ("gobject-introspection" ,gobject-introspection)
539 ("libxcursor" ,libxcursor)
540 ("libxdg-basedir" ,libxdg-basedir)
544 ("startup-notification" ,startup-notification)
545 ("xcb-util" ,xcb-util)
546 ("xcb-util-cursor" ,xcb-util-cursor)
547 ("xcb-util-image" ,xcb-util-image)
548 ("xcb-util-keysyms" ,xcb-util-keysyms)
549 ("xcb-util-renderutil" ,xcb-util-renderutil)
550 ("xcb-util-wm" ,xcb-util-wm)))
552 `(;; Let compression happen in our 'compress-documentation' phase so that
553 ;; '--no-name' is used, which removes timestamps from gzip output.
554 #:configure-flags '("-DCOMPRESS_MANPAGES=off")
557 (modify-phases %standard-phases
558 (add-before 'build 'xmlto-skip-validation
560 ;; We can't download the necessary schema, so so skip
561 ;; validation and assume they're valid.
562 (substitute* "../build/CMakeFiles/man.dir/build.make"
564 (string-append "/xmlto --skip-validation")))
566 (add-before 'configure 'set-lua-paths
567 (lambda* (#:key inputs #:allow-other-keys)
568 ;; The build process needs to load cairo dynamically.
569 (let* ((cairo (string-append
570 (assoc-ref inputs "cairo") "/lib" ))
571 (lua-lgi (assoc-ref inputs "lua-lgi") ))
572 (setenv "LD_LIBRARY_PATH" cairo )
573 (setenv "LUA_PATH" (string-append lua-lgi
574 "/share/lua/5.2/?.lua"))
575 (setenv "LUA_CPATH" (string-append lua-lgi
576 "/lib/lua/5.2/?.so"))
580 ;; There aren't any tests, so just make sure the binary
581 ;; gets built and can be run successfully.
582 (zero? (system* "../build/awesome" "-v"))))
583 (add-after 'install 'wrap
584 (lambda* (#:key inputs outputs #:allow-other-keys)
585 (let* ((awesome (assoc-ref outputs "out"))
586 (cairo (string-append
587 (assoc-ref inputs "cairo") "/lib" ))
588 (lua-lgi (assoc-ref inputs "lua-lgi") ))
589 (wrap-program (string-append awesome "/bin/awesome")
590 `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))
591 `("LD_LIBRARY_PATH" suffix (, cairo))
592 `("LUA_PATH" suffix (,(string-append lua-lgi
593 "/share/lua/5.2/?.lua")))
594 `("LUA_CPATH" suffix (,(string-append
595 lua-lgi "/lib/lua/5.2/?.so"))))))))))
596 (synopsis "Highly configurable window manager")
598 "Awesome has been designed as a framework window manager. It is fast, small,
599 dynamic and extensible using the Lua programming language.")
600 (license license:gpl2+)
601 (home-page "https://awesome.naquadah.org/")))