machine: Allow non-root users to deploy.
[jackhill/guix/guix.git] / gnu / packages / tmux.scm
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 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages tmux)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system trivial)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages bash)
34 #:use-module (gnu packages libevent)
35 #:use-module (gnu packages ncurses))
36
37
38 (define-public tmux
39 (package
40 (name "tmux")
41 (version "2.9")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append
45 "https://github.com/tmux/tmux/releases/download/"
46 version "/tmux-" version ".tar.gz"))
47 (sha256
48 (base32
49 "10195hp5ydkwwmpcr7188fgx9daqwrslb1lylgrrkzc6yhr1541l"))))
50 (build-system gnu-build-system)
51 (inputs
52 `(("libevent" ,libevent)
53 ("ncurses" ,ncurses)))
54 (home-page "http://tmux.github.io/")
55 (synopsis "Terminal multiplexer")
56 (description
57 "tmux is a terminal multiplexer: it enables a number of terminals (or
58 windows), each running a separate program, to be created, accessed, and
59 controlled from a single screen. tmux may be detached from a screen and
60 continue running in the background, then later reattached.")
61 (license license:isc)))
62
63 (define-public tmux-themepack
64 (let ((commit "03a372866f7677f7fe63bcee140b48b9fd372c48")
65 (revision "1"))
66 (package
67 (name "tmux-themepack")
68 (version (git-version "0.0.0" revision commit)) ; no version tags
69 (source (origin
70 (method git-fetch)
71 (uri (git-reference
72 (url "https://github.com/jimeh/tmux-themepack.git")
73 (commit commit)))
74 (sha256
75 (base32
76 "1d3k87mq5lca042jbap5kxskjy3kg79wjhhpnm6jacbn3anc67zl"))
77 (file-name (git-file-name name version))))
78 (build-system gnu-build-system)
79 (arguments
80 `(#:tests? #f ; no test suite
81 #:phases (modify-phases %standard-phases
82 (delete 'configure)
83 (delete 'build)
84 (replace 'install
85 (lambda* (#:key outputs #:allow-other-keys)
86 (let* ((out (string-append
87 (assoc-ref outputs "out")
88 "/share/" ,name "-" ,version)))
89 (copy-recursively "." out)))))))
90 (home-page "https://github.com/jimeh/tmux-themepack")
91 (synopsis "Collection of themes for Tmux")
92 (description "A collection of various themes for Tmux.")
93 (license license:wtfpl2))))
94
95 (define-public tmuxifier
96 (package
97 (name "tmuxifier")
98 (version "0.13.0")
99 (source (origin
100 (method git-fetch)
101 (uri (git-reference
102 (url "https://github.com/jimeh/tmuxifier.git")
103 (commit (string-append "v" version))))
104 (file-name (git-file-name name version))
105 (sha256
106 (base32
107 "1b6a1cw2mnml84k5vhbcp58kvp94xlnlpp4kwdhqw4jrzfgcjfzd"))))
108 (build-system gnu-build-system)
109 (arguments
110 `(#:tests? #f
111 #:phases (modify-phases %standard-phases
112 (delete 'configure)
113 (delete 'build)
114 (replace 'install
115 (lambda* (#:key outputs #:allow-other-keys)
116 (let* ((out (assoc-ref %outputs "out"))
117 (bindir (string-append out "/bin"))
118 (share (string-append out "/share/" ,name)))
119 (install-file "bin/tmuxifier" bindir)
120 (substitute* (string-append bindir "/tmuxifier")
121 (("set -e")
122 (string-append "TMUXIFIER=" share "\nset -e")))
123 (for-each (lambda (init-script)
124 (install-file init-script (string-append
125 share "/init")))
126 '("init.sh" "init.tcsh" "init.fish"))
127 (for-each (lambda (dir)
128 (copy-recursively dir (string-append
129 share "/" dir)))
130 '("completion" "lib" "libexec"
131 "templates"))))))))
132 (home-page "https://github.com/jimeh/tmuxifier")
133 (synopsis "Powerful session, window & pane management for Tmux")
134 (description "Tmuxifier allows you to easily create, edit, and load
135 @code{layout} files, which are simple shell scripts where you use the tmux
136 command and helper commands provided by tmuxifier to manage Tmux sessions and
137 windows.")
138 (license license:expat)))
139
140 (define-public tmux-xpanes
141 (package
142 (name "tmux-xpanes")
143 (version "4.1.1")
144 (source (origin
145 (method git-fetch)
146 (uri (git-reference
147 (url "https://github.com/greymd/tmux-xpanes.git")
148 (commit (string-append "v" version))))
149 (file-name (git-file-name name version))
150 (sha256
151 (base32
152 "13q02vdk229chgbn547wwv29cj4njvz02lmw840g8qmwh73qb2pi"))))
153 (build-system trivial-build-system)
154 (inputs
155 `(("bash" ,bash)))
156 (arguments
157 `(#:modules ((guix build utils))
158 #:builder
159 (begin
160 (use-modules (guix build utils))
161 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
162 (copy-recursively (assoc-ref %build-inputs "source") ".")
163 (substitute* "bin/xpanes"
164 (("/bin/bash") (which "bash")))
165 (install-file "bin/xpanes" (string-append %output "/bin"))
166 (install-file "man/xpanes.1" (string-append %output "/man/man1"))
167 #t)))
168 (home-page "https://github.com/greymd/tmux-xpanes")
169 (synopsis "Tmux based terminal divider")
170 (description "This package provides tmux-based terminal divider.
171
172 @code{xpanes} or @code{tmux-xpanes} (alias of @code{xpanes}) commands have
173 following features:
174
175 @itemize
176 @item Split tmux window into multiple panes.
177 @item Build command lines & execute them on the panes.
178 @item Runnable from outside of tmux session.
179 @item Runnable from inside of tmux session.
180 @item Record operation log.
181 @item Flexible layout arrangement for panes.
182 @item Display pane title on each pane.
183 @item Generate command lines from standard input (Pipe mode).
184 @end itemize")
185 (license license:expat)))