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–2021 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 "16d310gcpfnfh7rl5vy1lwqy54ai5awkkybzkm1bw761719k8kb6"))))
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 "1vrd99kl2gsk49mvbp6k7l1k7r96vf1fczsqclb62yd4hdpp7zaa"))))
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 ;; Fix <https://github.com/tmux-python/libtmux/issues/265>.
175 (setenv "LANG" "en_US.utf8")
176 ;; Skip tests that I suspect fail because of a change
177 ;; in behavior in tmux 3 from tmux 2
178 ;; https://github.com/tmux-python/libtmux/issues/281
179 (invoke "pytest" "-vv" "-k"
180 (string-append "not test_show_option_unknown "
181 "and not test_show_window_option_unknown"))
183 (home-page "https://github.com/tmux-python/libtmux")
184 (synopsis "Python API for tmux")
185 (description "Libtmux is the tool behind @command{tmuxp}, a tmux workspace
186 manager in Python. It creates object mappings to traverse, inspect and interact
187 with live tmux sessions.")
188 (license license:expat)))
190 (define-public python-daemux
192 (name "python-daemux")
195 ;; We fetch from the Git repo because there are no tests in the PyPI
200 (url "https://github.com/edouardklein/daemux")
201 (commit (string-append "v" version))))
202 (file-name (git-file-name name version))
204 (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
205 (build-system python-build-system)
207 `(#:phases (modify-phases %standard-phases
211 (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
212 (invoke "tmux" "new-session" "-d")
213 (invoke "make" "test"))))))
215 `(("python-libtmux" ,python-libtmux)))
217 `(("python-coverage" ,python-coverage)
218 ("python-sphinx" ,python-sphinx)
220 (home-page "https://github.com/edouardklein/daemux")
221 (synopsis "Start, stop, restart and check daemons via tmux")
223 "Daemux lets you run daemons in a @command{tmux} pane. Users can launch
224 long-running background tasks, and check these tasks' health by hand, relaunch
225 them, etc., by attaching to the corresponding pane in tmux.")
226 (license license:agpl3+)))
228 (define-public tmux-xpanes
235 (url "https://github.com/greymd/tmux-xpanes")
236 (commit (string-append "v" version))))
237 (file-name (git-file-name name version))
240 "09fmnn1q76r1l4cv7clmfr3j9cjmd053kq238d0qj2i486948ivv"))))
241 (build-system trivial-build-system)
245 `(#:modules ((guix build utils))
248 (use-modules (guix build utils))
249 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
250 (copy-recursively (assoc-ref %build-inputs "source") ".")
251 (substitute* "bin/xpanes"
252 (("/bin/bash") (which "bash")))
253 (install-file "bin/xpanes" (string-append %output "/bin"))
254 (install-file "man/xpanes.1" (string-append %output "/man/man1"))
256 (home-page "https://github.com/greymd/tmux-xpanes")
257 (synopsis "Tmux based terminal divider")
258 (description "This package provides tmux-based terminal divider.
260 @code{xpanes} or @code{tmux-xpanes} (alias of @code{xpanes}) commands have
264 @item Split tmux window into multiple panes.
265 @item Build command lines & execute them on the panes.
266 @item Runnable from outside of tmux session.
267 @item Runnable from inside of tmux session.
268 @item Record operation log.
269 @item Flexible layout arrangement for panes.
270 @item Display pane title on each pane.
271 @item Generate command lines from standard input (Pipe mode).
273 (license license:expat)))