pomo

package module
v0.0.0-...-2bb3a35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2022 License: GPL-3.0 Imports: 8 Imported by: 1

README

Pomodoro timer

Install

This command can be installed as a standalone program or composed into a Bonzai command tree.

Standalone

go install github.com/murtaza-u/pomo/cmd/pomo@latest

Composed

package xyz

import (
	Z "github.com/rwxrob/bonzai/z"
	pomo "github.com/murtaza-u/pomo"
)

var Cmd = &Z.Cmd{
	Name:     `z`,
	Commands: []*Z.Cmd{help.Cmd, pomo.Cmd},
}

Embedded Documentation

All documentation (like manual pages) has been embedded into the source code of the application. See the source or run the program with help to access it.

pomo help

Tab Completion

To activate bash completion just use the complete -C option from your .bashrc or command line. There is no messy sourcing required. All the completion is done by the program itself.

complete -C pomo pomo

Add Pomodoro to TMUX

set -g status-interval 1
set -g status-right "#(pomo)"

Documentation

Index

Constants

View Source
const (
	DefaultDuration = "25m"
	Prefix          = "🍅"
	PrefixWarn      = "💀"
	DB              = "/tmp/pomo"
)

Variables

View Source
var Cmd = &Z.Cmd{
	Name:        "pomo",
	Summary:     "prints countdown timer to stdout",
	Description: "Simple tool to follow the pomodoro method of time boxing.",
	Version:     "v0.1",
	License:     "GPL-3.0",
	Source:      "https://github.com/murtaza-u/pomo",
	Issues:      "https://github.com/murtaza-u/pomo/issues",
	Copyright:   "(c) Murtaza Udaipurwala <murtaza@murtazau.xyz> (murtazau.xyz)",
	Site:        "https://murtazau.xyz",
	Commands:    []*Z.Cmd{help.Cmd, startCmd, stopCmd, addCmd},
	Call: func(caller *Z.Cmd, args ...string) error {
		s := new(State)
		err := s.read()
		if err != nil {
			return nil
		}

		prefix := Prefix
		if !s.isRunning() {
			prefix = PrefixWarn
		}

		fmt.Printf("%s%s\n", prefix, s.left())
		return nil
	},
}
View Source
var ErrAlreadyRunning = errors.New("session already running")
View Source
var ErrMissingArgs = errors.New("missing argument")

Functions

This section is empty.

Types

type State

type State struct {
	EndsAt time.Time
}

Directories

Path Synopsis
cmd
pomo command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL