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, 2021 Brice Waegeneire <brice@waegenei.re>
10 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
11 ;;; Copyright © 2021 Matthew James Kraai <kraai@ftbfs.org>
13 ;;; This file is part of GNU Guix.
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.
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.
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/>.
28 (define-module (gnu packages tmux)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system trivial)
35 #:use-module (guix build-system python)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages bash)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages linux)
40 #:use-module (gnu packages libevent)
41 #:use-module (gnu packages ncurses)
42 #:use-module (gnu packages sphinx))
51 "https://github.com/tmux/tmux/releases/download/"
52 version "/tmux-" version ".tar.gz"))
55 "0pyhmipg6vxvxjk7mr410007qk98rh5q0mljvkdaisibz2j565am"))))
56 (build-system gnu-build-system)
58 (list libevent ncurses))
59 (home-page "https://github.com/tmux/tmux/wiki")
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
70 (name "tmux-themepack")
75 (url "https://github.com/jimeh/tmux-themepack")
79 "00dmd16ngyag3n46rbnl9vy82ih6g0y02yfwkid32a1c8vdbvb3z"))
80 (file-name (git-file-name name version))))
81 (build-system gnu-build-system)
83 `(#:tests? #f ; no test suite
84 #:phases (modify-phases %standard-phases
88 (lambda* (#:key outputs #:allow-other-keys)
89 (let* ((out (string-append
90 (assoc-ref outputs "out")
92 (copy-recursively "powerline" (string-append out "/powerline"))
93 (for-each (lambda (file) (copy-file file (string-append out "/" file)))
96 "themepack.tmux"))))))))
97 (home-page "https://github.com/jimeh/tmux-themepack")
98 (synopsis "Collection of themes for Tmux")
100 "This package provides several themes for Tmux, the terminal multiplexer.")
101 (license license:wtfpl2)))
103 (define-public tmuxifier
110 (url "https://github.com/jimeh/tmuxifier")
111 (commit (string-append "v" version))))
112 (file-name (git-file-name name version))
115 "1b6a1cw2mnml84k5vhbcp58kvp94xlnlpp4kwdhqw4jrzfgcjfzd"))))
116 (build-system gnu-build-system)
119 #:phases (modify-phases %standard-phases
123 (lambda* (#:key outputs #:allow-other-keys)
124 (let* ((out (assoc-ref %outputs "out"))
125 (bindir (string-append out "/bin"))
126 (share (string-append out "/share/" ,name)))
127 (install-file "bin/tmuxifier" bindir)
128 (substitute* (string-append bindir "/tmuxifier")
130 (string-append "TMUXIFIER=" share "\nset -e")))
131 (for-each (lambda (init-script)
132 (install-file init-script (string-append
134 '("init.sh" "init.tcsh" "init.fish"))
135 (for-each (lambda (dir)
136 (copy-recursively dir (string-append
138 '("completion" "lib" "libexec"
140 (home-page "https://github.com/jimeh/tmuxifier")
141 (synopsis "Powerful session, window & pane management for Tmux")
142 (description "Tmuxifier allows you to easily create, edit, and load
143 @code{layout} files, which are simple shell scripts where you use the tmux
144 command and helper commands provided by tmuxifier to manage Tmux sessions and
146 (license license:expat)))
148 (define-public python-libtmux
150 (name "python-libtmux")
155 ;; PyPI source tarball does not include tests.
157 (url "https://github.com/tmux-python/libtmux")
158 (commit (string-append "v" version))))
159 (file-name (git-file-name name version))
161 (base32 "068vy92f2668vrjvd3laqvxd48cmna66f2msdmwk2hm9qxklgf51"))))
162 (build-system python-build-system)
164 (list procps)) ;tests need top
166 (list python-pytest tmux))
169 (modify-phases %standard-phases
172 ;; Fix <https://github.com/tmux-python/libtmux/issues/265>.
173 (setenv "LANG" "en_US.utf8")
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 (list python-libtmux))
215 (list python-coverage python-sphinx tmux))
216 (home-page "https://github.com/edouardklein/daemux")
217 (synopsis "Start, stop, restart and check daemons via tmux")
219 "Daemux lets you run daemons in a @command{tmux} pane. Users can launch
220 long-running background tasks, and check these tasks' health by hand, relaunch
221 them, etc., by attaching to the corresponding pane in tmux.")
222 (license license:agpl3+)))
224 (define-public tmux-xpanes
231 (url "https://github.com/greymd/tmux-xpanes")
232 (commit (string-append "v" version))))
233 (file-name (git-file-name name version))
236 "09fmnn1q76r1l4cv7clmfr3j9cjmd053kq238d0qj2i486948ivv"))))
237 (build-system trivial-build-system)
241 `(#:modules ((guix build utils))
244 (use-modules (guix build utils))
245 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
246 (copy-recursively (assoc-ref %build-inputs "source") ".")
247 (substitute* "bin/xpanes"
248 (("/bin/bash") (which "bash")))
249 (install-file "bin/xpanes" (string-append %output "/bin"))
250 (install-file "man/xpanes.1" (string-append %output "/man/man1"))
252 (home-page "https://github.com/greymd/tmux-xpanes")
253 (synopsis "Tmux based terminal divider")
254 (description "This package provides tmux-based terminal divider.
256 @code{xpanes} or @code{tmux-xpanes} (alias of @code{xpanes}) commands have
260 @item Split tmux window into multiple panes.
261 @item Build command lines & execute them on the panes.
262 @item Runnable from outside of tmux session.
263 @item Runnable from inside of tmux session.
264 @item Record operation log.
265 @item Flexible layout arrangement for panes.
266 @item Display pane title on each pane.
267 @item Generate command lines from standard input (Pipe mode).
269 (license license:expat)))