tmux popup windows for quickly launching scripts

2021-07-10

I was inspired by this video , which uses the pop-up window feature in tmux v3.2+ to quickly launch scripts that don’t deserve their own pane. I wrote a similar script to handle the pop-ups, which I keep in my $PATH:

#!/usr/bin/env sh

# List scripts 
read -d '' APPS << EOF
passwords	~/bin/tmux_popup/./fpass_popup
mount drives	~/bin/netmount
search papers	~/bin/papers
stopwatch	~/bin/stopwatch
internet speed test	~/bin/speed
emojis	~/bin/tmux_popup/./emoji_popup
calculator	~/bin/tmux_popup/./calc_popup
EOF

SELECTED="$(echo "$APPS" | fzf -d "	" --with-nth 1 | sed "s/.*\t//g")"

eval "${SELECTED}"

The scripts are listed by their name, which appears in the fzf pop-up, and their path, separated by a tab.

Example of tmux popup window

The scripts currently available in the popup:

The script is launched by hitting <prefix>-Tab in tmux, using this line in my .tmux.conf:

bind-key Tab capture-pane \; save-buffer /tmp/tmux-buffer \; delete-buffer \; display-popup -w 50% -h 50% -E "/path/to/fzf-speed"