tmux.scm 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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>
  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. (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))
  42. (define-public tmux
  43. (package
  44. (name "tmux")
  45. (version "3.2a")
  46. (source (origin
  47. (method url-fetch)
  48. (uri (string-append
  49. "https://github.com/tmux/tmux/releases/download/"
  50. version "/tmux-" version ".tar.gz"))
  51. (sha256
  52. (base32
  53. "0pyhmipg6vxvxjk7mr410007qk98rh5q0mljvkdaisibz2j565am"))))
  54. (build-system gnu-build-system)
  55. (inputs
  56. `(("libevent" ,libevent)
  57. ("ncurses" ,ncurses)))
  58. (home-page "https://github.com/tmux/tmux/wiki")
  59. (synopsis "Terminal multiplexer")
  60. (description
  61. "tmux is a terminal multiplexer: it enables a number of terminals (or
  62. windows), each running a separate program, to be created, accessed, and
  63. controlled from a single screen. tmux may be detached from a screen and
  64. continue running in the background, then later reattached.")
  65. (license license:isc)))
  66. (define-public tmux-themepack
  67. (package
  68. (name "tmux-themepack")
  69. (version "1.1.0")
  70. (source (origin
  71. (method git-fetch)
  72. (uri (git-reference
  73. (url "https://github.com/jimeh/tmux-themepack")
  74. (commit version)))
  75. (sha256
  76. (base32
  77. "00dmd16ngyag3n46rbnl9vy82ih6g0y02yfwkid32a1c8vdbvb3z"))
  78. (file-name (git-file-name name version))))
  79. (build-system gnu-build-system)
  80. (arguments
  81. `(#:tests? #f ; no test suite
  82. #:phases (modify-phases %standard-phases
  83. (delete 'configure)
  84. (delete 'build)
  85. (replace 'install
  86. (lambda* (#:key outputs #:allow-other-keys)
  87. (let* ((out (string-append
  88. (assoc-ref outputs "out")
  89. "/share/" ,name)))
  90. (copy-recursively "powerline" (string-append out "/powerline"))
  91. (for-each (lambda (file) (copy-file file (string-append out "/" file)))
  92. '("basic.tmuxtheme"
  93. "default.tmuxtheme"
  94. "themepack.tmux"))))))))
  95. (home-page "https://github.com/jimeh/tmux-themepack")
  96. (synopsis "Collection of themes for Tmux")
  97. (description
  98. "This package provides several themes for Tmux, the terminal multiplexer.")
  99. (license license:wtfpl2)))
  100. (define-public tmuxifier
  101. (package
  102. (name "tmuxifier")
  103. (version "0.13.0")
  104. (source (origin
  105. (method git-fetch)
  106. (uri (git-reference
  107. (url "https://github.com/jimeh/tmuxifier")
  108. (commit (string-append "v" version))))
  109. (file-name (git-file-name name version))
  110. (sha256
  111. (base32
  112. "1b6a1cw2mnml84k5vhbcp58kvp94xlnlpp4kwdhqw4jrzfgcjfzd"))))
  113. (build-system gnu-build-system)
  114. (arguments
  115. `(#:tests? #f
  116. #:phases (modify-phases %standard-phases
  117. (delete 'configure)
  118. (delete 'build)
  119. (replace 'install
  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")
  126. (("set -e")
  127. (string-append "TMUXIFIER=" share "\nset -e")))
  128. (for-each (lambda (init-script)
  129. (install-file init-script (string-append
  130. share "/init")))
  131. '("init.sh" "init.tcsh" "init.fish"))
  132. (for-each (lambda (dir)
  133. (copy-recursively dir (string-append
  134. share "/" dir)))
  135. '("completion" "lib" "libexec"
  136. "templates"))))))))
  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
  142. windows.")
  143. (license license:expat)))
  144. (define-public python-libtmux
  145. (package
  146. (name "python-libtmux")
  147. (version "0.10.1")
  148. (source
  149. (origin
  150. (method git-fetch)
  151. ;; PyPI source tarball does not include tests.
  152. (uri (git-reference
  153. (url "https://github.com/tmux-python/libtmux")
  154. (commit (string-append "v" version))))
  155. (file-name (git-file-name name version))
  156. (sha256
  157. (base32 "068vy92f2668vrjvd3laqvxd48cmna66f2msdmwk2hm9qxklgf51"))))
  158. (build-system python-build-system)
  159. (propagated-inputs
  160. `(("procps" ,procps))) ;tests need top
  161. (native-inputs
  162. `(("python-pytest" ,python-pytest)
  163. ("tmux" ,tmux)))
  164. (arguments
  165. `(#:phases
  166. (modify-phases %standard-phases
  167. (replace 'check
  168. (lambda _
  169. ;; Fix <https://github.com/tmux-python/libtmux/issues/265>.
  170. (setenv "LANG" "en_US.utf8")
  171. ;; Skip tests that I suspect fail because of a change
  172. ;; in behavior in tmux 3 from tmux 2
  173. ;; https://github.com/tmux-python/libtmux/issues/281
  174. (invoke "pytest" "-vv" "-k"
  175. (string-append "not test_show_option_unknown "
  176. "and not test_show_window_option_unknown"))
  177. #t)))))
  178. (home-page "https://github.com/tmux-python/libtmux")
  179. (synopsis "Python API for tmux")
  180. (description "Libtmux is the tool behind @command{tmuxp}, a tmux workspace
  181. manager in Python. It creates object mappings to traverse, inspect and interact
  182. with live tmux sessions.")
  183. (license license:expat)))
  184. (define-public python-daemux
  185. (package
  186. (name "python-daemux")
  187. (version "0.1.0")
  188. (source
  189. ;; We fetch from the Git repo because there are no tests in the PyPI
  190. ;; archive.
  191. (origin
  192. (method git-fetch)
  193. (uri (git-reference
  194. (url "https://github.com/edouardklein/daemux")
  195. (commit (string-append "v" version))))
  196. (file-name (git-file-name name version))
  197. (sha256
  198. (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
  199. (build-system python-build-system)
  200. (arguments
  201. `(#:phases (modify-phases %standard-phases
  202. (replace 'check
  203. (lambda _
  204. (mkdir-p "tmptmux")
  205. (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
  206. (invoke "tmux" "new-session" "-d")
  207. (invoke "make" "test"))))))
  208. (propagated-inputs
  209. `(("python-libtmux" ,python-libtmux)))
  210. (native-inputs
  211. `(("python-coverage" ,python-coverage)
  212. ("python-sphinx" ,python-sphinx)
  213. ("tmux" ,tmux)))
  214. (home-page "https://github.com/edouardklein/daemux")
  215. (synopsis "Start, stop, restart and check daemons via tmux")
  216. (description
  217. "Daemux lets you run daemons in a @command{tmux} pane. Users can launch
  218. long-running background tasks, and check these tasks' health by hand, relaunch
  219. them, etc., by attaching to the corresponding pane in tmux.")
  220. (license license:agpl3+)))
  221. (define-public tmux-xpanes
  222. (package
  223. (name "tmux-xpanes")
  224. (version "4.1.3")
  225. (source (origin
  226. (method git-fetch)
  227. (uri (git-reference
  228. (url "https://github.com/greymd/tmux-xpanes")
  229. (commit (string-append "v" version))))
  230. (file-name (git-file-name name version))
  231. (sha256
  232. (base32
  233. "09fmnn1q76r1l4cv7clmfr3j9cjmd053kq238d0qj2i486948ivv"))))
  234. (build-system trivial-build-system)
  235. (inputs
  236. `(("bash" ,bash)))
  237. (arguments
  238. `(#:modules ((guix build utils))
  239. #:builder
  240. (begin
  241. (use-modules (guix build utils))
  242. (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
  243. (copy-recursively (assoc-ref %build-inputs "source") ".")
  244. (substitute* "bin/xpanes"
  245. (("/bin/bash") (which "bash")))
  246. (install-file "bin/xpanes" (string-append %output "/bin"))
  247. (install-file "man/xpanes.1" (string-append %output "/man/man1"))
  248. #t)))
  249. (home-page "https://github.com/greymd/tmux-xpanes")
  250. (synopsis "Tmux based terminal divider")
  251. (description "This package provides tmux-based terminal divider.
  252. @code{xpanes} or @code{tmux-xpanes} (alias of @code{xpanes}) commands have
  253. following features:
  254. @itemize
  255. @item Split tmux window into multiple panes.
  256. @item Build command lines & execute them on the panes.
  257. @item Runnable from outside of tmux session.
  258. @item Runnable from inside of tmux session.
  259. @item Record operation log.
  260. @item Flexible layout arrangement for panes.
  261. @item Display pane title on each pane.
  262. @item Generate command lines from standard input (Pipe mode).
  263. @end itemize")
  264. (license license:expat)))