gabrielzschmitz / Tomato.C

A pomodoro timer written in pure C.
GNU General Public License v3.0
315 stars 19 forks source link
c linux ncurses osx pomodoro terminal wsl

tomatowelcome tomatocoffee tomatomachine tomatobeach


Tomato.C

A pomodoro timer written in pure C.

License Buy Me A Coffee Give me a Star

DependenciesHow to InstallHow to UseControlsPreferences

The Pomodoro MethodTo-doContributeLicense

🍅 The Pomodoro Method

tomatomethod

The technique basically consists of using a timer to break down work into intervals, follow the steps:

  1. Get a to-do list;

  2. Start Tomato.C and focus on a single task for 25 minutes straight until notification pops up;

  3. Then record what you completed and enjoy a 5 minutes break;

  4. After 4 pomodoros (steps 2 and 3), take a longer, 30 minutes break;

  5. Restart.

🚀 How to Use

Note: Never! Run the app with admin privileges. Just type it in the terminal:

tomato

Tip: For the best terminal resolution use setsid (the geometry depends on your font size):

setsid -f "$TERMINAL" -g 49x25 -c Tomato.C -e tomato

🕹️ Controls

noises

Use the following keys to control the application:

🔧 Preferences

You can configure the following settings at run time:

And change the default configurations editing the config.h, then sudo make install to take effect. You can change those configs:

preferences

⏰ Time to system bar

polybar module

Using of the -t flag you can pretty much do anything you want with the output.

For example, if you're using polybar, you can use it to get the time of your current pomodoro cycle to the bar. Just include the module at your polybar config:

modules-right = <other-modules> tomato <other-modules>

[module/tomato]
type = custom/script

exec = tomato -t
interval = 0
tail = true

format = <label>
format-background = ${colors.bg}
format-foreground = ${colors.fg}
format-padding = 1

label = %output%

❄️ Try it with Nix

# Only available with flakes
$ nix run github:gabrielzschmitz/Tomato.C

⚓ Dependencies

It only needs gcc to compile, ncurses as the graphic library and pkg-config to proper library's linking.

But optionally you can install libnotify to show notifications, mpv for the notifications sounds and a Nerd Font for the icons:

ARCH LINUX
$ sudo pacman -S base-devel ncurses mpv pkgconf libnotify

UBUNTU
$ sudo apt install build-essential libncurses5-dev libncursesw5-dev libmpv-dev mpv pkg-config libnotify4

FEDORA
$ sudo dnf groupinstall 'Development Tools' && sudo dnf install ncurses-devel mpv-devel pkgconf libnotify

MACOS (MacPorts needed)
$ brew install gcc && sudo port install ncurses && sudo port install mpv +libmpv

Note: if you're using WSL, install wsl-notify-send to get the notifications and then toggle it in the config.h. Sadly mpv don't work at WSL, so there's not custom sounds.

💾 How to Install

Normal

Note: a good practice is to clone the repo at $HOME/.local/src/

Note: first install all the dependencies!

$ git clone https://github.com/gabrielzschmitz/Tomato.C.git
$ cd Tomato.C
$ sudo make install

Via NixOS flakes

# flake.nix
{
  inputs = {
    tomato-c.url = "github:gabrielzschmitz/Tomato.C";
  };

  outputs = {
    tomato-c,
    ...
  }: let
    system = "x86_64-linux";
  in {
    nixosConfigurations."${your_host_name}" = lib.nixosSystem {
      specialArgs = {
        tomato-c = tomato-c.defaultPackage.${system};
      };

      modules = [
        # Add 'tomato-c' to your environment.systemPackages
        ./configuration.nix
      ];
    }
  };
}

📝 To-do

🤝 Contribute

Feel free to contribute to the project, the only requirement is to follow the commit tittle pattern.

Commit example

🍅 Adding log file

📜 License

This software is licensed under the GPL-3 license.