1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
5 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
6 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
7 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
9 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
10 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages tmux)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system trivial)
34 #:use-module (guix build-system python)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages bash)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages libevent)
40 #:use-module (gnu packages ncurses)
41 #:use-module (gnu packages sphinx))
50 "https://github.com/tmux/tmux/releases/download/"
51 version "/tmux-" version ".tar.gz"))
54 "1fbd93hzaz64h7j0h9nsll29avbq1ikqa438wrgsf1dga0fkagyr"))))
55 (build-system gnu-build-system)
57 `(("libevent" ,libevent)
58 ("ncurses" ,ncurses)))
59 (home-page "https://tmux.github.io/")
60 (synopsis "Terminal multiplexer")
62 "tmux is a terminal multiplexer: it enables a number of terminals (or
63 windows), each running a separate program, to be created, accessed, and
64 controlled from a single screen. tmux may be detached from a screen and
65 continue running in the background, then later reattached.")
66 (license license:isc)))
68 (define-public tmux-themepack
69 (let ((commit "03a372866f7677f7fe63bcee140b48b9fd372c48")
72 (name "tmux-themepack")
73 (version (git-version "0.0.0" revision commit)) ; no version tags
77 (url "https://github.com/jimeh/tmux-themepack")
81 "1d3k87mq5lca042jbap5kxskjy3kg79wjhhpnm6jacbn3anc67zl"))
82 (file-name (git-file-name name version))))
83 (build-system gnu-build-system)
85 `(#:tests? #f ; no test suite
86 #:phases (modify-phases %standard-phases
90 (lambda* (#:key outputs #:allow-other-keys)
91 (let* ((out (string-append
92 (assoc-ref outputs "out")
93 "/share/" ,name "-" ,version)))
94 (copy-recursively "." out)))))))
95 (home-page "https://github.com/jimeh/tmux-themepack")
96 (synopsis "Collection of themes for Tmux")
97 (description "A collection of various themes for Tmux.")
98 (license license:wtfpl2))))
100 (define-public tmuxifier
107 (url "https://github.com/jimeh/tmuxifier")
108 (commit (string-append "v" version))))
109 (file-name (git-file-name name version))
112 "1b6a1cw2mnml84k5vhbcp58kvp94xlnlpp4kwdhqw4jrzfgcjfzd"))))
113 (build-system gnu-build-system)
116 #:phases (modify-phases %standard-phases
120 (lambda* (#:key outputs #:allow-other-keys)
121 (let* ((out (assoc-ref %outputs "out"))
122 (bindir (string-append out "/bin"))
123 (share (string-append out "/share/" ,name)))
124 (install-file "bin/tmuxifier" bindir)
125 (substitute* (string-append bindir "/tmuxifier")
127 (string-append "TMUXIFIER=" share "\nset -e")))
128 (for-each (lambda (init-script)
129 (install-file init-script (string-append
131 '("init.sh" "init.tcsh" "init.fish"))
132 (for-each (lambda (dir)
133 (copy-recursively dir (string-append
135 '("completion" "lib" "libexec"
137 (home-page "https://github.com/jimeh/tmuxifier")
138 (synopsis "Powerful session, window & pane management for Tmux")
139 (description "Tmuxifier allows you to easily create, edit, and load
140 @code{layout} files, which are simple shell scripts where you use the tmux
141 command and helper commands provided by tmuxifier to manage Tmux sessions and
143 (license license:expat)))
145 (define-public python-libtmux
147 (name "python-libtmux")
152 ;; PyPI source tarball does not include tests.
154 (url "https://github.com/tmux-python/libtmux")
155 (commit (string-append "v" version))))
156 (file-name (git-file-name name version))
158 (base32 "18dqqd3jmgq3jb1l3xpgywlh4x82mzjxch61gwnlhfaqx5mzvjph"))))
159 (build-system python-build-system)
161 `(("procps" ,procps))) ;tests need top
163 `(("python-pytest" ,python-pytest)
167 (modify-phases %standard-phases
170 ;; Extend PYTHONPATH so the built package will be found.
172 (string-append (getcwd) "/build/lib:"
173 (getenv "PYTHONPATH")))
174 ;; Skip tests that I suspect fail because of a change
175 ;; in behavior in tmux 3 from tmux 2
176 ;; https://github.com/tmux-python/libtmux/issues/281
177 (invoke "pytest" "-vv" "-k"
178 (string-append "not test_show_option_unknown "
179 "and not test_show_window_option_unknown"))
181 (home-page "https://github.com/tmux-python/libtmux")
182 (synopsis "Python API for tmux")
183 (description "Libtmux is the tool behind @command{tmuxp}, a tmux workspace
184 manager in Python. It creates object mappings to traverse, inspect and interact
185 with live tmux sessions.")
186 (license license:expat)))
188 (define-public python-daemux
190 (name "python-daemux")
193 ;; We fetch from the Git repo because there are no tests in the PyPI
198 (url "https://github.com/edouardklein/daemux")
199 (commit (string-append "v" version))))
200 (file-name (git-file-name name version))
202 (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
203 (build-system python-build-system)
205 `(#:phases (modify-phases %standard-phases
209 (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
210 (invoke "tmux" "new-session" "-d")
211 (invoke "make" "test"))))))
213 `(("python-libtmux" ,python-libtmux)))
215 `(("python-coverage" ,python-coverage)
216 ("python-sphinx" ,python-sphinx)
218 (home-page "https://github.com/edouardklein/daemux")
219 (synopsis "Start, stop, restart and check daemons via tmux")
221 "Daemux lets you run daemons in a @command{tmux} pane. Users can launch
222 long-running background tasks, and check these tasks' health by hand, relaunch
223 them, etc., by attaching to the corresponding pane in tmux.")
224 (license license:agpl3+)))
226 (define-public tmux-xpanes
233 (url "https://github.com/greymd/tmux-xpanes")
234 (commit (string-append "v" version))))
235 (file-name (git-file-name name version))
238 "0vm5mi6dqdbg0b5qh4r8sr1plpc00jryd8a2qxpp3a72cigjvvf0"))))
239 (build-system trivial-build-system)
243 `(#:modules ((guix build utils))
246 (use-modules (guix build utils))
247 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
248 (copy-recursively (assoc-ref %build-inputs "source") ".")
249 (substitute* "bin/xpanes"
250 (("/bin/bash") (which "bash")))
251 (install-file "bin/xpanes" (string-append %output "/bin"))
252 (install-file "man/xpanes.1" (string-append %output "/man/man1"))
254 (home-page "https://github.com/greymd/tmux-xpanes")
255 (synopsis "Tmux based terminal divider")
256 (description "This package provides tmux-based terminal divider.
258 @code{xpanes} or @code{tmux-xpanes} (alias of @code{xpanes}) commands have
262 @item Split tmux window into multiple panes.
263 @item Build command lines & execute them on the panes.
264 @item Runnable from outside of tmux session.
265 @item Runnable from inside of tmux session.
266 @item Record operation log.
267 @item Flexible layout arrangement for panes.
268 @item Display pane title on each pane.
269 @item Generate command lines from standard input (Pipe mode).
271 (license license:expat)))