Boost Productivity with a Pomodoro Timer for Linux

The Pomodoro technique is widely used by technology professionals to enhance productivity and maintain focus during long work or study sessions. This Bash script implements an automated Pomodoro cycle, providing visual and sound notifications to guide …


This content originally appeared on DEV Community and was authored by Everton Tenorio

The Pomodoro technique is widely used by technology professionals to enhance productivity and maintain focus during long work or study sessions. This Bash script implements an automated Pomodoro cycle, providing visual and sound notifications to guide the user through focus and break sessions.

The script operates in cycles of 25 minutes of concentration, followed by short 5-minute breaks. After four cycles, it triggers a long 15-minute break. The execution is continuous, ensuring the user stays on track without needing to restart the timer manually.

To facilitate interaction, the script utilizes notify-send for notifications, paplay for sound alerts, and zenity for informational dialog boxes. This approach minimizes workflow interruptions, ensuring smooth and efficient transitions between focus and rest periods.

Experts who need a simple and effective method to manage their productivity can benefit from this automated solution, which integrates directly into the Linux environment without relying on complex external applications.

pomodoro.sh

#!/bin/bash

# Time definitions (in seconds)
POMODORO=1500  # 25 minutes of focus
SHORT_BREAK=300  # 5-minute break
LONG_BREAK=900  # 15-minute break after 4 cycles

CYCLES=0

while true; do
    ((CYCLES++))

    # 🎯 Focus Time
    notify-send "🔴 Pomodoro started!" "Focus for 25 minutes."
    sleep $POMODORO
    paplay /usr/share/sounds/freedesktop/stereo/complete.oga
    zenity --info --title="Pomodoro" --text="⏳ Time's up! Time for a break." --width=300 --height=100

    # If 4 cycles are completed, take a long break
    if ((CYCLES % 4 == 0)); then
        notify-send "🌿 Long Break!" "Rest for 15 minutes."
        sleep $LONG_BREAK
        paplay /usr/share/sounds/freedesktop/stereo/complete.oga
        zenity --info --title="Pomodoro" --text="🏁 Long break over! Get back to work." --width=300 --height=100
    else
        # 🚀 Short Break
        notify-send "☕ Short Break!" "Relax for 5 minutes."
        sleep $SHORT_BREAK
        paplay /usr/share/sounds/freedesktop/stereo/complete.oga
        zenity --info --title="Pomodoro" --text="🎯 Short break over! Get ready for the next cycle." --width=300 --height=100
    fi
done


This content originally appeared on DEV Community and was authored by Everton Tenorio


Print Share Comment Cite Upload Translate Updates
APA

Everton Tenorio | Sciencx (2025-02-25T04:49:35+00:00) Boost Productivity with a Pomodoro Timer for Linux. Retrieved from https://www.scien.cx/2025/02/25/boost-productivity-with-a-pomodoro-timer-for-linux/

MLA
" » Boost Productivity with a Pomodoro Timer for Linux." Everton Tenorio | Sciencx - Tuesday February 25, 2025, https://www.scien.cx/2025/02/25/boost-productivity-with-a-pomodoro-timer-for-linux/
HARVARD
Everton Tenorio | Sciencx Tuesday February 25, 2025 » Boost Productivity with a Pomodoro Timer for Linux., viewed ,<https://www.scien.cx/2025/02/25/boost-productivity-with-a-pomodoro-timer-for-linux/>
VANCOUVER
Everton Tenorio | Sciencx - » Boost Productivity with a Pomodoro Timer for Linux. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/02/25/boost-productivity-with-a-pomodoro-timer-for-linux/
CHICAGO
" » Boost Productivity with a Pomodoro Timer for Linux." Everton Tenorio | Sciencx - Accessed . https://www.scien.cx/2025/02/25/boost-productivity-with-a-pomodoro-timer-for-linux/
IEEE
" » Boost Productivity with a Pomodoro Timer for Linux." Everton Tenorio | Sciencx [Online]. Available: https://www.scien.cx/2025/02/25/boost-productivity-with-a-pomodoro-timer-for-linux/. [Accessed: ]
rf:citation
» Boost Productivity with a Pomodoro Timer for Linux | Everton Tenorio | Sciencx | https://www.scien.cx/2025/02/25/boost-productivity-with-a-pomodoro-timer-for-linux/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.