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, 2017 ng0 <contact.ng0@cryptolab.net>
13 ;;; Copyright © 2016 doncatnip <gnopap@gmail.com>
14 ;;; Copyright © 2016 Ivan Vilata i Balaguer <ivan@selidor.net>
15 ;;; Copyright © 2017 Mekeor Melire <mekeor.melire@gmail.com>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages wm)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages linux)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system haskell)
40 #:use-module (guix build-system python)
41 #:use-module (gnu packages haskell)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pulseaudio)
46 #:use-module (gnu packages xorg)
47 #:use-module (gnu packages xdisorg)
48 #:use-module (gnu packages documentation)
49 #:use-module (gnu packages xml)
50 #:use-module (gnu packages m4)
51 #:use-module (gnu packages docbook)
52 #:use-module (gnu packages image)
53 #:use-module (gnu packages pcre)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages gtk)
56 #:use-module (gnu packages libevent)
57 #:use-module (gnu packages fribidi)
58 #:use-module (gnu packages maths)
59 #:use-module (gnu packages web)
60 #:use-module (gnu packages fontutils)
61 #:use-module (gnu packages freedesktop)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gperf)
64 #:use-module (gnu packages imagemagick)
65 #:use-module (gnu packages lua)
66 #:use-module (gnu packages suckless)
67 #:use-module (guix download)
68 #:use-module (guix git-download))
70 (define-public libconfuse
76 (uri (string-append "http://savannah.nongnu.org/download/confuse/"
77 "confuse-" version ".tar.gz"))
80 "0y47r2ashz44wvnxdb18ivpmj8nxhw3y9bf7v9w0g5byhgyp89g3"))))
81 (build-system gnu-build-system)
82 (home-page "http://www.nongnu.org/confuse/")
83 (synopsis "Configuration file parser library")
84 (description "libconfuse is a configuration file parser library. It
85 supports sections and (lists of) values (strings, integers, floats, booleans
86 or other sections), as well as some other features (such as
87 single/double-quoted strings, environment variable expansion, functions and
88 nested include statements).")
89 (license license:isc)))
97 (file-name (string-append name "-" version ".tar.gz"))
100 "https://github.com/baskerville/bspwm/archive/"
104 "1pig0h2jk8wipyz90j69c4bk37bfyq60asnn0v0bqld2p2vjvyqy"))))
105 (build-system gnu-build-system)
108 ("libxinerama" ,libxinerama)
110 ("xcb-util" ,xcb-util)
111 ("xcb-util-keysyms" ,xcb-util-keysyms)
112 ("xcb-util-wm" ,xcb-util-wm)))
114 '(#:phases (alist-delete 'configure %standard-phases)
115 #:tests? #f ; no check target
116 #:make-flags (list "CC=gcc"
117 (string-append "PREFIX=" %output))))
118 (home-page "https://github.com/baskerville/bspwm")
119 (synopsis "Tiling window manager based on binary space partitioning")
120 (description "bspwm is a tiling window manager that represents windows as
121 the leaves of a full binary tree.")
122 (license license:bsd-2)))
124 (define-public i3status
130 (uri (string-append "https://i3wm.org/i3status/i3status-"
134 "0pwcy599fw8by1a1sf91crkqba7679qhvhbacpmhis8c1xrpxnwq"))))
135 (build-system gnu-build-system)
137 `(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
139 (modify-phases %standard-phases
141 #:tests? #f)) ; no test suite
143 `(("openlibm" ,openlibm)
144 ("libconfuse" ,libconfuse)
146 ("alsa-lib" ,alsa-lib)
147 ("pulseaudio" ,pulseaudio)
150 ("asciidoc" ,asciidoc)))
152 `(("pkg-config" ,pkg-config)))
153 (home-page "https://i3wm.org/i3status/")
154 (synopsis "Status bar for i3bar, dzen2, xmobar or similar programs")
155 (description "i3status is a small program for generating a status bar for
156 i3bar, dzen2, xmobar or similar programs. It is designed to be very efficient
157 by issuing a very small number of system calls, as one generally wants to
158 update such a status line every second. This ensures that even under high
159 load, your status bar is updated correctly. Also, it saves a bit of energy by
160 not hogging your CPU as much as spawning the corresponding amount of shell
162 (license license:bsd-3)))
170 (uri (string-append "https://i3wm.org/downloads/i3-"
174 "12ngz32swh9n85xy0cz1lq16aqi9ys5hq19v589q9a97wn1k3hcl"))))
175 (build-system gnu-build-system)
178 (let* ((docbook-xsl-name-version ,(string-append
179 (package-name docbook-xsl) "-"
180 (package-version docbook-xsl)))
181 (docbook-xsl-catalog-file (string-append
182 (assoc-ref %build-inputs "docbook-xsl")
184 docbook-xsl-name-version
186 (docbook-xml-catalog-file (string-append
187 (assoc-ref %build-inputs "docbook-xml")
188 "/xml/dtd/docbook/catalog.xml")))
189 ;; Reference the catalog files required to build the manpages.
190 (list (string-append "XML_CATALOG_FILES=" docbook-xsl-catalog-file " "
191 docbook-xml-catalog-file)
193 (string-append "PREFIX=" %output)
194 ;; This works around the following error:
195 ;; 'error: ‘for’ loop initial declarations are only allowed in C99
198 ;; The build system tries to build in a separate directory, but that
199 ;; seems to be unnecessary.
200 #:configure-flags '("--disable-builddir")
201 ;; The test suite appears to require the unpackaged Perl module AnyEvent.
205 ("xcb-util" ,xcb-util)
206 ("xcb-util-cursor" ,xcb-util-cursor)
207 ("xcb-util-keysyms" ,xcb-util-keysyms)
208 ("xcb-util-wm" ,xcb-util-wm)
209 ("xcb-util-xrm" ,xcb-util-xrm)
210 ("libxkbcommon" ,libxkbcommon)
213 ("asciidoc" ,asciidoc)
215 ("perl-pod-simple" ,perl-pod-simple)
216 ("docbook-xml" ,docbook-xml)
219 ("startup-notification" ,startup-notification)
225 ("pkg-config" ,pkg-config)
226 ;; For building the documentation.
227 ("docbook-xsl" ,docbook-xsl)))
228 (home-page "https://i3wm.org/")
229 (synopsis "Improved tiling window manager")
230 (description "A tiling window manager, completely written
231 from scratch. i3 is primarily targeted at advanced users and
233 (license license:bsd-3)))
235 (define-public python-i3-py
237 (name "python-i3-py")
241 ;; The latest release is not tagged in Git nor has an entry in PyPi,
242 ;; but there is still a clear commit for it, and it's been the last one
246 (url "https://github.com/ziberna/i3-py.git")
247 (commit "27f88a616e9ecc340e7d041d3d00782f8a1964c1")))
250 "1nm719dc2xqlll7vj4c4m7mpjb27lpn3bg3c66gajvnrz2x1nmxs"))
251 (file-name (string-append name "-" version "-checkout"))))
252 (build-system python-build-system)
254 `(#:tests? #f ; no tests yet
255 #:phases (modify-phases %standard-phases
256 (add-after 'install 'install-doc
257 ;; Copy readme file to documentation directory.
258 (lambda* (#:key outputs #:allow-other-keys)
259 (let ((doc (string-append (assoc-ref outputs "out")
260 "/share/doc/" ,name)))
261 (install-file "README.md" doc)
262 ;; Avoid unspecified return value.
266 (home-page "https://github.com/ziberna/i3-py")
267 (synopsis "Python interface to the i3 window manager")
268 (description "This package allows you to interact from a Python program
269 with the i3 window manager via its IPC socket. It can send commands and other
270 kinds of messages to i3, select the affected containers, filter results and
271 subscribe to events.")
272 (license license:gpl3+)))
274 (define-public python2-i3-py
275 (package-with-python2 python-i3-py))
277 (define-public quickswitch-i3
278 (let ((commit "ed692b1e8f43b95bd907ced26238ce8ccb2ed28f")
279 (revision "1")) ; Guix package revision
281 (name "quickswitch-i3")
282 (version (string-append "2.2-" revision "."
283 (string-take commit 7)))
286 ;; The latest commit is a few years old and just a couple commits
287 ;; after the last tagged release, so we use that latest commit
288 ;; instead of the release.
291 (url "https://github.com/proxypoke/quickswitch-for-i3.git")
295 "0447077sama80jcdg5p64zjsvafmz5rbdrirhm1adcdjhkh6iqc5"))
296 (patches (search-patches "quickswitch-fix-dmenu-check.patch"))
297 (file-name (string-append name "-" version "-checkout"))))
298 (build-system python-build-system)
300 `(#:tests? #f ; no tests yet
301 #:phases (modify-phases %standard-phases
302 (add-after 'install 'install-doc
303 ;; Copy readme file to documentation directory.
304 (lambda* (#:key outputs #:allow-other-keys)
305 (let ((doc (string-append (assoc-ref outputs "out")
306 "/share/doc/" ,name)))
307 (install-file "README.rst" doc)
308 ;; Avoid unspecified return value.
311 `(("python-i3-py" ,python-i3-py)
313 (home-page "https://github.com/proxypoke/quickswitch-for-i3")
314 (synopsis "Quickly change to and locate windows in the i3 window manager")
316 "This utility for the i3 window manager allows you to quickly switch to
317 and locate windows on all your workspaces, using an interactive dmenu
319 (license (license:non-copyleft "http://www.wtfpl.net/txt/copying/")))))
321 (define-public xmonad
325 (synopsis "Tiling window manager")
328 (uri (string-append "mirror://hackage/package/xmonad/"
329 name "-" version ".tar.gz"))
332 "1mzx3p17ppgmi30q3phaj58x6kxn73pbbkn9v9gzgmd8skdlkxp8"))))
333 (build-system haskell-build-system)
335 `(("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
337 ("ghc-quickcheck" ,ghc-quickcheck)
338 ("ghc-setlocale" ,ghc-setlocale)
339 ("ghc-utf8-string" ,ghc-utf8-string)
340 ("ghc-x11" ,ghc-x11)))
343 (modify-phases %standard-phases
345 'install 'install-xsession
347 (let* ((xsessions (string-append %output "/share/xsessions")))
349 (call-with-output-file
350 (string-append xsessions "/xmonad.desktop")
357 Type=Application~%" ,name ,synopsis %output)))))))))
358 (home-page "http://xmonad.org")
360 "Xmonad is a tiling window manager for X. Windows are arranged
361 automatically to tile the screen without gaps or overlap, maximising screen
362 use. All features of the window manager are accessible from the keyboard: a
363 mouse is strictly optional. Xmonad is written and extensible in Haskell.
364 Custom layout algorithms, and other extensions, may be written by the user in
365 config files. Layouts are applied dynamically, and different layouts may be
366 used on each workspace. Xinerama is fully supported, allowing windows to be
367 tiled on several screens.")
368 (license license:bsd-3)))
370 (define-public ghc-xmonad-contrib
372 (name "ghc-xmonad-contrib")
377 (uri (string-append "mirror://hackage/package/xmonad-contrib/"
378 "xmonad-contrib-" version ".tar.gz"))
381 "04gk449dxwmimmb6y2d2hvvmv91r91xlj879qzlyq0mcf723278k"))))
382 (build-system haskell-build-system)
384 `(("ghc-mtl" ,ghc-mtl)
385 ("ghc-old-time" ,ghc-old-time)
386 ("ghc-random" ,ghc-random)
387 ("ghc-utf8-string" ,ghc-utf8-string)
388 ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
390 ("ghc-x11-xft" ,ghc-x11-xft)
392 (home-page "http://xmonad.org")
393 (synopsis "Third party extensions for xmonad")
395 "Third party tiling algorithms, configurations, and scripts to Xmonad, a
396 tiling window manager for X.")
397 (license license:bsd-3)))
399 (define-public evilwm
406 (uri (string-append "http://www.6809.org.uk/evilwm/evilwm-"
410 "0ak0yajzk3v4dg5wmaghv6acf7v02a4iw8qxmq5yw5ard8lrqn3r"))
411 (patches (search-patches "evilwm-lost-focus-bug.patch"))))
412 (build-system gnu-build-system)
416 ("libxrandr" ,libxrandr)))
418 `(#:modules ((srfi srfi-26)
420 (guix build gnu-build-system))
421 #:make-flags (let ((inputs (map (cut assoc-ref %build-inputs <>)
422 '("libx11" "libxext" "libxrandr")))
423 (join (lambda (proc strs)
424 (string-join (map proc strs) " ")))
425 (dash-I (cut string-append "-I" <> "/include"))
426 (dash-L (cut string-append "-L" <> "/lib")))
427 `("desktopfilesdir=$(prefix)/share/xsessions"
428 ,(string-append "prefix=" (assoc-ref %outputs "out"))
429 ,(string-append "CPPFLAGS=" (join dash-I inputs))
430 ,(string-append "LDFLAGS=" (join dash-L inputs))))
431 #:tests? #f ;no tests
432 #:phases (modify-phases %standard-phases
433 (delete 'configure)))) ;no configure script
434 (home-page "http://www.6809.org.uk/evilwm/")
435 (synopsis "Minimalist window manager for the X Window System")
437 "evilwm is a minimalist window manager based on aewm, extended to feature
438 many keyboard controls with repositioning and maximize toggles, solid window
439 drags, snap-to-border support, and virtual desktops.")
440 (license (license:x11-style "file:///README"))))
442 (define-public fluxbox
446 (synopsis "Small and fast window manager")
449 (uri (string-append "mirror://sourceforge/fluxbox/fluxbox/"
450 version "/fluxbox-" version ".tar.xz"))
453 "1h1f70y40qd225dqx937vzb4k2cz219agm1zvnjxakn5jkz7b37w"))))
454 (build-system gnu-build-system)
456 `(#:make-flags '("CPPFLAGS=-U__TIME__") ;ugly, but for reproducibility
458 (modify-phases %standard-phases
460 'install 'install-xsession
462 (let ((xsessions (string-append %output "/share/xsessions")))
464 (call-with-output-file
465 (string-append xsessions "/fluxbox.desktop")
471 Exec=~a/bin/startfluxbox~@
472 Type=Application~%" ,name ,synopsis %output)))))))))
474 `(("pkg-config" ,pkg-config)))
476 `(("freetype" ,freetype)
482 ("libxinerama" ,libxinerama)
484 ("libxrandr" ,libxrandr)
485 ("libxrender" ,libxrender)))
486 (description "Fluxbox is a window manager. It is light on resources
487 and easy to handle yet full of features to make an easy and fast desktop
489 (home-page "http://fluxbox.org/")
490 (license license:expat)))
492 (define-public awesome
497 (origin (method url-fetch)
499 "https://github.com/awesomeWM/awesome-releases/raw/"
500 "master/awesome-" version ".tar.xz"))
503 "0czkcz67sab63gf5m2p2pgg05yinjx60hfb9rfyzdkkg28q9f02w"))
504 (modules '((guix build utils)
507 ;; Remove non-reproducible timestamp and use the date of the
508 ;; source file instead.
509 '(substitute* "common/version.c"
510 (("__DATE__ \" \" __TIME__")
513 (make-time time-utc 0
514 (stat:mtime (stat "awesome.c"))))
516 (patches (search-patches "awesome-reproducible-png.patch"))))
517 (build-system cmake-build-system)
518 (native-inputs `(("asciidoc" ,asciidoc)
519 ("docbook-xsl" ,docbook-xsl)
522 ("imagemagick" ,imagemagick)
523 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
524 ("pkg-config" ,pkg-config)
526 (inputs `(("cairo" ,cairo)
528 ("gdk-pixbuf" ,gdk-pixbuf)
530 ("gobject-introspection" ,gobject-introspection)
534 ("libxcursor" ,libxcursor)
535 ("libxdg-basedir" ,libxdg-basedir)
536 ("libxkbcommon" ,libxkbcommon)
540 ("startup-notification" ,startup-notification)
541 ("xcb-util" ,xcb-util)
542 ("xcb-util-cursor" ,xcb-util-cursor)
543 ("xcb-util-image" ,xcb-util-image)
544 ("xcb-util-keysyms" ,xcb-util-keysyms)
545 ("xcb-util-renderutil" ,xcb-util-renderutil)
546 ("xcb-util-xrm" ,xcb-util-xrm)
547 ("xcb-util-wm" ,xcb-util-wm)))
549 `(;; Let compression happen in our 'compress-documentation' phase so that
550 ;; '--no-name' is used, which removes timestamps from gzip output.
551 #:configure-flags '("-DCOMPRESS_MANPAGES=off")
554 (modify-phases %standard-phases
555 (add-before 'build 'xmlto-skip-validation
557 ;; We can't download the necessary schema, so so skip
558 ;; validation and assume they're valid.
559 (substitute* "../build/CMakeFiles/man.dir/build.make"
561 (string-append "/xmlto --skip-validation")))
563 (add-before 'configure 'set-lua-paths
564 (lambda* (#:key inputs #:allow-other-keys)
565 ;; The build process needs to load cairo dynamically.
566 (let* ((cairo (string-append
567 (assoc-ref inputs "cairo") "/lib" ))
568 (lua-lgi (assoc-ref inputs "lua-lgi") ))
569 (setenv "LD_LIBRARY_PATH" cairo )
570 (setenv "LUA_PATH" (string-append lua-lgi
571 "/share/lua/5.2/?.lua"))
572 (setenv "LUA_CPATH" (string-append lua-lgi
573 "/lib/lua/5.2/?.so"))
577 ;; There aren't any tests, so just make sure the binary
578 ;; gets built and can be run successfully.
579 (zero? (system* "../build/awesome" "-v"))))
580 (add-after 'install 'wrap
581 (lambda* (#:key inputs outputs #:allow-other-keys)
582 (let* ((awesome (assoc-ref outputs "out"))
583 (cairo (string-append
584 (assoc-ref inputs "cairo") "/lib" ))
585 (lua-lgi (assoc-ref inputs "lua-lgi") ))
586 (wrap-program (string-append awesome "/bin/awesome")
587 `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))
588 `("LD_LIBRARY_PATH" suffix (, cairo))
589 `("LUA_PATH" suffix (,(string-append lua-lgi
590 "/share/lua/5.2/?.lua")))
591 `("LUA_CPATH" suffix (,(string-append
592 lua-lgi "/lib/lua/5.2/?.so"))))))))))
593 (synopsis "Highly configurable window manager")
595 "Awesome has been designed as a framework window manager. It is fast, small,
596 dynamic and extensible using the Lua programming language.")
597 (license license:gpl2+)
598 (home-page "https://awesome.naquadah.org/")))
600 (define-public menumaker
607 (uri (string-append "mirror://sourceforge/menumaker/"
608 "menumaker-" version ".tar.gz"))
611 "1mm4cvg3kphkkd8nwrhcg6d9nm5ar7mgc0wf6fxk6zck1l7xn8ky"))))
612 (build-system gnu-build-system)
614 `(("python" ,python)))
615 (synopsis "Heuristics-driven menu generator")
617 "MenuMaker is a menu generation utility for a number of X window
618 managers and desktop environments. It is capable of finding lots of
619 installed programs and generating a root menu consistent across all
620 supported window managers, so one will get (almost) the same menu in
621 all of them. Currently supported window managers include:
633 (home-page "http://menumaker.sourceforge.net/")
634 (license license:bsd-2)))