tmux.scm 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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 cmake)
  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))
  43. (define-public tmux
  44. (package
  45. (name "tmux")
  46. (version "3.3a")
  47. (source (origin
  48. (method url-fetch)
  49. (uri (string-append
  50. "https://github.com/tmux/tmux/releases/download/"
  51. version "/tmux-" version ".tar.gz"))
  52. (sha256
  53. (base32
  54. "0gzrrm6imhcp3sr5vw8g71x9n40bbdidwvcdyk2741xx8dw39zg4"))))
  55. (build-system gnu-build-system)
  56. (inputs
  57. (list libevent 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. (list procps)) ;tests need top
  161. (native-inputs
  162. (list python-pytest tmux))
  163. (arguments
  164. `(#:phases
  165. (modify-phases %standard-phases
  166. (replace 'check
  167. (lambda _
  168. ;; Fix <https://github.com/tmux-python/libtmux/issues/265>.
  169. (setenv "LANG" "en_US.utf8")
  170. ;; Skip tests that I suspect fail because of a change
  171. ;; in behavior in tmux 3 from tmux 2
  172. ;; https://github.com/tmux-python/libtmux/issues/281
  173. (invoke "pytest" "-vv" "-k"
  174. (string-append "not test_show_option_unknown "
  175. "and not test_show_window_option_unknown"))
  176. #t)))))
  177. (home-page "https://github.com/tmux-python/libtmux")
  178. (synopsis "Python API for tmux")
  179. (description "Libtmux is the tool behind @command{tmuxp}, a tmux workspace
  180. manager in Python. It creates object mappings to traverse, inspect and interact
  181. with live tmux sessions.")
  182. (license license:expat)))
  183. (define-public python-daemux
  184. (package
  185. (name "python-daemux")
  186. (version "0.1.0")
  187. (source
  188. ;; We fetch from the Git repo because there are no tests in the PyPI
  189. ;; archive.
  190. (origin
  191. (method git-fetch)
  192. (uri (git-reference
  193. (url "https://github.com/edouardklein/daemux")
  194. (commit (string-append "v" version))))
  195. (file-name (git-file-name name version))
  196. (sha256
  197. (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
  198. (build-system python-build-system)
  199. (arguments
  200. `(#:phases (modify-phases %standard-phases
  201. (replace 'check
  202. (lambda _
  203. (mkdir-p "tmptmux")
  204. (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
  205. (invoke "tmux" "new-session" "-d")
  206. (invoke "make" "test"))))))
  207. (propagated-inputs
  208. (list python-libtmux))
  209. (native-inputs
  210. (list python-coverage python-sphinx tmux))
  211. (home-page "https://github.com/edouardklein/daemux")
  212. (synopsis "Start, stop, restart and check daemons via tmux")
  213. (description
  214. "Daemux lets you run daemons in a @command{tmux} pane. Users can launch
  215. long-running background tasks, and check these tasks' health by hand, relaunch
  216. them, etc., by attaching to the corresponding pane in tmux.")
  217. (license license:agpl3+)))
  218. (define-public tmux-xpanes
  219. (package
  220. (name "tmux-xpanes")
  221. (version "4.1.3")
  222. (source (origin
  223. (method git-fetch)
  224. (uri (git-reference
  225. (url "https://github.com/greymd/tmux-xpanes")
  226. (commit (string-append "v" version))))
  227. (file-name (git-file-name name version))
  228. (sha256
  229. (base32
  230. "09fmnn1q76r1l4cv7clmfr3j9cjmd053kq238d0qj2i486948ivv"))))
  231. (build-system trivial-build-system)
  232. (inputs
  233. (list bash))
  234. (arguments
  235. `(#:modules ((guix build utils))
  236. #:builder
  237. (begin
  238. (use-modules (guix build utils))
  239. (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
  240. (copy-recursively (assoc-ref %build-inputs "source") ".")
  241. (substitute* "bin/xpanes"
  242. (("/bin/bash") (which "bash")))
  243. (install-file "bin/xpanes" (string-append %output "/bin"))
  244. (install-file "man/xpanes.1" (string-append %output "/man/man1"))
  245. #t)))
  246. (home-page "https://github.com/greymd/tmux-xpanes")
  247. (synopsis "Tmux based terminal divider")
  248. (description "This package provides tmux-based terminal divider.
  249. @code{xpanes} or @code{tmux-xpanes} (alias of @code{xpanes}) commands have
  250. following features:
  251. @itemize
  252. @item Split tmux window into multiple panes.
  253. @item Build command lines & execute them on the panes.
  254. @item Runnable from outside of tmux session.
  255. @item Runnable from inside of tmux session.
  256. @item Record operation log.
  257. @item Flexible layout arrangement for panes.
  258. @item Display pane title on each pane.
  259. @item Generate command lines from standard input (Pipe mode).
  260. @end itemize")
  261. (license license:expat)))
  262. (define-public tmux-plugin-resurrect
  263. (let ((commit "a2ddfb96b94bb64a7a2e3f5fa2a7c57dce8ad579")
  264. (revision "0"))
  265. (package
  266. (name "tmux-plugin-resurrect")
  267. (version (git-version "0" revision commit))
  268. (source (origin
  269. (method git-fetch)
  270. (uri (git-reference
  271. (url "https://github.com/tmux-plugins/tmux-resurrect/")
  272. (commit commit)))
  273. (file-name (git-file-name name version))
  274. (sha256
  275. (base32
  276. "1gc8z99na1d4scn2kq4alwyn43h3r7ykz9bkhcypjh8iri6dsl0c"))))
  277. (build-system trivial-build-system)
  278. (arguments
  279. `(#:modules ((guix build utils))
  280. #:builder (begin
  281. (use-modules (guix build utils))
  282. (let ((out (string-append %output
  283. "/share/tmux-plugins/resurrect/")))
  284. (mkdir-p out)
  285. (copy-recursively (assoc-ref %build-inputs "source") out)))))
  286. (synopsis "Restore tmux environment after system restart")
  287. (description
  288. "This plugin goes to great lengths to save and restore all the details
  289. from your tmux environment. Here's what's been taken care of:
  290. @itemize
  291. @item all sessions, windows, panes and their order
  292. @item current working directory for each pane
  293. @item exact pane layouts within windows (even when zoomed)
  294. @item active and alternative session
  295. @item active and alternative window for each session
  296. @item windows with focus
  297. @item active pane for each window
  298. @item \"grouped sessions\" (useful feature when using tmux with multiple monitors)
  299. @item programs running within a pane! More details in the restoring programs doc.
  300. @end itemize
  301. Optional:
  302. @itemize
  303. @item restoring vim and neovim sessions
  304. @item restoring pane contents
  305. @end itemize")
  306. (home-page "https://github.com/tmux-plugins/tmux-resurrect/")
  307. (license license:expat))))
  308. (define-public tmux-plugin-mem-cpu-load
  309. (package
  310. (name "tmux-plugin-mem-cpu-load")
  311. (version "3.7.0")
  312. (source (origin
  313. (method git-fetch)
  314. (uri (git-reference
  315. (url "https://github.com/thewtex/tmux-mem-cpu-load")
  316. (commit (string-append "v" version))))
  317. (sha256
  318. (base32
  319. "03bax7g9jlsci44ccs50drh617ya3fzvlplwyvxfyb7mgmh85r72"))
  320. (file-name (git-file-name name version))))
  321. (build-system cmake-build-system)
  322. (synopsis "CPU, RAM, and load monitor for use with tmux")
  323. (description "This package provides a lightweight program for system
  324. monitoring in the status line of tmux.
  325. The memory monitor displays the used and available memory.
  326. The CPU usage monitor outputs a percent CPU usage over all processors. It
  327. also displays a textual bar graph of the current percent usage.
  328. The system load average is also displayed.")
  329. (home-page "https://github.com/thewtex/tmux-mem-cpu-load")
  330. (license license:asl2.0)))