Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / wm.scm
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 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages wm)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages linux)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system haskell)
36 #:use-module (gnu packages haskell)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pulseaudio)
41 #:use-module (gnu packages xorg)
42 #:use-module (gnu packages xdisorg)
43 #:use-module (gnu packages documentation)
44 #:use-module (gnu packages xml)
45 #:use-module (gnu packages m4)
46 #:use-module (gnu packages docbook)
47 #:use-module (gnu packages image)
48 #:use-module (gnu packages pcre)
49 #:use-module (gnu packages gtk)
50 #:use-module (gnu packages libevent)
51 #:use-module (gnu packages fribidi)
52 #:use-module (gnu packages maths)
53 #:use-module (gnu packages web)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages freedesktop)
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages gperf)
58 #:use-module (gnu packages imagemagick)
59 #:use-module (gnu packages lua)
60 #:use-module (guix download)
61 #:use-module (guix git-download))
62
63 (define-public libconfuse
64 (package
65 (name "libconfuse")
66 (version "2.7")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "http://savannah.nongnu.org/download/confuse/"
70 "confuse-" version ".tar.gz"))
71 (sha256
72 (base32
73 "0y47r2ashz44wvnxdb18ivpmj8nxhw3y9bf7v9w0g5byhgyp89g3"))))
74 (build-system gnu-build-system)
75 (home-page "http://www.nongnu.org/confuse/")
76 (synopsis "Configuration file parser library")
77 (description "libconfuse is a configuration file parser library. It
78 supports sections and (lists of) values (strings, integers, floats, booleans
79 or other sections), as well as some other features (such as
80 single/double-quoted strings, environment variable expansion, functions and
81 nested include statements).")
82 (license license:isc)))
83
84 (define-public bspwm
85 (package
86 (name "bspwm")
87 (version "0.9")
88 (source
89 (origin
90 (file-name (string-append name "-" version ".tar.gz"))
91 (method url-fetch)
92 (uri (string-append
93 "https://github.com/baskerville/bspwm/archive/"
94 version ".tar.gz"))
95 (sha256
96 (base32
97 "1pig0h2jk8wipyz90j69c4bk37bfyq60asnn0v0bqld2p2vjvyqy"))))
98 (build-system gnu-build-system)
99 (inputs
100 `(("libxcb" ,libxcb)
101 ("libxinerama" ,libxinerama)
102 ("sxhkd" ,sxhkd)
103 ("xcb-util" ,xcb-util)
104 ("xcb-util-keysyms" ,xcb-util-keysyms)
105 ("xcb-util-wm" ,xcb-util-wm)))
106 (arguments
107 '(#:phases (alist-delete 'configure %standard-phases)
108 #:tests? #f ; no check target
109 #:make-flags (list "CC=gcc"
110 (string-append "PREFIX=" %output))))
111 (home-page "https://github.com/baskerville/bspwm")
112 (synopsis "Tiling window manager based on binary space partitioning")
113 (description "bspwm is a tiling window manager that represents windows as
114 the leaves of a full binary tree.")
115 (license license:bsd-2)))
116
117 (define-public i3status
118 (package
119 (name "i3status")
120 (version "2.10")
121 (source (origin
122 (method url-fetch)
123 (uri (string-append "https://i3wm.org/i3status/i3status-"
124 version ".tar.bz2"))
125 (sha256
126 (base32
127 "1497dsvb32z9xljmxz95dnyvsbayn188ilm3l4ys8m5h25vd1xfs"))))
128 (build-system gnu-build-system)
129 (arguments
130 `(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
131 #:phases
132 (modify-phases %standard-phases
133 (delete 'configure))
134 #:tests? #f)) ; no test suite
135 (inputs
136 `(("openlibm" ,openlibm)
137 ("libconfuse" ,libconfuse)
138 ("libyajl" ,libyajl)
139 ("alsa-lib" ,alsa-lib)
140 ("pulseaudio" ,pulseaudio)
141 ("libnl" ,libnl)
142 ("libcap" ,libcap)
143 ("asciidoc" ,asciidoc)))
144 (native-inputs
145 `(("pkg-config" ,pkg-config)))
146 (home-page "https://i3wm.org/i3status/")
147 (synopsis "Status bar for i3bar, dzen2, xmobar or similar programs")
148 (description "i3status is a small program for generating a status bar for
149 i3bar, dzen2, xmobar or similar programs. It is designed to be very efficient
150 by issuing a very small number of system calls, as one generally wants to
151 update such a status line every second. This ensures that even under high
152 load, your status bar is updated correctly. Also, it saves a bit of energy by
153 not hogging your CPU as much as spawning the corresponding amount of shell
154 commands would.")
155 (license license:bsd-3)))
156
157 (define-public i3-wm
158 (package
159 (name "i3-wm")
160 (version "4.12")
161 (source (origin
162 (method url-fetch)
163 (uri (string-append "https://i3wm.org/downloads/i3-"
164 version ".tar.bz2"))
165 (sha256
166 (base32
167 "1d3q3lgpjbkmcwzjhp0dfr0jq847silcfg087slcnj95ikh1r7p1"))))
168 (build-system gnu-build-system)
169 (arguments
170 `(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
171 #:phases
172 (modify-phases %standard-phases
173 (delete 'configure))
174 #:tests? #f)) ; no test suite
175 (inputs
176 `(("libxcb" ,libxcb)
177 ("xcb-util" ,xcb-util)
178 ("xcb-util-cursor" ,xcb-util-cursor)
179 ("xcb-util-keysyms" ,xcb-util-keysyms)
180 ("xcb-util-wm" ,xcb-util-wm)
181 ("libxkbcommon" ,libxkbcommon)
182 ("libev" ,libev)
183 ("libyajl" ,libyajl)
184 ("asciidoc" ,asciidoc)
185 ("xmlto" ,xmlto)
186 ("perl-pod-simple" ,perl-pod-simple)
187 ("docbook-xml" ,docbook-xml)
188 ("libx11" ,libx11)
189 ("pcre" ,pcre)
190 ("startup-notification" ,startup-notification)
191 ("pango" ,pango)
192 ("cairo" ,cairo)))
193 (native-inputs
194 `(("which" ,which)
195 ("perl" ,perl)
196 ("pkg-config" ,pkg-config)))
197 (home-page "https://i3wm.org/")
198 (synopsis "Improved tiling window manager")
199 (description "A tiling window manager, completely written
200 from scratch. i3 is primarily targeted at advanced users and
201 developers.")
202 (license license:bsd-3)))
203
204 (define-public xmonad
205 (package
206 (name "xmonad")
207 (version "0.11.1")
208 (synopsis "Tiling window manager")
209 (source (origin
210 (method url-fetch)
211 (uri (string-append "http://hackage.haskell.org/package/xmonad/"
212 name "-" version ".tar.gz"))
213 (sha256
214 (base32
215 "1pfjssamiwpwjp1qqkm9m9p9s35pv381m0cwg6jxg0ppglibzq1r"))
216 (modules '((guix build utils)))
217 (snippet
218 ;; Here we update the constraints on the utf8-string package in
219 ;; the Cabal file. We allow a newer version which is compatible
220 ;; with GHC 7.10.2. The same change is applied on Hackage. See
221 ;; <https://hackage.haskell.org/package/xmonad-0.11.1/revisions/>.
222 '(substitute* "xmonad.cabal"
223 (("utf8-string >= 0.3 && < 0.4")
224 "utf8-string >= 0.3 && < 1.1")))))
225 (build-system haskell-build-system)
226 (inputs
227 `(("ghc-mtl" ,ghc-mtl)
228 ("ghc-utf8-string" ,ghc-utf8-string)
229 ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
230 ("ghc-x11" ,ghc-x11)))
231 (arguments
232 `(#:phases
233 (modify-phases %standard-phases
234 (add-after
235 'install 'install-xsession
236 (lambda _
237 (let* ((xsessions (string-append %output "/share/xsessions")))
238 (mkdir-p xsessions)
239 (call-with-output-file
240 (string-append xsessions "/xmonad.desktop")
241 (lambda (port)
242 (format port "~
243 [Desktop Entry]~@
244 Name=~a~@
245 Comment=~a~@
246 Exec=~a/bin/xmonad~@
247 Type=Application~%" ,name ,synopsis %output)))))))))
248 (home-page "http://xmonad.org")
249 (description
250 "Xmonad is a tiling window manager for X. Windows are arranged
251 automatically to tile the screen without gaps or overlap, maximising screen
252 use. All features of the window manager are accessible from the keyboard: a
253 mouse is strictly optional. Xmonad is written and extensible in Haskell.
254 Custom layout algorithms, and other extensions, may be written by the user in
255 config files. Layouts are applied dynamically, and different layouts may be
256 used on each workspace. Xinerama is fully supported, allowing windows to be
257 tiled on several screens.")
258 (license license:bsd-3)))
259
260 (define-public ghc-xmonad-contrib
261 (package
262 (name "ghc-xmonad-contrib")
263 (version "0.11.4")
264 (source
265 (origin
266 (method url-fetch)
267 (uri (string-append "http://hackage.haskell.org/package/xmonad-contrib/"
268 "xmonad-contrib-" version ".tar.gz"))
269 (sha256
270 (base32
271 "1g5cw9vvnfbiyi599fngk02zlmdhrf82x0bndhypkn6kybab6yd3"))))
272 (build-system haskell-build-system)
273 (propagated-inputs
274 `(("ghc-mtl" ,ghc-mtl)
275 ("ghc-old-time" ,ghc-old-time)
276 ("ghc-random" ,ghc-random)
277 ("ghc-utf8-string" ,ghc-utf8-string)
278 ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
279 ("ghc-x11" ,ghc-x11)
280 ("ghc-x11-xft" ,ghc-x11-xft)
281 ("xmonad" ,xmonad)))
282 (home-page "http://xmonad.org")
283 (synopsis "Third party extensions for xmonad")
284 (description
285 "Third party tiling algorithms, configurations, and scripts to Xmonad, a
286 tiling window manager for X.")
287 (license license:bsd-3)))
288
289 (define-public evilwm
290 (package
291 (name "evilwm")
292 (version "1.1.1")
293 (source
294 (origin
295 (method url-fetch)
296 (uri (string-append "http://www.6809.org.uk/evilwm/evilwm-"
297 version ".tar.gz"))
298 (sha256
299 (base32
300 "0ak0yajzk3v4dg5wmaghv6acf7v02a4iw8qxmq5yw5ard8lrqn3r"))
301 (patches (search-patches "evilwm-lost-focus-bug.patch"))))
302 (build-system gnu-build-system)
303 (inputs
304 `(("libx11" ,libx11)
305 ("libxext" ,libxext)
306 ("libxrandr" ,libxrandr)))
307 (arguments
308 `(#:modules ((srfi srfi-26)
309 (guix build utils)
310 (guix build gnu-build-system))
311 #:make-flags (let ((inputs (map (cut assoc-ref %build-inputs <>)
312 '("libx11" "libxext" "libxrandr")))
313 (join (lambda (proc strs)
314 (string-join (map proc strs) " ")))
315 (dash-I (cut string-append "-I" <> "/include"))
316 (dash-L (cut string-append "-L" <> "/lib")))
317 `("desktopfilesdir=$(prefix)/share/xsessions"
318 ,(string-append "prefix=" (assoc-ref %outputs "out"))
319 ,(string-append "CPPFLAGS=" (join dash-I inputs))
320 ,(string-append "LDFLAGS=" (join dash-L inputs))))
321 #:tests? #f ;no tests
322 #:phases (modify-phases %standard-phases
323 (delete 'configure)))) ;no configure script
324 (home-page "http://www.6809.org.uk/evilwm/")
325 (synopsis "Minimalist window manager for the X Window System")
326 (description
327 "evilwm is a minimalist window manager based on aewm, extended to feature
328 many keyboard controls with repositioning and maximize toggles, solid window
329 drags, snap-to-border support, and virtual desktops.")
330 (license (license:x11-style "file:///README"))))
331
332 (define-public fluxbox
333 (package
334 (name "fluxbox")
335 (version "1.3.7")
336 (synopsis "Small and fast window manager")
337 (source (origin
338 (method url-fetch)
339 (uri (string-append "mirror://sourceforge/fluxbox/fluxbox/"
340 version "/fluxbox-" version ".tar.xz"))
341 (sha256
342 (base32
343 "1h1f70y40qd225dqx937vzb4k2cz219agm1zvnjxakn5jkz7b37w"))))
344 (build-system gnu-build-system)
345 (arguments
346 `(#:make-flags '("CPPFLAGS=-U__TIME__") ;ugly, but for reproducibility
347 #:phases
348 (modify-phases %standard-phases
349 (add-after
350 'install 'install-xsession
351 (lambda _
352 (let ((xsessions (string-append %output "/share/xsessions")))
353 (mkdir-p xsessions)
354 (call-with-output-file
355 (string-append xsessions "/fluxbox.desktop")
356 (lambda (port)
357 (format port "~
358 [Desktop Entry]~@
359 Name=~a~@
360 Comment=~a~@
361 Exec=~a/bin/startfluxbox~@
362 Type=Application~%" ,name ,synopsis %output)))))))))
363 (native-inputs
364 `(("pkg-config" ,pkg-config)))
365 (inputs
366 `(("freetype" ,freetype)
367 ("fribidi" ,fribidi)
368 ("imlib2" ,imlib2)
369 ("libx11" ,libx11)
370 ("libxext" ,libxext)
371 ("libxft" ,libxft)
372 ("libxinerama" ,libxinerama)
373 ("libxpm" ,libxpm)
374 ("libxrandr" ,libxrandr)
375 ("libxrender" ,libxrender)))
376 (description "Fluxbox is a window manager. It is light on resources
377 and easy to handle yet full of features to make an easy and fast desktop
378 experience.")
379 (home-page "http://fluxbox.org/")
380 (license license:expat)))
381
382 (define-public awesome
383 (package
384 (name "awesome")
385 (version "3.4.15")
386 (source
387 (origin (method url-fetch)
388 (uri (string-append
389 "https://awesome.naquadah.org/download/awesome-"
390 version ".tar.xz"))
391 (sha256
392 (base32
393 "1m910lr7wkw2dgzmirfvz7dasfswhhccdf65l21iiciv24c3w1bb"))
394 (modules '((guix build utils)
395 (srfi srfi-19)))
396 (snippet
397 ;; Remove non-reproducible timestamp and use the date of the
398 ;; source file instead.
399 '(substitute* "common/version.c"
400 (("__DATE__ \" \" __TIME__")
401 (date->string
402 (time-utc->date
403 (make-time time-utc 0
404 (stat:mtime (stat "awesome.c"))))
405 "\"~c\""))))
406 (patches (search-patches "awesome-reproducible-png.patch"))))
407 (build-system cmake-build-system)
408 (native-inputs `(("asciidoc" ,asciidoc)
409 ("docbook-xsl" ,docbook-xsl)
410 ("doxygen" ,doxygen)
411 ("gperf" ,gperf)
412 ("imagemagick" ,imagemagick)
413 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
414 ("pkg-config" ,pkg-config)
415 ("xmlto" ,xmlto)))
416 (inputs `(("cairo" ,cairo)
417 ("dbus" ,dbus)
418 ("gdk-pixbuf" ,gdk-pixbuf)
419 ("glib" ,glib)
420 ("imlib2" ,imlib2)
421 ("libev" ,libev)
422 ("libxcb" ,libxcb)
423 ("libxcursor" ,libxcursor)
424 ("libxdg-basedir" ,libxdg-basedir)
425 ("lua" ,lua-5.1)
426 ("pango" ,pango)
427 ("startup-notification" ,startup-notification)
428 ("xcb-util" ,xcb-util)
429 ("xcb-util-cursor" ,xcb-util-cursor)
430 ("xcb-util-image" ,xcb-util-image)
431 ("xcb-util-keysyms" ,xcb-util-keysyms)
432 ("xcb-util-renderutil" ,xcb-util-renderutil)
433 ("xcb-util-wm" ,xcb-util-wm)))
434 (arguments
435 `(;; Let compression happen in our 'compress-documentation' phase so that
436 ;; '--no-name' is used, which removes timestamps from gzip output.
437 #:configure-flags '("-DCOMPRESS_MANPAGES=off")
438
439 #:phases (modify-phases %standard-phases
440 (add-before 'build 'xmlto-skip-validation
441 (lambda _
442 ;; We can't download the necessary schema, so so skip
443 ;; validation and assume they're valid.
444 (substitute* "../build/CMakeFiles/man.dir/build.make"
445 (("/xmlto")
446 (string-append "/xmlto --skip-validation")))
447 #t))
448 (replace 'check
449 (lambda _
450 ;; There aren't any tests, so just make sure the binary
451 ;; gets built and can be run successfully.
452 (zero? (system* "../build/awesome" "-v")))))))
453 (synopsis "Highly configurable window manager")
454 (description
455 "awesome is a window manager for X. It manages windows in different
456 layouts, like floating or tiled. Any layout can be applied dynamically,
457 optimizing the environment for the application in use and the task currently
458 being performed.
459
460 In a tiled layout, windows are managed in a master and stacking area. In a
461 floating layout windows can be resized and moved freely. Dialog windows are
462 always managed as floating, regardless of the layout currently applied.
463
464 Windows are grouped by tags in awesome. Each window can be tagged with one or
465 more tags. Selecting certain tags displays all windows with these tags.")
466 (license license:gpl2+)
467 (home-page "https://awesome.naquadah.org/")))