config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package config loads, stores, and provides default values for work and break tasks.

Index

Constants

View Source
const (
	AppName    = "pomo"
	ConfigFile = "pomo.yaml"
)

Variables

View Source
var (
	//go:embed pomo.png
	Icon []byte
	C    Config

	DefaultConfig = map[string]any{
		"onSessionEnd": "ask",
		"asciiArt": map[string]any{
			"enabled": true,
			"font":    ascii.DefaultFont,
			"color":   colors.TimerFg,
		},
		"work": map[string]any{
			"duration": 25 * time.Minute,
			"title":    "work session",
			"notification": map[string]any{
				"enabled": true,
				"urgent":  false,
				"title":   "work finished 🎉",
				"message": "time to take a break!",
			},
		},
		"break": map[string]any{
			"duration": 5 * time.Minute,
			"title":    "break session",
			"notification": map[string]any{
				"enabled": true,
				"urgent":  false,
				"title":   "break over 😴",
				"message": "back to work!",
			},
		},
		"longBreak": map[string]any{
			"enabled":  true,
			"after":    4,
			"duration": 15 * time.Minute,
		},
	}
)

Functions

func LoadConfig

func LoadConfig() error

func Setup added in v0.7.1

func Setup()

Types

type ASCIIArt added in v0.7.0

type ASCIIArt struct {
	Enabled bool
	Font    string
	Color   string
}

type Config

type Config struct {
	OnSessionEnd string
	ASCIIArt     ASCIIArt
	Work         Task
	Break        Task
	LongBreak    LongBreak
}

type LongBreak added in v1.1.0

type LongBreak struct {
	Enabled  bool
	After    int
	Duration time.Duration
}

type Notification added in v0.2.0

type Notification struct {
	Enabled bool
	Urgent  bool
	Title   string
	Message string
	Icon    string
}

type Task

type Task struct {
	Title        string
	Duration     time.Duration
	Then         [][]string
	Notification Notification
}

type TaskType added in v0.5.0

type TaskType int
const (
	WorkTask TaskType = iota
	BreakTask
)

func (TaskType) GetTask added in v0.5.0

func (t TaskType) GetTask() *Task

func (TaskType) Opposite added in v0.5.0

func (t TaskType) Opposite() TaskType

func (TaskType) String added in v0.5.3

func (t TaskType) String() string

Jump to

Keyboard shortcuts

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