Documentation
¶
Index ¶
- Constants
- Variables
- func AmbientSoundPath() string
- func ConfigFilePath() string
- func DBFilePath() string
- func Dir() string
- func SoundOpts() []string
- func StatusFilePath() string
- type CLIConfig
- type CLIOptions
- type Config
- type DisplayConfig
- type FilterConfig
- type NotificationConfig
- type Option
- type PromptOptions
- type SessionConfig
- type SessionType
- type SettingsConfig
- type Style
Constants ¶
const Version = "v1.4.2"
Variables ¶
var ( ColorMain = lipgloss.AdaptiveColor{Light: "234", Dark: "15"} ColorSecondary = lipgloss.AdaptiveColor{Light: "234", Dark: "7"} ColorWork = lipgloss.AdaptiveColor{Light: "2", Dark: "10"} ColorShortBreak = lipgloss.AdaptiveColor{Light: "4", Dark: "12"} ColorLongBreak = lipgloss.AdaptiveColor{Light: "1", Dark: "9"} ColorHint = lipgloss.AdaptiveColor{Light: "245", Dark: "240"} )
Functions ¶
func AmbientSoundPath ¶
func AmbientSoundPath() string
func ConfigFilePath ¶
func ConfigFilePath() string
func DBFilePath ¶
func DBFilePath() string
func StatusFilePath ¶
func StatusFilePath() string
Types ¶
type CLIOptions ¶
type CLIOptions struct {
Since string
ShortBreak string
LongBreak string
Tags string
AmbientSound string
BreakSound string
WorkSound string
SessionCmd string
Work string
LongBreakInterval uint
DisableNotify bool
SoundOnBreak bool
Strict bool
}
CLIOptions represents command-line configuration options.
type Config ¶
type Config struct {
Style Style
CLI CLIConfig
Work SessionConfig `mapstructure:"work"`
ShortBreak SessionConfig `mapstructure:"short_break"`
LongBreak SessionConfig `mapstructure:"long_break"`
Settings SettingsConfig `mapstructure:"settings"`
Display DisplayConfig `mapstructue:"display"`
Notifications NotificationConfig
// contains filtered or unexported fields
}
Config holds all configuration settings.
type DisplayConfig ¶
type DisplayConfig struct {
DarkTheme bool `mapstructure:"dark_theme"`
}
DisplayConfig holds display-related settings.
type FilterConfig ¶
FilterConfig represents a configuration to filter sessions in the database by their start time, end time, and assigned tags.
func Filter ¶
func Filter(ctx *cli.Context) *FilterConfig
Filter initializes and returns a configuration to filter sessions from command-line arguments.
type NotificationConfig ¶
type NotificationConfig struct {
Enabled bool `mapstructure:"enabled"`
}
NotificationConfig holds notification settings.
type Option ¶
Option is a function that modifies Config.
func WithCLIConfig ¶
WithCLIConfig returns an Option that loads configuration from CLI flags.
func WithPromptConfig ¶
WithPromptConfig returns an Option that configures settings via interactive prompts.
func WithViperConfig ¶
WithViperConfig returns an Option that loads configuration from Viper.
type PromptOptions ¶
type PromptOptions struct {
WorkDuration int
ShortBreakDuration int
LongBreakDuration int
LongBreakInterval int
}
PromptOptions holds the user's responses to the configuration prompts.
type SessionConfig ¶
type SessionType ¶
type SessionType string
SessionType represents the type of timer session.
const ( Work SessionType = "Work session" ShortBreak SessionType = "Short break" LongBreak SessionType = "Long break" )
type SettingsConfig ¶
type SettingsConfig struct {
AmbientSound string `mapstructure:"ambient_sound"`
Cmd string `mapstructure:"cmd"`
LongBreakInterval int `mapstructure:"long_break_interval"`
AutoStartBreak bool `mapstructure:"auto_start_break"`
AutoStartWork bool `mapstructure:"auto_start_work"`
SoundOnBreak bool `mapstructure:"sound_on_break"`
Strict bool `mapstructure:"strict"`
TwentyFourHour bool `mapstructure:"24hr_clock"`
}
SettingsConfig contains general application settings.