Documentation
¶
Index ¶
- func AppDir(homeDir string) string
- func ConfigDir(homeDir string) string
- func ConfigFilePath(homeDir string) string
- func DataDir(homeDir string) string
- func DbFilePath(homeDir string) string
- func LogDir(homeDir string) string
- func NotificationFilePath(homeDir string) string
- type Config
- type Option
- func OptBreakSoundAlertPath(s string) Option
- func OptClockColor(s string) Option
- func OptDefaultTag(s string) Option
- func OptHomeDir(s string) Option
- func OptLongBreakDuration(i int) Option
- func OptNoNotification(b bool) Option
- func OptNoShortcutsNotification(b bool) Option
- func OptNoSoundAlert(b bool) Option
- func OptShortBreakDuration(i int) Option
- func OptTags(tags map[string]Tag) Option
- func OptWorkDuration(i int) Option
- func OptWorkSoundAlertPath(s string) Option
- type Tag
- type TagTriggers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFilePath ¶
ConfigFilePath returns the full path to pomati.yaml.
func DbFilePath ¶
DbFilePath returns the full path to pomati.yaml.
func NotificationFilePath ¶
NotificationFilePath returns the full path to pomati.yaml.
Types ¶
type Config ¶
type Config struct {
ClockColor string `mapstructure:"clock_color" yaml:"clock_color"`
WorkDuration int `mapstructure:"work_duration" yaml:"work_duration"`
ShortBreakDuration int `mapstructure:"short_break_duration" yaml:"short_break_duration"`
LongBreakDuration int `mapstructure:"long_break_duration" yaml:"long_break_duration"`
NoNotification bool `mapstructure:"no_notification" yaml:"no_notification"`
NoSoundAlert bool `mapstructure:"no_sound_alert" yaml:"no_sound_alert"`
NoShortcutsNotification bool `mapstructure:"no_shortcuts_notification" yaml:"no_shortcuts_notification"`
WorkSoundAlertPath string `mapstructure:"work_sound_alert_path" yaml:"work_sound_alert_path"`
BreakSoundAlertPath string `mapstructure:"break_sound_alert_path" yaml:"break_sound_alert_path"`
Tags map[string]Tag `mapstructure:"tags" yaml:"tags"`
DefaultTag string `mapstructure:"default_tag" yaml:"default_tag"`
HomeDir string `mapstructure:"home_dir" yaml:"home_dir"`
}
Config represents the complete application configuration.
func New ¶
func New() *Config
New creates a Config with sensible default values. The returned config is always valid and ready to use. Default values can be overridden using Option functions via Update().
func (*Config) EnsureSoundPaths ¶
type Option ¶
type Option func(*Config)
Option is a function that modifies Config. This is the functional options pattern.
func OptBreakSoundAlertPath ¶
OptBreakSoundAlertPath sets the audio file path for break completion alerts. Path may contain tilde for home directory.
func OptClockColor ¶
OptClockColor sets the timer clock color. Accepts terminal color codes (0-255) or hex colors (e.g., "#ac8", "#eab920"). Invalid colors are logged and ignored.
func OptDefaultTag ¶ added in v0.3.2
OptDefaultTag sets the default tag.
func OptHomeDir ¶
OptHomeDir sets the home directory for config and log locations. Set once at startup from os.UserHomeDir(). Runtime-only field - not in ToOptions().
func OptLongBreakDuration ¶
OptLongBreakDuration sets the long break duration in minutes (after every 4th tomato). Must be positive; invalid values are logged and ignored.
func OptNoNotification ¶
OptNoNotification disables desktop notifications when true.
func OptNoShortcutsNotification ¶ added in v0.3.3
OptNoShortcutsNotification disables the startup shortcuts notification when true. Other notifications still work.
func OptNoSoundAlert ¶
OptNoSoundAlert disables sound alerts when true.
func OptShortBreakDuration ¶
OptShortBreakDuration sets the short break duration in minutes. Must be positive; invalid values are logged and ignored.
func OptWorkDuration ¶
OptWorkDuration sets the work session duration in minutes. Must be positive; invalid values are logged and ignored.
func OptWorkSoundAlertPath ¶
OptWorkSoundAlertPath sets the audio file path for work session completion alerts. Path may contain tilde for home directory.
type Tag ¶ added in v0.3.2
type Tag struct {
Desc string `mapstructure:"desc" yaml:"desc"`
Emoji string `mapstructure:"emoji" yaml:"emoji"`
Triggers TagTriggers `mapstructure:"triggers" yaml:"triggers,omitempty"`
}
Tag represents a single tag configuration. Tags categorize tomatoes (e.g., "work", "home").
type TagTriggers ¶ added in v0.3.3
type TagTriggers struct {
IPs []string `mapstructure:"ips" yaml:"ips,omitempty"`
Times []string `mapstructure:"times" yaml:"times,omitempty"`
Hosts []string `mapstructure:"hosts" yaml:"hosts,omitempty"`
}
TagTriggers defines conditions for automatic tag selection based on environment (hostname, IP address, time of day). All arrays use OR logic - any matching trigger activates the tag.