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 "1d3q3lgpjbkmcwzjhp0dfr0jq847silcfg087slcnj95ikh1r7p1"))))
173 (build-system gnu-build-system)
175 `(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
177 (modify-phases %standard-phases
179 #:tests? #f)) ; no test suite
182 ("xcb-util" ,xcb-util)
183 ("xcb-util-cursor" ,xcb-util-cursor)
184 ("xcb-util-keysyms" ,xcb-util-keysyms)
185 ("xcb-util-wm" ,xcb-util-wm)
186 ("libxkbcommon" ,libxkbcommon)
189 ("asciidoc" ,asciidoc)
191 ("perl-pod-simple" ,perl-pod-simple)
192 ("docbook-xml" ,docbook-xml)
195 ("startup-notification" ,startup-notification)
201 ("pkg-config" ,pkg-config)))
202 (home-page "https://i3wm.org/")
203 (synopsis "Improved tiling window manager")
204 (description "A tiling window manager, completely written
205 from scratch. i3 is primarily targeted at advanced users and
207 (license license:bsd-3)))
209 (define-public python-i3-py
211 (name "python-i3-py")
215 ;; The latest release is not tagged in Git nor has an entry in PyPi,
216 ;; but there is still a clear commit for it, and it's been the last one
220 (url "https://github.com/ziberna/i3-py.git")
221 (commit "27f88a616e9ecc340e7d041d3d00782f8a1964c1")))
224 "1nm719dc2xqlll7vj4c4m7mpjb27lpn3bg3c66gajvnrz2x1nmxs"))
225 (file-name (string-append name "-" version "-checkout"))))
226 (build-system python-build-system)
228 `(#:tests? #f ; no tests yet
229 #:phases (modify-phases %standard-phases
230 (add-after 'install 'install-doc
231 ;; Copy readme file to documentation directory.
232 (lambda* (#:key outputs #:allow-other-keys)
233 (let ((doc (string-append (assoc-ref outputs "out")
234 "/share/doc/" ,name)))
235 (install-file "README.md" doc)
236 ;; Avoid unspecified return value.
240 (home-page "https://github.com/ziberna/i3-py")
241 (synopsis "Python interface to the i3 window manager")
242 (description "This package allows you to interact from a Python program
243 with the i3 window manager via its IPC socket. It can send commands and other
244 kinds of messages to i3, select the affected containers, filter results and
245 subscribe to events.")
246 (license license:gpl3+)))
248 (define-public python2-i3-py
249 (package-with-python2 python-i3-py))
251 (define-public quickswitch-i3
252 (let ((commit "ed692b1e8f43b95bd907ced26238ce8ccb2ed28f")
253 (revision "1")) ; Guix package revision
255 (name "quickswitch-i3")
256 (version (string-append "2.2-" revision "."
257 (string-take commit 7)))
260 ;; The latest commit is a few years old and just a couple commits
261 ;; after the last tagged release, so we use that latest commit
262 ;; instead of the release.
265 (url "https://github.com/proxypoke/quickswitch-for-i3.git")
269 "0447077sama80jcdg5p64zjsvafmz5rbdrirhm1adcdjhkh6iqc5"))
270 (patches (search-patches "quickswitch-fix-dmenu-check.patch"))
271 (file-name (string-append name "-" version "-checkout"))))
272 (build-system python-build-system)
274 `(#:tests? #f ; no tests yet
275 #:phases (modify-phases %standard-phases
276 (add-after 'install 'install-doc
277 ;; Copy readme file to documentation directory.
278 (lambda* (#:key outputs #:allow-other-keys)
279 (let ((doc (string-append (assoc-ref outputs "out")
280 "/share/doc/" ,name)))
281 (install-file "README.rst" doc)
282 ;; Avoid unspecified return value.
285 `(("python-i3-py" ,python-i3-py)
287 (home-page "https://github.com/proxypoke/quickswitch-for-i3")
288 (synopsis "Quickly change to and locate windows in the i3 window manager")
290 "This utility for the i3 window manager allows you to quickly switch to
291 and locate windows on all your workspaces, using an interactive dmenu
293 (license (license:non-copyleft "http://www.wtfpl.net/txt/copying/")))))
295 (define-public xmonad
299 (synopsis "Tiling window manager")
302 (uri (string-append "mirror://hackage/package/xmonad/"
303 name "-" version ".tar.gz"))
306 "1pfjssamiwpwjp1qqkm9m9p9s35pv381m0cwg6jxg0ppglibzq1r"))
307 (modules '((guix build utils)))
309 ;; Here we update the constraints on the utf8-string package in
310 ;; the Cabal file. We allow a newer version which is compatible
311 ;; with GHC 7.10.2. The same change is applied on Hackage. See
312 ;; <https://hackage.haskell.org/package/xmonad-0.11.1/revisions/>.
313 '(substitute* "xmonad.cabal"
314 (("utf8-string >= 0.3 && < 0.4")
315 "utf8-string >= 0.3 && < 1.1")))))
316 (build-system haskell-build-system)
318 `(("ghc-mtl" ,ghc-mtl)
319 ("ghc-utf8-string" ,ghc-utf8-string)
320 ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
321 ("ghc-x11" ,ghc-x11)))
324 (modify-phases %standard-phases
326 'install 'install-xsession
328 (let* ((xsessions (string-append %output "/share/xsessions")))
330 (call-with-output-file
331 (string-append xsessions "/xmonad.desktop")
338 Type=Application~%" ,name ,synopsis %output)))))))))
339 (home-page "http://xmonad.org")
341 "Xmonad is a tiling window manager for X. Windows are arranged
342 automatically to tile the screen without gaps or overlap, maximising screen
343 use. All features of the window manager are accessible from the keyboard: a
344 mouse is strictly optional. Xmonad is written and extensible in Haskell.
345 Custom layout algorithms, and other extensions, may be written by the user in
346 config files. Layouts are applied dynamically, and different layouts may be
347 used on each workspace. Xinerama is fully supported, allowing windows to be
348 tiled on several screens.")
349 (license license:bsd-3)))
351 (define-public ghc-xmonad-contrib
353 (name "ghc-xmonad-contrib")
358 (uri (string-append "mirror://hackage/package/xmonad-contrib/"
359 "xmonad-contrib-" version ".tar.gz"))
362 "1g5cw9vvnfbiyi599fngk02zlmdhrf82x0bndhypkn6kybab6yd3"))))
363 (build-system haskell-build-system)
365 `(("ghc-mtl" ,ghc-mtl)
366 ("ghc-old-time" ,ghc-old-time)
367 ("ghc-random" ,ghc-random)
368 ("ghc-utf8-string" ,ghc-utf8-string)
369 ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
371 ("ghc-x11-xft" ,ghc-x11-xft)
373 (home-page "http://xmonad.org")
374 (synopsis "Third party extensions for xmonad")
376 "Third party tiling algorithms, configurations, and scripts to Xmonad, a
377 tiling window manager for X.")
378 (license license:bsd-3)))
380 (define-public evilwm
387 (uri (string-append "http://www.6809.org.uk/evilwm/evilwm-"
391 "0ak0yajzk3v4dg5wmaghv6acf7v02a4iw8qxmq5yw5ard8lrqn3r"))
392 (patches (search-patches "evilwm-lost-focus-bug.patch"))))
393 (build-system gnu-build-system)
397 ("libxrandr" ,libxrandr)))
399 `(#:modules ((srfi srfi-26)
401 (guix build gnu-build-system))
402 #:make-flags (let ((inputs (map (cut assoc-ref %build-inputs <>)
403 '("libx11" "libxext" "libxrandr")))
404 (join (lambda (proc strs)
405 (string-join (map proc strs) " ")))
406 (dash-I (cut string-append "-I" <> "/include"))
407 (dash-L (cut string-append "-L" <> "/lib")))
408 `("desktopfilesdir=$(prefix)/share/xsessions"
409 ,(string-append "prefix=" (assoc-ref %outputs "out"))
410 ,(string-append "CPPFLAGS=" (join dash-I inputs))
411 ,(string-append "LDFLAGS=" (join dash-L inputs))))
412 #:tests? #f ;no tests
413 #:phases (modify-phases %standard-phases
414 (delete 'configure)))) ;no configure script
415 (home-page "http://www.6809.org.uk/evilwm/")
416 (synopsis "Minimalist window manager for the X Window System")
418 "evilwm is a minimalist window manager based on aewm, extended to feature
419 many keyboard controls with repositioning and maximize toggles, solid window
420 drags, snap-to-border support, and virtual desktops.")
421 (license (license:x11-style "file:///README"))))
423 (define-public fluxbox
427 (synopsis "Small and fast window manager")
430 (uri (string-append "mirror://sourceforge/fluxbox/fluxbox/"
431 version "/fluxbox-" version ".tar.xz"))
434 "1h1f70y40qd225dqx937vzb4k2cz219agm1zvnjxakn5jkz7b37w"))))
435 (build-system gnu-build-system)
437 `(#:make-flags '("CPPFLAGS=-U__TIME__") ;ugly, but for reproducibility
439 (modify-phases %standard-phases
441 'install 'install-xsession
443 (let ((xsessions (string-append %output "/share/xsessions")))
445 (call-with-output-file
446 (string-append xsessions "/fluxbox.desktop")
452 Exec=~a/bin/startfluxbox~@
453 Type=Application~%" ,name ,synopsis %output)))))))))
455 `(("pkg-config" ,pkg-config)))
457 `(("freetype" ,freetype)
463 ("libxinerama" ,libxinerama)
465 ("libxrandr" ,libxrandr)
466 ("libxrender" ,libxrender)))
467 (description "Fluxbox is a window manager. It is light on resources
468 and easy to handle yet full of features to make an easy and fast desktop
470 (home-page "http://fluxbox.org/")
471 (license license:expat)))
473 (define-public awesome
478 (origin (method url-fetch)
480 "https://awesome.naquadah.org/download/awesome-"
484 "0kynair1ykr74b39a4gcm2y24viial64337cf26nhlc7azjbby67"))
485 (modules '((guix build utils)
488 ;; Remove non-reproducible timestamp and use the date of the
489 ;; source file instead.
490 '(substitute* "common/version.c"
491 (("__DATE__ \" \" __TIME__")
494 (make-time time-utc 0
495 (stat:mtime (stat "awesome.c"))))
497 (patches (search-patches "awesome-reproducible-png.patch"))))
498 (build-system cmake-build-system)
499 (native-inputs `(("asciidoc" ,asciidoc)
500 ("docbook-xsl" ,docbook-xsl)
503 ("imagemagick" ,imagemagick)
504 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
505 ("pkg-config" ,pkg-config)
507 (inputs `(("cairo" ,cairo)
509 ("gdk-pixbuf" ,gdk-pixbuf)
511 ("gobject-introspection" ,gobject-introspection)
515 ("libxcursor" ,libxcursor)
516 ("libxdg-basedir" ,libxdg-basedir)
520 ("startup-notification" ,startup-notification)
521 ("xcb-util" ,xcb-util)
522 ("xcb-util-cursor" ,xcb-util-cursor)
523 ("xcb-util-image" ,xcb-util-image)
524 ("xcb-util-keysyms" ,xcb-util-keysyms)
525 ("xcb-util-renderutil" ,xcb-util-renderutil)
526 ("xcb-util-wm" ,xcb-util-wm)))
528 `(;; Let compression happen in our 'compress-documentation' phase so that
529 ;; '--no-name' is used, which removes timestamps from gzip output.
530 #:configure-flags '("-DCOMPRESS_MANPAGES=off")
533 (modify-phases %standard-phases
534 (add-before 'build 'xmlto-skip-validation
536 ;; We can't download the necessary schema, so so skip
537 ;; validation and assume they're valid.
538 (substitute* "../build/CMakeFiles/man.dir/build.make"
540 (string-append "/xmlto --skip-validation")))
542 (add-before 'configure 'set-lua-paths
543 (lambda* (#:key inputs #:allow-other-keys)
544 ;; The build process needs to load cairo dynamically.
545 (let* ((cairo (string-append
546 (assoc-ref inputs "cairo") "/lib" ))
547 (lua-lgi (assoc-ref inputs "lua-lgi") ))
548 (setenv "LD_LIBRARY_PATH" cairo )
549 (setenv "LUA_PATH" (string-append lua-lgi
550 "/share/lua/5.2/?.lua"))
551 (setenv "LUA_CPATH" (string-append lua-lgi
552 "/lib/lua/5.2/?.so"))
556 ;; There aren't any tests, so just make sure the binary
557 ;; gets built and can be run successfully.
558 (zero? (system* "../build/awesome" "-v"))))
559 (add-after 'install 'wrap
560 (lambda* (#:key inputs outputs #:allow-other-keys)
561 (let* ((awesome (assoc-ref outputs "out"))
562 (cairo (string-append
563 (assoc-ref inputs "cairo") "/lib" ))
564 (lua-lgi (assoc-ref inputs "lua-lgi") ))
565 (wrap-program (string-append awesome "/bin/awesome")
566 `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))
567 `("LD_LIBRARY_PATH" suffix (, cairo))
568 `("LUA_PATH" suffix (,(string-append lua-lgi
569 "/share/lua/5.2/?.lua")))
570 `("LUA_CPATH" suffix (,(string-append
571 lua-lgi "/lib/lua/5.2/?.so"))))))))))
572 (synopsis "Highly configurable window manager")
574 "Awesome has been designed as a framework window manager. It is fast, small,
575 dynamic and extensible using the Lua programming language.")
576 (license license:gpl2+)
577 (home-page "https://awesome.naquadah.org/")))