Skip to content

πŸ… Incorporate the Pomodoro technique into your tmux workflow

License

Notifications You must be signed in to change notification settings

matteodiga/tmux-pomodoro-plus

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tmux Pomodoro Plus

Tmux Pomodoro Plus

Incorporate the Pomodoro technique into your tmux setup. Forked from Tmux Pomodoro

✨ Features

  • Toggle pomodoro timer on/off and see the countdown in the status bar
  • Upon completion of a pomodoro, see a break countdown in the status bar
  • Desktop alerts for pomodoro and break completion (macOS and Linux only)
  • Customise the pomodoro duration and break times
  • Automatically repeat your pomodoros
  • Custom keybindings

πŸ“· Screenshots

Pomodoro counting down: Image

Pomodoro on a break: Image

Pomodoro counting down in real-time: Image

Pomodoro timer menu: Image

πŸ“¦ Installation

  1. Using TPM, add the following line to your ~/.tmux.conf file:
set -g @plugin 'olimorris/tmux-pomodoro-plus'

Note: The above line should be before run '~/.tmux/plugins/tpm/tpm'

  1. Then press tmux-prefix + I (capital i, as in Install) to fetch the plugin as per the TPM installation instructions

πŸš€ Usage

Default keybindings

Note: It's possible to bind start and cancel to the same key!

  • <tmux-prefix> p to start a pomodoro/break
  • <tmux-prefix> P to cancel a pomodoro
  • <tmux-prefix> C-p to open the pomodoro timer menu
  • <tmux-prefix> M-p to set a custom pomodoro timer

The pomodoro timer menu and custom pomodoro input are always <ctrl>/<alt> + [your start pomodoro key].

Status bar

To incorporate into your status bar:

set -g status-right "#{pomodoro_status}"

πŸ”§ Configuration

Note: On Linux, notifications depend on notify-send/libnotify-bin

The default configuration:

set -g @pomodoro_start 'p'                  # Start a Pomodoro or start break with tmux-prefix + p
set -g @pomodoro_cancel 'P'                 # Cancel a Pomodoro with tmux-prefix key + P

set -g @pomodoro_mins 25                    # The duration of the pomodoro
set -g @pomodoro_break_mins 5               # The duration of the break after the pomodoro
set -g @pomodoro_repeat false               # Auto-repeat the pomodoro? False by default
set -g @pomodoro_auto_start_break true      # Auto-start break when pomodoro end? True by default

set -g @pomodoro_on " πŸ…"                   # The formatted output when the pomodoro is running
set -g @pomodoro_ask_break " πŸ•€ break?"     # The formatted output when wait to start break
set -g @pomodoro_complete " βœ…"             # The formatted output when the break is running

set -g @pomodoro_notifications 'off'        # Enable desktop notifications from your terminal
set -g @pomodoro_sound 'off'                # Sound for desktop notifications (Run `ls /System/Library/Sounds` for a list of sounds to use on Mac)

set -g @pomodoro_granularity 'off'          # Enables MM:SS (ex: 00:10) format instead of the default (ex: 1m)

Customising the status line

The output from the plugin can be completely customised to fit in with your status line. For example:

set -g @pomodoro_on "#[fg=$text_red]πŸ… "
set -g @pomodoro_complete "#[fg=$text_green]πŸ… "
set -g @pomodoro_ask_break "#[fg=$color_gray]πŸ•€ ? "

A real-time countdown can also be enabled in the status line:

set -g @pomodoro_granularity 'on'
set -g status-interval 1                    # Refresh the status line every second

πŸ”¬ How it works

  • Starting a Pomodoro:
    • Uses date +%s to get the current timestamp and write to /tmp/pomodoro.txt
    • This allows the app to keep track of the elapsed time
  • Completing a Pomodoro:
    • Writes the status of the pomodoro to /tmp/pomodoro_status.txt
    • This allows the app to know what type of notification to send
  • Cancelling a Pomodoro:
    • Deletes /tmp/pomodoro.txt
    • Deletes /tmp/pomodoro_status.txt
  • Getting the status of a Pomodoro:
    • Countdown: Compares current timestamp (via date +%s) with the start timestamp in /tmp/pomodoro.txt
    • Break: Compares the current timestamp with the start timestamp and adds on the break duration

πŸ‘ Credits

πŸ“ƒ License

MIT

About

πŸ… Incorporate the Pomodoro technique into your tmux workflow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%