jonaustin / tmux-pomodoro-plus

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tmux Pomodoro Plus

Tmux Pomodoro Plus

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

πŸ“– Table of Contents

✨ 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
  • Custom keybindings

πŸ“· Screenshots

Pomodoro counting down: Image

Pomodoro on a break: 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 prefix + I (capital i, as in Install) to fetch the plugin as per the TPM installation instructions

πŸš€ Usage

Default keybindings

  • <tmux-prefix> p to start a pomodoro
  • <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

Note: The pomodoro timer menu and custom pomodoro input is always <ctrl> + [your start pomodoro key]

Status bar

To incorporate into your status bar:

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

πŸ”§ Configuration

The default configuration:

set -g @pomodoro_start 'p'                  # Start a Pomodoro 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_on " πŸ…"                   # The formatted output when the pomodoro is running
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)

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]πŸ… "

πŸ”¬ 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

πŸ‘ Thanks

Thanks to the following people:

  • Wladyslaw Fedorov - For the squashed tomato image
  • basaran - For the awesome pull request to add the linux notifications and the custom input for the pomodoro duration

πŸ“ƒ License

MIT

About

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

License:MIT License


Languages

Language:Shell 100.0%