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>
16 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages wm)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages linux)
38 #:use-module (guix build-system cmake)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system haskell)
41 #:use-module (guix build-system perl)
42 #:use-module (guix build-system python)
43 #:use-module (gnu packages haskell)
44 #:use-module (gnu packages base)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages pulseaudio)
48 #:use-module (gnu packages xorg)
49 #:use-module (gnu packages xdisorg)
50 #:use-module (gnu packages documentation)
51 #:use-module (gnu packages xml)
52 #:use-module (gnu packages m4)
53 #:use-module (gnu packages docbook)
54 #:use-module (gnu packages image)
55 #:use-module (gnu packages pcre)
56 #:use-module (gnu packages python)
57 #:use-module (gnu packages gtk)
58 #:use-module (gnu packages libevent)
59 #:use-module (gnu packages fribidi)
60 #:use-module (gnu packages maths)
61 #:use-module (gnu packages web)
62 #:use-module (gnu packages fontutils)
63 #:use-module (gnu packages freedesktop)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages gperf)
66 #:use-module (gnu packages imagemagick)
67 #:use-module (gnu packages lua)
68 #:use-module (gnu packages suckless)
69 #:use-module (guix download)
70 #:use-module (guix git-download))
72 (define-public libconfuse
78 (uri (string-append "https://github.com/martinh/libconfuse/"
79 "releases/download/v" version
80 "/confuse-" version ".tar.xz"))
83 "0rnacgfkd88qyxrfdfzn9cxz533l9s5wrzb9093f9mbi00gg6wc1"))))
84 (build-system gnu-build-system)
85 (home-page "https://github.com/martinh/libconfuse")
86 (synopsis "Configuration file parser library")
87 (description "libconfuse is a configuration file parser library. It
88 supports sections and (lists of) values (strings, integers, floats, booleans
89 or other sections), as well as some other features (such as
90 single/double-quoted strings, environment variable expansion, functions and
91 nested include statements).")
92 (license license:isc)))
100 (file-name (string-append name "-" version ".tar.gz"))
103 "https://github.com/baskerville/bspwm/archive/"
107 "1pig0h2jk8wipyz90j69c4bk37bfyq60asnn0v0bqld2p2vjvyqy"))))
108 (build-system gnu-build-system)
111 ("libxinerama" ,libxinerama)
113 ("xcb-util" ,xcb-util)
114 ("xcb-util-keysyms" ,xcb-util-keysyms)
115 ("xcb-util-wm" ,xcb-util-wm)))
117 '(#:phases (alist-delete 'configure %standard-phases)
118 #:tests? #f ; no check target
119 #:make-flags (list "CC=gcc"
120 (string-append "PREFIX=" %output))))
121 (home-page "https://github.com/baskerville/bspwm")
122 (synopsis "Tiling window manager based on binary space partitioning")
123 (description "bspwm is a tiling window manager that represents windows as
124 the leaves of a full binary tree.")
125 (license license:bsd-2)))
127 (define-public i3status
133 (uri (string-append "https://i3wm.org/i3status/i3status-"
137 "0pwcy599fw8by1a1sf91crkqba7679qhvhbacpmhis8c1xrpxnwq"))))
138 (build-system gnu-build-system)
140 `(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
142 (modify-phases %standard-phases
144 #:tests? #f)) ; no test suite
146 `(("openlibm" ,openlibm)
147 ("libconfuse" ,libconfuse)
149 ("alsa-lib" ,alsa-lib)
150 ("pulseaudio" ,pulseaudio)
153 ("asciidoc" ,asciidoc)))
155 `(("pkg-config" ,pkg-config)))
156 (home-page "https://i3wm.org/i3status/")
157 (synopsis "Status bar for i3bar, dzen2, xmobar or similar programs")
158 (description "i3status is a small program for generating a status bar for
159 i3bar, dzen2, xmobar or similar programs. It is designed to be very efficient
160 by issuing a very small number of system calls, as one generally wants to
161 update such a status line every second. This ensures that even under high
162 load, your status bar is updated correctly. Also, it saves a bit of energy by
163 not hogging your CPU as much as spawning the corresponding amount of shell
165 (license license:bsd-3)))
173 (uri (string-append "https://i3wm.org/downloads/i3-"
177 "12ngz32swh9n85xy0cz1lq16aqi9ys5hq19v589q9a97wn1k3hcl"))))
178 (build-system gnu-build-system)
182 (string-append "PREFIX=" %output)
183 ;; This works around the following error:
184 ;; 'error: ‘for’ loop initial declarations are only allowed in C99
187 ;; The build system tries to build in a separate directory, but that
188 ;; seems to be unnecessary.
189 #:configure-flags '("--disable-builddir")
190 ;; The test suite appears to require the unpackaged Perl module AnyEvent.
194 ("xcb-util" ,xcb-util)
195 ("xcb-util-cursor" ,xcb-util-cursor)
196 ("xcb-util-keysyms" ,xcb-util-keysyms)
197 ("xcb-util-wm" ,xcb-util-wm)
198 ("xcb-util-xrm" ,xcb-util-xrm)
199 ("libxkbcommon" ,libxkbcommon)
202 ("asciidoc" ,asciidoc)
204 ("perl-pod-simple" ,perl-pod-simple)
207 ("startup-notification" ,startup-notification)
213 ("pkg-config" ,pkg-config)
214 ;; For building the documentation.
216 ("docbook-xsl" ,docbook-xsl)))
217 (home-page "https://i3wm.org/")
218 (synopsis "Improved tiling window manager")
219 (description "A tiling window manager, completely written
220 from scratch. i3 is primarily targeted at advanced users and
222 (license license:bsd-3)))
224 (define-public perl-anyevent-i3
226 (name "perl-anyevent-i3")
230 (uri (string-append "mirror://cpan/authors/id/M/MS/MSTPLBG/"
231 "AnyEvent-I3-" version ".tar.gz"))
234 "1qwva5vmmn929l6k9wzhp4h80ad4qm4m1g2dyv4nlas624003hig"))))
235 (build-system perl-build-system)
237 `(("perl-anyevent" ,perl-anyevent)
238 ("perl-json-xs" ,perl-json-xs)))
239 (home-page "http://search.cpan.org/dist/AnyEvent-I3")
241 "Communicate with the i3 window manager through perl")
243 "This module connects to the i3 window manager using the UNIX socket
244 based IPC interface it provides (if enabled in the configuration file).
245 You can then subscribe to events or send messages and receive their replies.")
246 ;; Can be used with either license.
247 (license (list license:gpl3+ license:perl-license))))
249 (define-public python-i3-py
251 (name "python-i3-py")
255 ;; The latest release is not tagged in Git nor has an entry in PyPi,
256 ;; but there is still a clear commit for it, and it's been the last one
260 (url "https://github.com/ziberna/i3-py.git")
261 (commit "27f88a616e9ecc340e7d041d3d00782f8a1964c1")))
264 "1nm719dc2xqlll7vj4c4m7mpjb27lpn3bg3c66gajvnrz2x1nmxs"))
265 (file-name (string-append name "-" version "-checkout"))))
266 (build-system python-build-system)
268 `(#:tests? #f ; no tests yet
269 #:phases (modify-phases %standard-phases
270 (add-after 'install 'install-doc
271 ;; Copy readme file to documentation directory.
272 (lambda* (#:key outputs #:allow-other-keys)
273 (let ((doc (string-append (assoc-ref outputs "out")
274 "/share/doc/" ,name)))
275 (install-file "README.md" doc)
276 ;; Avoid unspecified return value.
280 (home-page "https://github.com/ziberna/i3-py")
281 (synopsis "Python interface to the i3 window manager")
282 (description "This package allows you to interact from a Python program
283 with the i3 window manager via its IPC socket. It can send commands and other
284 kinds of messages to i3, select the affected containers, filter results and
285 subscribe to events.")
286 (license license:gpl3+)))
288 (define-public python2-i3-py
289 (package-with-python2 python-i3-py))
291 (define-public quickswitch-i3
292 (let ((commit "ed692b1e8f43b95bd907ced26238ce8ccb2ed28f")
293 (revision "1")) ; Guix package revision
295 (name "quickswitch-i3")
296 (version (string-append "2.2-" revision "."
297 (string-take commit 7)))
300 ;; The latest commit is a few years old and just a couple commits
301 ;; after the last tagged release, so we use that latest commit
302 ;; instead of the release.
305 (url "https://github.com/proxypoke/quickswitch-for-i3.git")
309 "0447077sama80jcdg5p64zjsvafmz5rbdrirhm1adcdjhkh6iqc5"))
310 (patches (search-patches "quickswitch-fix-dmenu-check.patch"))
311 (file-name (string-append name "-" version "-checkout"))))
312 (build-system python-build-system)
314 `(#:tests? #f ; no tests yet
315 #:phases (modify-phases %standard-phases
316 (add-after 'install 'install-doc
317 ;; Copy readme file to documentation directory.
318 (lambda* (#:key outputs #:allow-other-keys)
319 (let ((doc (string-append (assoc-ref outputs "out")
320 "/share/doc/" ,name)))
321 (install-file "README.rst" doc)
322 ;; Avoid unspecified return value.
325 `(("python-i3-py" ,python-i3-py)
327 (home-page "https://github.com/proxypoke/quickswitch-for-i3")
328 (synopsis "Quickly change to and locate windows in the i3 window manager")
330 "This utility for the i3 window manager allows you to quickly switch to
331 and locate windows on all your workspaces, using an interactive dmenu
333 (license (license:non-copyleft "http://www.wtfpl.net/txt/copying/")))))
335 (define-public xmonad
339 (synopsis "Tiling window manager")
342 (uri (string-append "mirror://hackage/package/xmonad/"
343 name "-" version ".tar.gz"))
346 "1mzx3p17ppgmi30q3phaj58x6kxn73pbbkn9v9gzgmd8skdlkxp8"))))
347 (build-system haskell-build-system)
349 `(("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
351 ("ghc-quickcheck" ,ghc-quickcheck)
352 ("ghc-setlocale" ,ghc-setlocale)
353 ("ghc-utf8-string" ,ghc-utf8-string)
354 ("ghc-x11" ,ghc-x11)))
357 (modify-phases %standard-phases
359 'install 'install-xsession
361 (let* ((xsessions (string-append %output "/share/xsessions")))
363 (call-with-output-file
364 (string-append xsessions "/xmonad.desktop")
371 Type=Application~%" ,name ,synopsis %output)))))))))
372 (home-page "http://xmonad.org")
374 "Xmonad is a tiling window manager for X. Windows are arranged
375 automatically to tile the screen without gaps or overlap, maximising screen
376 use. All features of the window manager are accessible from the keyboard: a
377 mouse is strictly optional. Xmonad is written and extensible in Haskell.
378 Custom layout algorithms, and other extensions, may be written by the user in
379 config files. Layouts are applied dynamically, and different layouts may be
380 used on each workspace. Xinerama is fully supported, allowing windows to be
381 tiled on several screens.")
382 (license license:bsd-3)))
384 (define-public ghc-xmonad-contrib
386 (name "ghc-xmonad-contrib")
391 (uri (string-append "mirror://hackage/package/xmonad-contrib/"
392 "xmonad-contrib-" version ".tar.gz"))
395 "04gk449dxwmimmb6y2d2hvvmv91r91xlj879qzlyq0mcf723278k"))))
396 (build-system haskell-build-system)
398 `(("ghc-mtl" ,ghc-mtl)
399 ("ghc-old-time" ,ghc-old-time)
400 ("ghc-random" ,ghc-random)
401 ("ghc-utf8-string" ,ghc-utf8-string)
402 ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
404 ("ghc-x11-xft" ,ghc-x11-xft)
406 (home-page "http://xmonad.org")
407 (synopsis "Third party extensions for xmonad")
409 "Third party tiling algorithms, configurations, and scripts to Xmonad, a
410 tiling window manager for X.")
411 (license license:bsd-3)))
413 (define-public evilwm
420 (uri (string-append "http://www.6809.org.uk/evilwm/evilwm-"
424 "0ak0yajzk3v4dg5wmaghv6acf7v02a4iw8qxmq5yw5ard8lrqn3r"))
425 (patches (search-patches "evilwm-lost-focus-bug.patch"))))
426 (build-system gnu-build-system)
430 ("libxrandr" ,libxrandr)))
432 `(#:modules ((srfi srfi-26)
434 (guix build gnu-build-system))
435 #:make-flags (let ((inputs (map (cut assoc-ref %build-inputs <>)
436 '("libx11" "libxext" "libxrandr")))
437 (join (lambda (proc strs)
438 (string-join (map proc strs) " ")))
439 (dash-I (cut string-append "-I" <> "/include"))
440 (dash-L (cut string-append "-L" <> "/lib")))
441 `("desktopfilesdir=$(prefix)/share/xsessions"
442 ,(string-append "prefix=" (assoc-ref %outputs "out"))
443 ,(string-append "CPPFLAGS=" (join dash-I inputs))
444 ,(string-append "LDFLAGS=" (join dash-L inputs))))
445 #:tests? #f ;no tests
446 #:phases (modify-phases %standard-phases
447 (delete 'configure)))) ;no configure script
448 (home-page "http://www.6809.org.uk/evilwm/")
449 (synopsis "Minimalist window manager for the X Window System")
451 "evilwm is a minimalist window manager based on aewm, extended to feature
452 many keyboard controls with repositioning and maximize toggles, solid window
453 drags, snap-to-border support, and virtual desktops.")
454 (license (license:x11-style "file:///README"))))
456 (define-public fluxbox
460 (synopsis "Small and fast window manager")
463 (uri (string-append "mirror://sourceforge/fluxbox/fluxbox/"
464 version "/fluxbox-" version ".tar.xz"))
467 "1h1f70y40qd225dqx937vzb4k2cz219agm1zvnjxakn5jkz7b37w"))))
468 (build-system gnu-build-system)
470 `(#:make-flags '("CPPFLAGS=-U__TIME__") ;ugly, but for reproducibility
472 (modify-phases %standard-phases
474 'install 'install-xsession
476 (let ((xsessions (string-append %output "/share/xsessions")))
478 (call-with-output-file
479 (string-append xsessions "/fluxbox.desktop")
485 Exec=~a/bin/startfluxbox~@
486 Type=Application~%" ,name ,synopsis %output)))))))))
488 `(("pkg-config" ,pkg-config)))
490 `(("freetype" ,freetype)
496 ("libxinerama" ,libxinerama)
498 ("libxrandr" ,libxrandr)
499 ("libxrender" ,libxrender)))
500 (description "Fluxbox is a window manager. It is light on resources
501 and easy to handle yet full of features to make an easy and fast desktop
503 (home-page "http://fluxbox.org/")
504 (license license:expat)))
506 (define-public awesome
511 (origin (method url-fetch)
513 "https://github.com/awesomeWM/awesome-releases/raw/"
514 "master/awesome-" version ".tar.xz"))
517 "0czkcz67sab63gf5m2p2pgg05yinjx60hfb9rfyzdkkg28q9f02w"))
518 (modules '((guix build utils)
521 ;; Remove non-reproducible timestamp and use the date of the
522 ;; source file instead.
523 '(substitute* "common/version.c"
524 (("__DATE__ \" \" __TIME__")
527 (make-time time-utc 0
528 (stat:mtime (stat "awesome.c"))))
530 (patches (search-patches "awesome-reproducible-png.patch"))))
531 (build-system cmake-build-system)
532 (native-inputs `(("asciidoc" ,asciidoc)
533 ("docbook-xsl" ,docbook-xsl)
536 ("imagemagick" ,imagemagick)
537 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
538 ("pkg-config" ,pkg-config)
540 (inputs `(("cairo" ,cairo)
542 ("gdk-pixbuf" ,gdk-pixbuf)
544 ("gobject-introspection" ,gobject-introspection)
548 ("libxcursor" ,libxcursor)
549 ("libxdg-basedir" ,libxdg-basedir)
550 ("libxkbcommon" ,libxkbcommon)
554 ("startup-notification" ,startup-notification)
555 ("xcb-util" ,xcb-util)
556 ("xcb-util-cursor" ,xcb-util-cursor)
557 ("xcb-util-image" ,xcb-util-image)
558 ("xcb-util-keysyms" ,xcb-util-keysyms)
559 ("xcb-util-renderutil" ,xcb-util-renderutil)
560 ("xcb-util-xrm" ,xcb-util-xrm)
561 ("xcb-util-wm" ,xcb-util-wm)))
563 `(;; Let compression happen in our 'compress-documentation' phase so that
564 ;; '--no-name' is used, which removes timestamps from gzip output.
565 #:configure-flags '("-DCOMPRESS_MANPAGES=off")
568 (modify-phases %standard-phases
569 (add-before 'build 'xmlto-skip-validation
571 ;; We can't download the necessary schema, so so skip
572 ;; validation and assume they're valid.
573 (substitute* "../build/CMakeFiles/man.dir/build.make"
575 (string-append "/xmlto --skip-validation")))
577 (add-before 'configure 'set-lua-paths
578 (lambda* (#:key inputs #:allow-other-keys)
579 ;; The build process needs to load cairo dynamically.
580 (let* ((cairo (string-append
581 (assoc-ref inputs "cairo") "/lib" ))
582 (lua-lgi (assoc-ref inputs "lua-lgi") ))
583 (setenv "LD_LIBRARY_PATH" cairo )
584 (setenv "LUA_PATH" (string-append lua-lgi
585 "/share/lua/5.2/?.lua"))
586 (setenv "LUA_CPATH" (string-append lua-lgi
587 "/lib/lua/5.2/?.so"))
591 ;; There aren't any tests, so just make sure the binary
592 ;; gets built and can be run successfully.
593 (zero? (system* "../build/awesome" "-v"))))
594 (add-after 'install 'wrap
595 (lambda* (#:key inputs outputs #:allow-other-keys)
596 (let* ((awesome (assoc-ref outputs "out"))
597 (cairo (string-append
598 (assoc-ref inputs "cairo") "/lib" ))
599 (lua-lgi (assoc-ref inputs "lua-lgi") ))
600 (wrap-program (string-append awesome "/bin/awesome")
601 `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH")))
602 `("LD_LIBRARY_PATH" suffix (, cairo))
603 `("LUA_PATH" suffix (,(string-append lua-lgi
604 "/share/lua/5.2/?.lua")))
605 `("LUA_CPATH" suffix (,(string-append
606 lua-lgi "/lib/lua/5.2/?.so"))))))))))
607 (synopsis "Highly configurable window manager")
609 "Awesome has been designed as a framework window manager. It is fast, small,
610 dynamic and extensible using the Lua programming language.")
611 (license license:gpl2+)
612 (home-page "https://awesome.naquadah.org/")))
614 (define-public menumaker
621 (uri (string-append "mirror://sourceforge/menumaker/"
622 "menumaker-" version ".tar.gz"))
625 "1mm4cvg3kphkkd8nwrhcg6d9nm5ar7mgc0wf6fxk6zck1l7xn8ky"))))
626 (build-system gnu-build-system)
628 `(("python" ,python)))
629 (synopsis "Heuristics-driven menu generator")
631 "MenuMaker is a menu generation utility for a number of X window
632 managers and desktop environments. It is capable of finding lots of
633 installed programs and generating a root menu consistent across all
634 supported window managers, so one will get (almost) the same menu in
635 all of them. Currently supported window managers include:
647 (home-page "http://menumaker.sourceforge.net/")
648 (license license:bsd-2)))
650 (define-public keybinder
657 (uri (string-append "https://github.com/engla/keybinder/releases/"
658 "download/v" version "/keybinder-"
660 (file-name (string-append name "-" version ".tar.gz"))
663 "0h52hj3ay8mfhwvmfxbxlfyq74hifdk8wxgxp7fr4iy6189hg7w7"))))
664 (build-system gnu-build-system)
666 `(("python-2" ,python-2)
669 `(("python2-pygtk" ,python2-pygtk)
671 ("pkg-config" ,pkg-config)))
672 (synopsis "Library for registering global keyboard shortcuts")
674 "Keybinder is a library for registering global keyboard shortcuts.
675 Keybinder works with GTK-based applications using the X Window System.")
676 (home-page "https://github.com/engla/keybinder")
677 (license license:gpl2+)))