tmux-wormhole - download files and directories with tmux!

Overview

tmux-wormhole

Use tmux and magic wormhole to get things from your remote computer to your tmux. If tmux has DISPLAY set, open the file locally!

Demo

tmux-wormhole

Usage

  • On your remote computer, display the magic wormhole code.
  • Press ( prefix + w )
  • Hit OK to transfer.

Prerequisites

tmux-wormhole is written in Go. To install tmux-wormhole successfully, you'll need Go version 1.13 or higher.

Setup with Tmux Plugin Manager

Set up this plugin via TPM by adding this to your ~/.tmux.conf:

set -g @plugin 'gcla/tmux-wormhole'

Install the plugin by hitting prefix + I.

Setup Manually

Clone the repo:

git clone https://github.com/gcla/tmux-wormhole ~/.tmux/plugins/tmux-wormhole

Compile it:

cd ~/.tmux/plugins/tmux-wormhole
GO11MODULE=on go build -o tmux-wormhole cmd/tmux-wormhole/main.go

Source it by adding this to your ~/.tmux.conf:

run-shell ~/.tmux/plugins/tmux-wormhole/tmux-wormhole.tmux

Reload TMUX's config with:

tmux source-file ~/.tmux.conf

Configuration

Set these in your ~/.tmux.conf file.

  • @wormhole-key - how to launch tmux-wormhole (default: w)
  • @wormhole-save-folder - where to keep transferred files and directories (default: XDG download dir e.g. ~/Downloads/)
  • @wormhole-open-cmd - run this command after a file is transferred (default: xdg-open or open)
  • @wormhole-no-default-open - just transfer, don't run anything afterwards (default: false)
  • @wormhole-no-ask-to-open - after a file is transferred, ask the user interactively if the file should be opened (default: false)
  • @wormhole-can-overwrite - allow tmux-wormhole to overwite a file or directory of the same name locally (default: false)

How does it work

The plugin uses sleight of hand to make it look as though its prompts are being displayed over the active pane. When you hit the tmux-wormhole hotkey, the plugin does the following:

  • saves the contents of the active pane to a temporary file e.g. /tmp/wormhole
  • launches a new tmux session called wormhole, with...
  • a pane running cat /tmp/wormhole ; sleep infinity

If you were to attach to the wormhole session, this pane should look like the currently active pane. Next the plugin will:

  • create a new window called wormhole-ABC in the active session
  • with a single pane running the Go program tmux-wormhole
  • tmux-wormhole is a gowid application that overlays a dialog widget on top of a terminal widget. The terminal widget runs tmux attach -L wormhole

Finally, the plugin swaps the currently active pane with the pane from wormhole-ABC.

The effect is that the terminal now has a yellow dialog overlaid.

Sources

  • tmux-thumbs for the project structure which I freely plagiarized!
  • wormhole-william - a GoLang implementation of magic wormhole
  • gowid - my Go TUI framework, which itself heavily depends on...
  • tcell - like ncurses for GoLang

License

MIT

You might also like...
Go-file-downloader-ftctl - A file downloader cli built using golang. Makes use of cobra for building the cli and go concurrent feature to download files
This is the tool to download files from qiniu cruster manually.

This is the tool to download files from qiniu cruster manually. toCheck = []string{ sealPath, filepath.Join(cachePath, "p_aux"), filepath.Join(cachePa

Downloader written in golang to download the public data files from RUC Paraguay.

rucpy-downloader Downloader written in golang to download the public data files(RUC Paraguay) from set.gov.py. The downloader will download the public

Gowget - A simple wget tool built using golang to download files from the internet whether it is zip

gowget wget built using golang About: A simple wget tool built using golang to d

zipspy - a CLI tool to extract files from zip archives in S3 without needing to download the entire archive

Zipspy allows you interact with ZIP archives stored in remote locations without requiring a local copy. For example, you can list the filenames in an S3 ZIP archive, download a subset of files, search and retrieve files with regular expressions, and more!

A simple tool which you can use to move through your directories from the command line

Fe What is Fe ? Fe is a simple tool which you can use to move through your direc

Download and install binaries from GitHub Releases, interactively.

bget Download and install binary files from GitHub Releases. Preview Install For Mac/Linux users, you can use Homebrew to install it: brew install ego

CLI tool to upload object to s3-compatible storage backend and set download policy for it.
CLI tool to upload object to s3-compatible storage backend and set download policy for it.

typora-s3 CLI tool to upload object to s3-compatible storage backend and set download policy for it. Build $ git clone https://github.com/fengxsong/ty

Little golang app that allows you to download a youtube video as mp3, and optionally embed ID3 tags -Cover Art, Artist ...-

yt2mp3 Little golang app that allows you to download a youtube video as mp3, and optionally embed ID3 tags -Cover Art, Artist ...- Instructions At the

Comments
Owner
Graham Clark
Graham Clark
Rclone ("rsync for cloud storage") is a command-line program to sync files and directories to and from different cloud storage providers.

Website | Documentation | Download | Contributing | Changelog | Installation | Forum Rclone Rclone ("rsync for cloud storage") is a command-line progr

null 0 Nov 5, 2021
F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely. Written in Go!

F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely.

Ayooluwa 588 Dec 31, 2022
:zap: boilerplate template manager that generates files or directories from template repositories

Boilr Are you doing the same steps over and over again every time you start a new programming project? Boilr is here to help you create projects from

Tamer Tas 1.5k Jan 6, 2023
Command-line tool to organize large directories of media files recursively by date, detecting duplicates.

go-media-organizer Command-line tool written in Go to organise all media files in a directory recursively by date, detecting duplicates.

Allan Avelar 8 Jan 6, 2022
Slice and dice your TMUX windows and panes

chaakoo Introduction Configuration Using Chaakoo Examples Download License Introduction Chaakoo is a wrapper over TMUX that can create sessions, windo

Pallav Jha 85 Nov 1, 2022
go program that installs and customizes ohmyzsh tmux vim via various plugins and other nice to haves

Pimp-My-Shell Table of Contents Pimp-My-Shell Install Usage About Resources Tmux Hotkeys VIM Hotkeys Adjusting Custom Aliases Mac Fix Terminal bind ke

null 23 Dec 22, 2022
Got: Simple golang package and CLI tool to download large files faster 🏃 than cURL and Wget!

Got. Simple and fast concurrent downloader. Installation ❘ CLI Usage ❘ Module Usage ❘ License Comparison Comparison in cloud server: [[email protected]

Mohamed El Bahja 620 Dec 29, 2022
Plugin which makes tmux work and feel like i3wm

Tmux Tilish This is a plugin that makes tmux behave more like a typical dynamic window manager. It is heavily inspired by i3wm, and most keybindings a

Jabir Ali Ouassou 289 Jan 7, 2023
Trzsz-go - A simple file transfer tools, similar to lrzsz ( rz / sz ), and compatible with tmux

Trzsz-go - A simple file transfer tools, similar to lrzsz ( rz / sz ), and compatible with tmux

null 362 Dec 31, 2022
Go-file-downloader-ftctl - A file downloader cli built using golang. Makes use of cobra for building the cli and go concurrent feature to download files.

ftctl This is a file downloader cli written in Golang which uses the concurrent feature of go to download files. The cli is built using cobra. How to

Dipto Chakrabarty 2 Jan 2, 2022