| Crates.io | tmux-menu |
| lib.rs | tmux-menu |
| version | 0.1.17 |
| created_at | 2023-03-02 05:28:58.867659+00 |
| updated_at | 2025-09-19 04:24:54.18494+00 |
| description | Easy configuration of tmux display-menu with yaml |
| homepage | |
| repository | https://github.com/Ja-sonYun/tmux-easy-menu |
| max_upload_size | |
| id | 798656 |
| size | 53,985 |

cargo install tmux-menu
To see more actual config files, checkout ./examples folder.
# On tmux.conf, add below line.
#
# bind-key k run-shell "tmux-menu show --menu $HOME/tmux-menu/examples/menu.yaml --working_dir #{pane_current_path}"
#
# =============================
#
title: "..."
border: "rounded" # Optional, possible options are: single, rounded, double, heavy, simple, padded, none
position:
x: ...
y: ...
items:
- Seperate: {} # Draw seperate line
- NoDim: # Add row, but unselectable
name: "..."
- Menu: # Add selectable row
name: "..."
shortcut: "..." # Optional
# ------------------
# You can define next_menu or command
next_menu: "..." # Show this menu when this row selected
# ... OR
command: "command %%KEY%% --cwd %%PWD" # Run command, %%PWD will replaced with cwd
inputs:
- KEY # This input will be replaced with '%%KEY%%' on command
# ------------------
background: false # Run command in background, popup will closed immediately
close_after_command: true # Close popup after command exited. if false, you should type <C-c> to close popup.
border: none # Select popup border type, optional, possible options are: single, rounded, double, heavy, simple, padded, none
session: false # Run commmand in new session. Useful for long running command. To hide popup while command running, use <C-d> to detach and close.
session_name: name # Session name, which will be used if session is true. This must be unique.
session_on_dir: false # Include directory path in session name
run_on_git_root: false # Run command from git repository root instead of current directory
environment: # Set environment variables for command execution
MY_VAR: "value"
ANOTHER_VAR: "another value"
position:
x: ...
y: ...
w: ...
h: ...
Below example will show running brew services on display-menu, and restart it if clicked.
#!/bin/bash
# generate_brew_services_restart_menu.sh
TEMP_MENU_FILE="/tmp/temp_menu.yaml"
rm -f $TEMP_MENU_FILE
cat > $TEMP_MENU_FILE << EOM
title: " brew services "
items:
- Seperate: {}
- NoDim:
name: " Running services "
- NoDim:
name: " (select to restart) "
- Seperate: {}
EOM
brew services list | while read line
do
program=$(echo $line | awk '{print $1}')
status=$(echo $line | awk '{print $2}')
if [ "$status" == "started" ]; then
cat >> $TEMP_MENU_FILE <<- EOM
- Menu:
name: "$program"
shortcut: ".."
command: "brew services restart $program"
background: true
EOM
fi
done
tmux-menu show --menu $TEMP_MENU_FILE
rm -f $TEMP_MENU_FILE
and add menu item as below
- Menu:
name: "restart brew services"
shortcut: b
command: "$PATH_TO_SCRIPT/generate_brew_services_restart_menu.sh"
background: true
You can set environment variables that will be available when your commands execute:
- Menu:
name: "run with env vars"
shortcut: e
command: "echo $MY_VAR && echo $PATH_VAR"
environment:
MY_VAR: "Hello World"
PATH_VAR: "/custom/path"
Environment variables work with all execution modes: