Skip to content

A free, simple, open-source, cross-platform Pomodoro timer app with WebHook support.

License

Notifications You must be signed in to change notification settings

recoskyler/pomo

Repository files navigation

Pomo

style: very good analysis

Buy Me a Coffee at ko-fi.com

A simple, cross-platform Pomodoro timer app with WebHook support.

Dark Mode Screenshot

Light Mode Screenshot

Settings Page Screenshot


🌟 Features

  • ⏱ Adjustable work, short break, and long break durations
  • πŸ‘ Adjustable lap count
  • 🌐 Webhook integration
  • πŸŒ› Light/Dark theme
  • 🌈 Themes in a variety of colors
  • ⏰ Customizable timer font
  • πŸ“’ Customizable sounds

⌨ Keyboard Shortcuts

  • Space or Enter to start/pause the timer
  • s to skip the lap
  • r or BackSpace to reset the timer

🌐 Using WebHooks

You can configure WebHooks from the Settings page. When a webhook is triggered, RGB color data in JSON format will be sent along (check below). This RGB color data corresponds to the color of the circular progress indicator on the home page. You can see an example of this data below:

{
    "rgb": [
        255, // RED Value
        0,   // GREEN Value
        156, // BLUE Value
    ]
}

Triggering multiple webhooks

If you would like to trigger multiple WebHook URLs from a single event, you can enter multiple URLs separated by a comma. e.g.:

https://example.com/api/v1/webhooks/start,https://example2.com/api/v1/webhooks/toggle

HomeAssistant Integration

The main reason I created this application was to use these WebHooks to control my ambient light using HomeAssistant. If you have an RGB(W) LED bulb connected to HomeAssistant, you can create a new WebHook automation, and use the sample configuration below to set your light bulb's color to the data provided by Pomo:

alias: Timer Tick Webhook
description: "Runs every second, whenever Pomo ticks."
trigger:
  - platform: webhook
    allowed_methods:
      - POST
      - PUT
    local_only: true
    webhook_id: "-YOUR_WEBHOOK_ID"
condition:
  - condition: device
    type: is_on
    device_id: REPLACE_WITH_DEVICE_ID
    entity_id: REPLACE_WITH_ENTITY_ID
    domain: light
action:
  - service: light.turn_on
    metadata: {}
    data:
      rgb_color: "{{ trigger.json['rgb'] }}"
      transition: 1
    target:
      entity_id: light.192_168_1_3
mode: single

Installing

You can either download and install one of the already-built releases, or build it yourself.

Development

Tech Stack

  • Flutter 3.19.6
  • Dart 3.3.4

This project contains 3 flavors:

  • development
  • staging
  • production

To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:

# Development
$ flutter run --flavor development --target lib/main_development.dart

# Staging
$ flutter run --flavor staging --target lib/main_staging.dart

# Production
$ flutter run --flavor production --target lib/main_production.dart

*Pomo works on iOS, Android, Web, Linux, MacOS, and Windows.


Working with Translations 🌐

This project relies on flutter_localizations and follows the official internationalization guide for Flutter.

Adding Strings

  1. To add a new localizable string, open the app_en.arb file at lib/l10n/arb/app_en.arb.
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}
  1. Then add a new key/value and description
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    },
    "helloWorld": "Hello World",
    "@helloWorld": {
        "description": "Hello World Text"
    }
}
  1. Use the new string
import 'package:pomo/l10n/l10n.dart';

@override
Widget build(BuildContext context) {
  final l10n = context.l10n;
  return Text(l10n.helloWorld);
}

Adding Supported Locales

Update the CFBundleLocalizations array in the Info.plist at ios/Runner/Info.plist to include the new locale.

...

<key>CFBundleLocalizations</key>
<array>
    <string>en</string>
</array>

...

Adding Translations

  1. For each supported locale, add a new ARB file in lib/l10n/arb.
β”œβ”€β”€ l10n
β”‚   β”œβ”€β”€ arb
β”‚   β”‚   β”œβ”€β”€ app_en.arb
β”‚   β”‚   └── app_es.arb
  1. Add the translated strings to each .arb file:

app_en.arb

{
    "@@locale": "en",
    "timer": "Timer"
    ...
}

Generating Translations

To use the latest translations changes, you will need to generate them:

  1. Generate localizations for the current project:
flutter gen-l10n --arb-dir="lib/l10n/arb"

Alternatively, run flutter run and code generation will take place automatically.

Generating Splash Screens

To use the latest splash screen changes, you will need to generate them:

dart run flutter_native_splash:create

Generating Launcher Icons

To use the latest launcher icon (<project root>/assets/images/pomo_logo.png) changes, you will need to generate them:

dart run flutter_launcher_icons

Building

Building for the web

$ flutter build web --release -o docs

Building .APK

Follow the steps here. Make sure to create a keystore.

$ flutter build apk

Building .DEB & .RPM (on Ubuntu 22.04)

More info here and here.

Building .DEB

$ flutter_distributor release --name=dev --jobs=release-dev-linux-deb

Building .RPM

$ sudo apt-get install rpm patchelf

$ flutter_distributor release --name=dev --jobs=release-dev-linux-rpm

Building .EXE

good luck

help

About

By recoskyler - 2024

  • Used Major Mono Display font by Emre Parlak.