A pomodoro timer written in Crystal

See title :)

To familiarize myself with the language before diving deeper into other projects, I decided to write a pomodoro timer. The pomodoro technique is a time management technique where you shift between doing highly focused, no distraction work for some amount of time (typically 25 minutes) followed by a short break (5 minutes), with a long break (15 minutes) every 4 cycles, aka pomodoros.

It’s a major help for me since I tend to get distracted easily: coworkers sharing interesting articles, an email reaching my inbox, the :sparkles: horrors :sparkles:. Often, it’s a matter of getting started, and knowing that I “just need to work 25 minutes then have a quick break” gives me the right activation energy to sit down and work for longer than the nominal 25 minutes at a time.

To add in some whimsy, I’ve also had the program yell stuff at me during each phase. Classic hits like:

  • LOL you’re working, loser!
  • Oooooh big stretch!
  • Scribbily, griddily, bibbily, doo! I have a brand new long break for you!

can be configured for your own style of self motivation.

Maybe now I’ll get started on that uptime monitor…

Thanks for reading, and let me know if you find this helpful or have any suggestions!

Congratulations on the release! One thing I recommend is to provide pre-build binaries / releases.

I understand it was also a familiarization exercise, but I think that learning this will help you in being more prepared for the uptime monitor [1]

[1] in case you plan to publish it as open source and use the open model to attract paying customers to a hosted/paid version.

An (untested) example. Create the file .github/workflows/release.yml in your repository with the following:

# .github/workflows/release.yml
name: Release  
  
on:  
  release:  
    types: [published]  
  
jobs:  
  build:  
    name: Build (${{ matrix.os }})  
    runs-on: ${{ matrix.os }}  
    strategy:  
      matrix:  
        include:  
          - os: ubuntu-latest  
            asset_name: pomodoro_cr-linux-x86_64  
          - os: macos-latest  
            asset_name: pomodoro_cr-macos-x86_64  
  
    steps:  
      - uses: actions/checkout@v4  
  
      - name: Install Crystal  
        uses: crystal-lang/install-crystal@v1  
        with:  
          crystal: latest  
  
      - name: Build release binary  
        run: crystal build --release src/pomodoro_cr.cr -o pomodoro_cr  
  
      - name: Upload binary to release  
        uses: svenstaro/upload-release-action@v2  
        with:  
          repo_token: ${{ secrets.GITHUB_TOKEN }}  
          file: pomodoro_cr  
          asset_name: ${{ matrix.asset_name }}  
          tag: ${{ github.ref }}

Then:

  1. Go to GitHub → Releases → “Draft a new release”
  2. Create a new tag (e.g., v1.0.0) in the release form
  3. Write your release notes
  4. Click Publish release → workflow triggers

I didn’t included Windows because I don’t know if your ANSI escape sequences (that you mention in the README) are Windows compatible, but you can add later if you want to.