Documentation
¶
Index ¶
- Constants
- Variables
- func OptionsToIdx(options []string, t string, def int) int
- type Config
- func (c *Config) GetException(id int) (*Exception, bool)
- func (c *Config) GetMaxImageSize() fyne.Size
- func (c *Config) GetNudge(id int) (*Nudge, bool)
- func (c *Config) NotificationRollDur() time.Duration
- func (c *Config) Read()
- func (c *Config) ReadExceptions()
- func (c *Config) ReadGeneral()
- func (c *Config) ReadNudges()
- func (c *Config) Write()
- func (c *Config) WriteExceptions()
- func (c *Config) WriteGeneral()
- func (c *Config) WriteNudges()
- type Exception
- type ExceptionHow
- type ExceptionType
- type Nudge
- type NudgeType
Constants ¶
View Source
const ( REMINDER_NOTIFICATION = "nudge.reminder" REMINDER_BEEP = "nudge.reminder.beep" REMINDER_ADVANCE = "nudge.reminder.advance" NUDGE_WINDOW_SHOW = "nudge.window.show" NUDGE_WINDOW_FULLSCREEN = "nudge.window.fullscreen" NUDGE_WINDOW_ALL_SCREENS = "nudge.window.allscreens" AUTO_START = "app.autostart" HIDE_TO_SYSTRAY = "app.systray" ENABLE_LOGS = "app.logs.enable" MAX_IMAGE_WIDTH = "nudge.image.width" MAX_IMAGE_HEIGHT = "nudge.image.height" NUM_EXCEPTIONS = "except.num" FMT_EXCEPTION = "except.%d" NUM_NUDGES = "nudge.num" FMT_NUDGE = "nudge.%d" )
Variables ¶
View Source
var ( ExceptionOptions = []string{"Window Title", "OS Process", "User Idle", "Times (cron format)"} HowOptions = []string{"Pause all nudges", "Stop all nudges", "Ignore this exception"} NudgeOptions = []string{"Rest regularly", "Reminder (cron format)"} )
Functions ¶
Types ¶
type Config ¶
type Config struct { // General config AutoStart binding.Bool Systray binding.Bool EnableLogs binding.Bool // UI config ReminderNotification binding.Bool ReminderBeep binding.Bool BeepSound binding.String ShowWindow binding.Bool FullScreenWindow binding.Bool AllScreens binding.Bool ReminderAdvance binding.Float MaxImageWidth binding.Float MaxImageHeight binding.Float // Exceptions config Exceptions binding.UntypedList // Nudges config Nudges binding.UntypedList // Statistics Statistics binding.UntypedMap // contains filtered or unexported fields }
func (*Config) GetMaxImageSize ¶
func (c *Config) GetMaxImageSize() fyne.Size
func (*Config) NotificationRollDur ¶
func (*Config) ReadExceptions ¶
func (c *Config) ReadExceptions()
func (*Config) ReadGeneral ¶
func (c *Config) ReadGeneral()
func (*Config) ReadNudges ¶
func (c *Config) ReadNudges()
func (*Config) WriteExceptions ¶
func (c *Config) WriteExceptions()
func (*Config) WriteGeneral ¶
func (c *Config) WriteGeneral()
func (*Config) WriteNudges ¶
func (c *Config) WriteNudges()
type Exception ¶
type Exception struct { Name string `json:"name"` Active bool `json:"active"` ExactMatch bool `json:"exact_match"` Type ExceptionType `json:"type"` How ExceptionHow `json:"how"` }
type ExceptionHow ¶
type ExceptionHow int
const ( Run ExceptionHow = iota - 1 Pause Stop Ignore )
func HowToType ¶
func HowToType(t string) ExceptionHow
type ExceptionType ¶
type ExceptionType int
const ( WindowTitle ExceptionType = iota Process UserIdle Times )
func ExceptionToType ¶
func ExceptionToType(t string) ExceptionType
type Nudge ¶
type Nudge struct { Name string `json:"name"` Description string `json:"description"` Type NudgeType `json:"type"` Notification bool `json:"notification"` Window bool `json:"window"` Schedule string `json:"schedule"` Work float64 `json:"work_duration"` ShortRest float64 `json:"short_rest_duration"` LongRest float64 `json:"long_rest_duration"` WorkPeriods int `json:"periods_before_long_rest"` Runtime interface{} }
Click to show internal directories.
Click to hide internal directories.