A break timer in your status bar. The Pomodoro technique is 25 minutes of focused work, a 5-minute break, and a longer break after four rounds. Your tmux status bar is the one place you look all day, which makes it a good home for the countdown.
Two working setups below: the tmux-pomodoro-plus plugin if you already use TPM, or a 40-line shell script with no dependencies. Then what to actually do with the five minutes.
prefix p by defaultolimorris/tmux-pomodoro-plus is the maintained fork of the original tmux-pomodoro plugin. Install it with TPM: add the plugin line above the run line, then press prefix I to fetch it.
# ~/.tmux.conf
set -g @plugin 'olimorris/tmux-pomodoro-plus'
set -g @pomodoro_mins 25 # focus length
set -g @pomodoro_break_mins 5 # short break
set -g @pomodoro_intervals 4 # rounds before a long break
set -g @pomodoro_long_break_mins 15 # long break
set -g @pomodoro_granularity 'on' # show 24:59 instead of 25m
set -g @pomodoro_notifications 'on' # desktop notification when a timer ends
set -g @pomodoro_interval_display '[%s/%s]'
set -g status-interval 1 # redraw every second for the live countdown
set -g status-right '#{pomodoro_status} %H:%M'
run '~/.tmux/plugins/tpm/tpm'| Keys | Action |
|---|---|
| prefix p | Start, or pause and resume, a Pomodoro or break |
| prefix P | Cancel |
| prefix _ | Skip the current Pomodoro or break |
| prefix e | Restart the Pomodoro |
| prefix C-p | Open the timer menu |
| prefix M-p | Set a custom duration |
prefix p is tmux's default for "previous window". If you use it, move the toggle with set -g @pomodoro_toggle 'y'; the menu and custom-time keys follow the toggle key (prefix C-y, prefix M-y), and none of the three is bound in a default tmux. On Linux, notifications need notify-send (package libnotify-bin).
The script keeps its state in two tmux user options (@pomodoro_mode and @pomodoro_end, a Unix timestamp), so it needs no temp files and the timer survives detaching. The status bar calls it every second; when a focus block ends it shows a message and starts the break, and when the break ends it clears itself. Save it as ~/.tmux/pomodoro.sh and run chmod +x ~/.tmux/pomodoro.sh.
#!/usr/bin/env bash
# ~/.tmux/pomodoro.sh start | break | stop | status
WORK_MIN=${POMODORO_WORK_MIN:-25}
BREAK_MIN=${POMODORO_BREAK_MIN:-5}
now() { date +%s; }
get() { tmux show-option -gqv "@pomodoro_$1"; }
put() { tmux set-option -gq "@pomodoro_$1" "$2"; }
case "$1" in
start)
put mode focus
put end $(( $(now) + WORK_MIN * 60 ))
;;
break)
put mode break
put end $(( $(now) + BREAK_MIN * 60 ))
;;
stop)
tmux set-option -gqu @pomodoro_mode
tmux set-option -gqu @pomodoro_end
;;
status)
mode=$(get mode)
[ -z "$mode" ] && exit 0
left=$(( $(get end) - $(now) ))
if [ "$left" -le 0 ]; then
if [ "$mode" = focus ]; then
tmux display-message -d 5000 "Pomodoro done. Take a ${BREAK_MIN}-minute break."
"$0" break
else
tmux display-message -d 5000 "Break over. Back to it."
"$0" stop
fi
exit 0
fi
printf '%s %02d:%02d' "$mode" $(( left / 60 )) $(( left % 60 ))
;;
esacWire it into ~/.tmux.conf:
set -g status-interval 1 set -g status-right '#[fg=colour208]#(~/.tmux/pomodoro.sh status)#[default] %H:%M' bind P run-shell '~/.tmux/pomodoro.sh start' # prefix P: start 25 minutes bind O run-shell '~/.tmux/pomodoro.sh stop' # prefix O: stop the timer # Optional: different lengths set-environment -g POMODORO_WORK_MIN 50 set-environment -g POMODORO_BREAK_MIN 10
prefix P, and focus 24:59 appears on the right of the status bar.P and O are unbound in a default tmux, so nothing is overwritten.display-message -d needs tmux 3.2 or newer. On older versions drop -d 5000.afplay /System/Library/Sounds/Glass.aiff & (macOS) or paplay (Linux) next to each display-message.For colours, separators and other segments, see customizing the tmux status bar.
The timer is the easy part. A break spent on Slack or a news tab is just more screen time with a different tab, and you come back as tired as you left. Five minutes is enough for three things that actually reset you:
Walk to refill your water, stretch your shoulders and the back of your neck, roll your wrists. Getting out of the chair is the point.
Look at something at least 6 metres (20 feet) away for 20 seconds or more, ideally out of a window. Your eyes have been focused at arm's length for 25 minutes.
Two minutes of slow breathing is the quickest way to come down from a tense debugging session. Pick one of the two patterns below.
| Technique | Pattern | How long |
|---|---|---|
| Box breathing | In for 4, hold for 4, out for 4, hold for 4 | 4 to 6 rounds, about 1.5 minutes |
| 4-7-8 | In through the nose for 4, hold for 7, out through the mouth for 8 | 4 rounds; start with fewer if the hold feels long |
If you'd like the counts in front of you rather than in your head, keep a printed sheet next to the keyboard. Our sister site has box breathing and 4-7-8, one page you can print, with a few other techniques for when those don't suit you.
After four rounds, take 15 to 30 minutes away from the desk. A short walk outside does more than anything you can do in the chair. Start a long build or a test suite before you go, and let tmux's silence alerts tell you it's done when you're back.
[%s/%s] display makes "four rounds before lunch" a target you can see.AI Powered, Non-Intrusive Terminal Assistant
TmuxAI enhances your terminal with AI-powered commands, automation, and contextual awareness while preserving your existing workflow. It's open-source, privacy-focused, and can be used with any terminal emulator.
curl -fsSL https://get.tmuxai.dev | bash