config

package
v0.0.0-...-854a73e Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PgpErrorLevelNone = iota
	PgpErrorLevelWarn
	PgpErrorLevelError
)
View Source
const (
	BINDING_FOUND = iota
	BINDING_INCOMPLETE
	BINDING_NOT_FOUND
)
View Source
const (
	DIALOG_MIN_PROPORTION = 10
	DIALOG_MAX_PROPORTION = 100
)
View Source
const MANUAL_COMPLETE = math.MaxInt

Variables

View Source
var (
	EnablePinentry  func()
	DisablePinentry func()
	SetPinentryEnv  func(*exec.Cmd)
)
View Source
var Accounts []*AccountConfig
View Source
var Binds = defaultBindsConfig()
View Source
var Compose = new(ComposeConfig)
View Source
var Converters = make(map[string]string)
View Source
var Filters []*FilterConfig
View Source
var General = new(GeneralConfig)
View Source
var Openers []Opener
View Source
var SearchDirs = buildDefaultDirs()
View Source
var Statusline = new(StatuslineConfig)
View Source
var StyleNames = map[string]StyleObject{
	"default": STYLE_DEFAULT,
	"error":   STYLE_ERROR,
	"warning": STYLE_WARNING,
	"success": STYLE_SUCCESS,

	"title":  STYLE_TITLE,
	"header": STYLE_HEADER,

	"statusline_default": STYLE_STATUSLINE_DEFAULT,
	"statusline_error":   STYLE_STATUSLINE_ERROR,
	"statusline_warning": STYLE_STATUSLINE_WARNING,
	"statusline_success": STYLE_STATUSLINE_SUCCESS,

	"msglist_default":   STYLE_MSGLIST_DEFAULT,
	"msglist_unread":    STYLE_MSGLIST_UNREAD,
	"msglist_read":      STYLE_MSGLIST_READ,
	"msglist_flagged":   STYLE_MSGLIST_FLAGGED,
	"msglist_deleted":   STYLE_MSGLIST_DELETED,
	"msglist_marked":    STYLE_MSGLIST_MARKED,
	"msglist_result":    STYLE_MSGLIST_RESULT,
	"msglist_answered":  STYLE_MSGLIST_ANSWERED,
	"msglist_forwarded": STYLE_MSGLIST_FORWARDED,
	"msglist_gutter":    STYLE_MSGLIST_GUTTER,
	"msglist_pill":      STYLE_MSGLIST_PILL,

	"msglist_thread_folded":  STYLE_MSGLIST_THREAD_FOLDED,
	"msglist_thread_context": STYLE_MSGLIST_THREAD_CONTEXT,
	"msglist_thread_orphan":  STYLE_MSGLIST_THREAD_ORPHAN,

	"dirlist_default": STYLE_DIRLIST_DEFAULT,
	"dirlist_unread":  STYLE_DIRLIST_UNREAD,
	"dirlist_recent":  STYLE_DIRLIST_RECENT,

	"part_switcher": STYLE_PART_SWITCHER,
	"part_filename": STYLE_PART_FILENAME,
	"part_mimetype": STYLE_PART_MIMETYPE,

	"completion_default":     STYLE_COMPLETION_DEFAULT,
	"completion_description": STYLE_COMPLETION_DESCRIPTION,
	"completion_gutter":      STYLE_COMPLETION_GUTTER,
	"completion_pill":        STYLE_COMPLETION_PILL,

	"tab":     STYLE_TAB,
	"stack":   STYLE_STACK,
	"spinner": STYLE_SPINNER,
	"border":  STYLE_BORDER,

	"selector_default": STYLE_SELECTOR_DEFAULT,
	"selector_focused": STYLE_SELECTOR_FOCUSED,
	"selector_chooser": STYLE_SELECTOR_CHOOSER,
}
View Source
var Templates = new(TemplateConfig)
View Source
var Ui = defaultUIConfig()
View Source
var Viewer = new(ViewerConfig)
View Source
var Warnings []Warning

Functions

func EditorCmds

func EditorCmds() []string

func FormatKeyStrokes

func FormatKeyStrokes(keystrokes []KeyStroke) string

func LoadBinds

func LoadBinds(binds *ini.File, baseName string, baseGroup **KeyBindings) error

func LoadConfigFromFile

func LoadConfigFromFile(
	root *string, accts []string, filename, bindPath, acctPath string,
) error

func MapToStruct

func MapToStruct(s *ini.Section, v interface{}, useDefaults bool) error

func PagerCmds

func PagerCmds() []string

func ReloadAccounts

func ReloadAccounts() error

func ReloadBinds

func ReloadBinds() (string, error)

func ReloadConf

func ReloadConf() (string, error)

func SetBindsFilename

func SetBindsFilename(fn string)

func SetConfFilename

func SetConfFilename(fn string)

Types

type AccountConfig

type AccountConfig struct {
	Name    string
	Backend string
	// backend specific
	Params map[string]string

	Archive           string          `ini:"archive" default:"Archive"`
	CopyTo            string          `ini:"copy-to"`
	CopyToReplied     bool            `ini:"copy-to-replied" default:"false"`
	StripBcc          bool            `ini:"strip-bcc" default:"true"`
	Default           string          `ini:"default" default:"INBOX"`
	Postpone          string          `ini:"postpone" default:"Drafts"`
	From              *mail.Address   `ini:"from"`
	UseEnvelopeFrom   bool            `ini:"use-envelope-from" default:"false"`
	Aliases           []*mail.Address `ini:"aliases"`
	Source            string          `ini:"source" parse:"ParseSource"`
	Folders           []string        `ini:"folders" delim:","`
	FoldersExclude    []string        `ini:"folders-exclude" delim:","`
	Headers           []string        `ini:"headers" delim:","`
	HeadersExclude    []string        `ini:"headers-exclude" delim:","`
	Outgoing          RemoteConfig    `ini:"outgoing" parse:"ParseOutgoing"`
	SignatureFile     string          `ini:"signature-file"`
	SignatureCmd      string          `ini:"signature-cmd"`
	EnableFoldersSort bool            `ini:"enable-folders-sort" default:"true"`
	FoldersSort       []string        `ini:"folders-sort" delim:","`
	AddressBookCmd    string          `ini:"address-book-cmd"`
	SendAsUTC         bool            `ini:"send-as-utc" default:"false"`
	SendWithHostname  bool            `ini:"send-with-hostname" default:"false"`
	LocalizedRe       *regexp.Regexp  `ini:"subject-re-pattern" default:"(?i)^((AW|RE|SV|VS|ODP|R): ?)+"`

	// CheckMail
	CheckMail        time.Duration `ini:"check-mail"`
	CheckMailCmd     string        `ini:"check-mail-cmd"`
	CheckMailTimeout time.Duration `ini:"check-mail-timeout" default:"10s"`
	CheckMailInclude []string      `ini:"check-mail-include"`
	CheckMailExclude []string      `ini:"check-mail-exclude"`

	// PGP Config
	PgpKeyId                string `ini:"pgp-key-id"`
	PgpAutoSign             bool   `ini:"pgp-auto-sign"`
	PgpAttachKey            bool   `ini:"pgp-attach-key"`
	PgpOpportunisticEncrypt bool   `ini:"pgp-opportunistic-encrypt"`
	PgpErrorLevel           int    `ini:"pgp-error-level" parse:"ParsePgpErrorLevel" default:"warn"`
	PgpSelfEncrypt          bool   `ini:"pgp-self-encrypt"`

	// AuthRes
	TrustedAuthRes []string `ini:"trusted-authres" delim:","`
}

func ParseAccountConfig

func ParseAccountConfig(name string, section *ini.Section) (*AccountConfig, error)

func (*AccountConfig) ParseOutgoing

func (a *AccountConfig) ParseOutgoing(sec *ini.Section, key *ini.Key) (RemoteConfig, error)

func (*AccountConfig) ParsePgpErrorLevel

func (a *AccountConfig) ParsePgpErrorLevel(sec *ini.Section, key *ini.Key) (int, error)

func (*AccountConfig) ParseSource

func (a *AccountConfig) ParseSource(sec *ini.Section, key *ini.Key) (string, error)

type Binding

type Binding struct {
	Output []KeyStroke
	Input  []KeyStroke

	Annotation string
}

func ParseBinding

func ParseBinding(input, output, annotation string) (*Binding, error)

type BindingConfig

type BindingConfig struct {
	Global                 *KeyBindings
	AccountWizard          *KeyBindings
	Compose                *KeyBindings
	ComposeEditor          *KeyBindings
	ComposeReview          *KeyBindings
	MessageList            *KeyBindings
	MessageView            *KeyBindings
	MessageViewPassthrough *KeyBindings
	Terminal               *KeyBindings
}

type BindingConfigContext

type BindingConfigContext struct {
	ContextType bindsContextType
	Regex       *regexp.Regexp
	Bindings    *KeyBindings
}

type BindingSearchResult

type BindingSearchResult int

type ColumnDef

type ColumnDef struct {
	Name     string
	Flags    ColumnFlags
	Width    float64
	Template *template.Template
}

func ParseColumnDefs

func ParseColumnDefs(key *ini.Key, section *ini.Section) ([]*ColumnDef, error)

type ColumnFlags

type ColumnFlags uint32
const (
	ALIGN_LEFT ColumnFlags = 1 << iota
	ALIGN_CENTER
	ALIGN_RIGHT
	WIDTH_AUTO     // whatever is left
	WIDTH_FRACTION // ratio of total width
	WIDTH_EXACT    // exact number of characters
	WIDTH_FIT      // fit to column content width
)

func (ColumnFlags) Has

func (f ColumnFlags) Has(o ColumnFlags) bool

type ComposeConfig

type ComposeConfig struct {
	Editor              string         `ini:"editor"`
	HeaderLayout        [][]string     `ini:"header-layout" parse:"ParseLayout" default:"To|From,Subject"`
	AddressBookCmd      string         `ini:"address-book-cmd"`
	ReplyToSelf         bool           `ini:"reply-to-self" default:"true"`
	NoAttachmentWarning *regexp.Regexp `ini:"no-attachment-warning" parse:"ParseNoAttachmentWarning"`
	EmptySubjectWarning bool           `ini:"empty-subject-warning"`
	FilePickerCmd       string         `ini:"file-picker-cmd"`
	FormatFlowed        bool           `ini:"format-flowed"`
	EditHeaders         bool           `ini:"edit-headers"`
	FocusBody           bool           `ini:"focus-body"`
	LFEditor            bool           `ini:"lf-editor"`
}

func (*ComposeConfig) ParseLayout

func (c *ComposeConfig) ParseLayout(sec *ini.Section, key *ini.Key) ([][]string, error)

func (*ComposeConfig) ParseNoAttachmentWarning

func (c *ComposeConfig) ParseNoAttachmentWarning(sec *ini.Section, key *ini.Key) (*regexp.Regexp, error)

type FilterConfig

type FilterConfig struct {
	Type       FilterType
	Filter     string
	Command    string
	NeedsPager bool
	Header     string
	Regex      *regexp.Regexp
}

type FilterType

type FilterType int
const (
	FILTER_MIMETYPE FilterType = iota
	FILTER_HEADER
	FILTER_HEADERS
	FILTER_FILENAME
)

type GeneralConfig

type GeneralConfig struct {
	DefaultSavePath    string       `ini:"default-save-path"`
	PgpProvider        string       `ini:"pgp-provider" default:"auto" parse:"ParsePgpProvider"`
	UnsafeAccountsConf bool         `ini:"unsafe-accounts-conf"`
	LogFile            string       `ini:"log-file"`
	LogLevel           log.LogLevel `ini:"log-level" default:"info" parse:"ParseLogLevel"`
	DisableIPC         bool         `ini:"disable-ipc"`
	DisableIPCMailto   bool         `ini:"disable-ipc-mailto"`
	DisableIPCMbox     bool         `ini:"disable-ipc-mbox"`
	EnableOSC8         bool         `ini:"enable-osc8" default:"false"`
	Term               string       `ini:"term" default:"xterm-256color"`
	DefaultMenuCmd     string       `ini:"default-menu-cmd"`
	QuakeMode          bool         `ini:"enable-quake-mode" default:"false"`
	UsePinentry        bool         `ini:"use-terminal-pinentry" default:"false"`
}

func (*GeneralConfig) ParseLogLevel

func (gen *GeneralConfig) ParseLogLevel(sec *ini.Section, key *ini.Key) (log.LogLevel, error)

func (*GeneralConfig) ParsePgpProvider

func (gen *GeneralConfig) ParsePgpProvider(sec *ini.Section, key *ini.Key) (string, error)

type HooksConfig

type HooksConfig struct {
	AercStartup  string `ini:"aerc-startup"`
	AercShutdown string `ini:"aerc-shutdown"`
	FlagChanged  string `ini:"flag-changed"`
	MailReceived string `ini:"mail-received"`
	MailDeleted  string `ini:"mail-deleted"`
	MailAdded    string `ini:"mail-added"`
	MailSent     string `ini:"mail-sent"`
	TagModified  string `ini:"tag-modified"`
}
var Hooks HooksConfig

type KeyBindings

type KeyBindings struct {
	Bindings []*Binding
	// If false, disable global keybindings in this context
	Globals bool
	// Which key opens the ex line (default is :)
	ExKey KeyStroke
	// Which key triggers completion (default is <tab>)
	CompleteKey KeyStroke
	// contains filtered or unexported fields
}

func LoadBindingSection

func LoadBindingSection(sec *ini.Section) (*KeyBindings, error)

func MergeBindings

func MergeBindings(bindings ...*KeyBindings) *KeyBindings

func NewKeyBindings

func NewKeyBindings() *KeyBindings

func (*KeyBindings) Add

func (bindings *KeyBindings) Add(binding *Binding)

func (*KeyBindings) ForAccount

func (bindings *KeyBindings) ForAccount(account string) *KeyBindings

func (*KeyBindings) ForFolder

func (bindings *KeyBindings) ForFolder(folder string) *KeyBindings

func (*KeyBindings) GetBinding

func (bindings *KeyBindings) GetBinding(
	input []KeyStroke,
) (BindingSearchResult, []KeyStroke)

func (*KeyBindings) GetReverseBindings

func (bindings *KeyBindings) GetReverseBindings(output []KeyStroke) [][]KeyStroke

type KeyStroke

type KeyStroke struct {
	Modifiers vaxis.ModifierMask
	Key       rune
}

func ParseKeyStrokes

func ParseKeyStrokes(keystrokes string) ([]KeyStroke, error)

type Opener

type Opener struct {
	Mime string
	Args string
}

type RemoteConfig

type RemoteConfig struct {
	Value       string
	PasswordCmd string
	CacheCmd    bool
	// contains filtered or unexported fields
}

func (*RemoteConfig) ConnectionString

func (c *RemoteConfig) ConnectionString() (string, error)

type SplitDirection

type SplitDirection int
const (
	SPLIT_NONE SplitDirection = iota
	SPLIT_HORIZONTAL
	SPLIT_VERTICAL
)

type SplitParams

type SplitParams struct {
	Direction SplitDirection
	Size      int
}

type StatuslineConfig

type StatuslineConfig struct {
	StatusColumns   []*ColumnDef `ini:"status-columns" parse:"ParseColumns" default:"left<*,center>=,right>*"`
	ColumnSeparator string       `ini:"column-separator" default:" "`
	Separator       string       `ini:"separator" default:" | "`
	DisplayMode     string       `ini:"display-mode" default:"text"`
}

func (*StatuslineConfig) ParseColumns

func (s *StatuslineConfig) ParseColumns(sec *ini.Section, key *ini.Key) ([]*ColumnDef, error)

type Style

type Style struct {
	Fg        vaxis.Color
	Bg        vaxis.Color
	Bold      bool
	Blink     bool
	Underline bool
	Reverse   bool
	Italic    bool
	Dim       bool
	// contains filtered or unexported fields
}

func (*Style) Default

func (s *Style) Default() *Style

func (Style) Get

func (s Style) Get() vaxis.Style

func (*Style) Normal

func (s *Style) Normal()

func (*Style) Reset

func (s *Style) Reset() *Style

func (*Style) Set

func (s *Style) Set(attr, val string) error

type StyleConf

type StyleConf struct {
	// contains filtered or unexported fields
}

type StyleHeaderPattern

type StyleHeaderPattern struct {
	RawPattern string
	Re         *regexp.Regexp
}

type StyleObject

type StyleObject int32
const (
	STYLE_DEFAULT StyleObject = iota
	STYLE_ERROR
	STYLE_WARNING
	STYLE_SUCCESS

	STYLE_TITLE
	STYLE_HEADER

	STYLE_STATUSLINE_DEFAULT
	STYLE_STATUSLINE_ERROR
	STYLE_STATUSLINE_WARNING
	STYLE_STATUSLINE_SUCCESS

	STYLE_MSGLIST_DEFAULT
	STYLE_MSGLIST_UNREAD
	STYLE_MSGLIST_READ
	STYLE_MSGLIST_FLAGGED
	STYLE_MSGLIST_DELETED
	STYLE_MSGLIST_MARKED
	STYLE_MSGLIST_RESULT
	STYLE_MSGLIST_ANSWERED
	STYLE_MSGLIST_FORWARDED
	STYLE_MSGLIST_THREAD_FOLDED
	STYLE_MSGLIST_GUTTER
	STYLE_MSGLIST_PILL
	STYLE_MSGLIST_THREAD_CONTEXT
	STYLE_MSGLIST_THREAD_ORPHAN

	STYLE_DIRLIST_DEFAULT
	STYLE_DIRLIST_UNREAD
	STYLE_DIRLIST_RECENT

	STYLE_PART_SWITCHER
	STYLE_PART_FILENAME
	STYLE_PART_MIMETYPE

	STYLE_COMPLETION_DEFAULT
	STYLE_COMPLETION_DESCRIPTION
	STYLE_COMPLETION_GUTTER
	STYLE_COMPLETION_PILL

	STYLE_TAB
	STYLE_STACK
	STYLE_SPINNER
	STYLE_BORDER

	STYLE_SELECTOR_DEFAULT
	STYLE_SELECTOR_FOCUSED
	STYLE_SELECTOR_CHOOSER
)

type StyleSet

type StyleSet struct {
	// contains filtered or unexported fields
}

func NewStyleSet

func NewStyleSet() StyleSet

func (StyleSet) Compose

func (ss StyleSet) Compose(
	so StyleObject, sos []StyleObject, h *mail.Header,
) vaxis.Style

func (StyleSet) ComposeSelected

func (ss StyleSet) ComposeSelected(
	so StyleObject, sos []StyleObject, h *mail.Header,
) vaxis.Style

func (StyleSet) Get

func (ss StyleSet) Get(so StyleObject, h *mail.Header) vaxis.Style

func (*StyleSet) LoadStyleSet

func (ss *StyleSet) LoadStyleSet(stylesetName string, stylesetDirs []string) error

func (*StyleSet) ParseStyleSet

func (ss *StyleSet) ParseStyleSet(file *ini.File) error

func (StyleSet) Selected

func (ss StyleSet) Selected(so StyleObject, h *mail.Header) vaxis.Style

func (StyleSet) UserStyle

func (ss StyleSet) UserStyle(name string) vaxis.Style

type TemplateConfig

type TemplateConfig struct {
	TemplateDirs []string `ini:"template-dirs" delim:":"`
	NewMessage   string   `ini:"new-message" default:"new_message"`
	QuotedReply  string   `ini:"quoted-reply" default:"quoted_reply"`
	Forwards     string   `ini:"forwards" default:"forward_as_body"`
}

type UIConfig

type UIConfig struct {
	IndexColumns    []*ColumnDef `ini:"index-columns" parse:"ParseIndexColumns" default:"flags:4,name<20%,subject,date>="`
	ColumnSeparator string       `ini:"column-separator" default:"  "`

	DirListLeft  *template.Template `ini:"dirlist-left" default:"{{.Folder}}"`
	DirListRight *template.Template `ini:"dirlist-right" default:"{{if .Unread}}{{humanReadable .Unread}}{{end}}"`

	AutoMarkRead                  bool          `ini:"auto-mark-read" default:"true"`
	TimestampFormat               string        `ini:"timestamp-format" default:"2006 Jan 02"`
	ThisDayTimeFormat             string        `ini:"this-day-time-format" default:"15:04"`
	ThisWeekTimeFormat            string        `ini:"this-week-time-format" default:"Jan 02"`
	ThisYearTimeFormat            string        `ini:"this-year-time-format" default:"Jan 02"`
	MessageViewTimestampFormat    string        `ini:"message-view-timestamp-format" default:"2006 Jan 02, 15:04 GMT-0700"`
	MessageViewThisDayTimeFormat  string        `ini:"message-view-this-day-time-format"`
	MessageViewThisWeekTimeFormat string        `ini:"message-view-this-week-time-format"`
	MessageViewThisYearTimeFormat string        `ini:"message-view-this-year-time-format"`
	PinnedTabMarker               string        "ini:\"pinned-tab-marker\" default:\"`\""
	SidebarWidth                  int           `ini:"sidebar-width" default:"22"`
	QuakeHeight                   int           `ini:"quake-terminal-height" default:"20"`
	MessageListSplit              SplitParams   `ini:"message-list-split" parse:"ParseSplit"`
	EmptyMessage                  string        `ini:"empty-message" default:"(no messages)"`
	EmptyDirlist                  string        `ini:"empty-dirlist" default:"(no folders)"`
	EmptySubject                  string        `ini:"empty-subject" default:"(no subject)"`
	MouseEnabled                  bool          `ini:"mouse-enabled"`
	ThreadingEnabled              bool          `ini:"threading-enabled"`
	ForceClientThreads            bool          `ini:"force-client-threads"`
	ThreadingBySubject            bool          `ini:"threading-by-subject"`
	ClientThreadsDelay            time.Duration `ini:"client-threads-delay" default:"50ms"`
	ThreadContext                 bool          `ini:"show-thread-context"`
	FuzzyComplete                 bool          `ini:"fuzzy-complete"`
	NewMessageBell                bool          `ini:"new-message-bell" default:"true"`
	Spinner                       string        `ini:"spinner" default:"[..]    , [..]   ,  [..]  ,   [..] ,    [..],   [..] ,  [..]  , [..]   "`
	SpinnerDelimiter              string        `ini:"spinner-delimiter" default:","`
	SpinnerInterval               time.Duration `ini:"spinner-interval" default:"200ms"`
	IconUnencrypted               string        `ini:"icon-unencrypted"`
	IconEncrypted                 string        `ini:"icon-encrypted" default:"[e]"`
	IconSigned                    string        `ini:"icon-signed" default:"[s]"`
	IconSignedEncrypted           string        `ini:"icon-signed-encrypted"`
	IconUnknown                   string        `ini:"icon-unknown" default:"[s?]"`
	IconInvalid                   string        `ini:"icon-invalid" default:"[s!]"`
	IconAttachment                string        `ini:"icon-attachment" default:"a"`
	IconReplied                   string        `ini:"icon-replied" default:"r"`
	IconForwarded                 string        `ini:"icon-forwarded" default:"f"`
	IconNew                       string        `ini:"icon-new" default:"N"`
	IconOld                       string        `ini:"icon-old" default:"O"`
	IconDraft                     string        `ini:"icon-draft" default:"d"`
	IconFlagged                   string        `ini:"icon-flagged" default:"!"`
	IconMarked                    string        `ini:"icon-marked" default:"*"`
	IconDeleted                   string        `ini:"icon-deleted" default:"X"`
	DirListDelay                  time.Duration `ini:"dirlist-delay" default:"200ms"`
	DirListTree                   bool          `ini:"dirlist-tree"`
	DirListCollapse               int           `ini:"dirlist-collapse"`
	Sort                          []string      `ini:"sort" delim:" "`
	NextMessageOnDelete           bool          `ini:"next-message-on-delete" default:"true"`
	CompletionDelay               time.Duration `ini:"completion-delay" default:"250ms"`
	CompletionMinChars            int           `ini:"completion-min-chars" default:"1" parse:"ParseCompletionMinChars"`
	CompletionPopovers            bool          `ini:"completion-popovers" default:"true"`
	MsglistScrollOffset           int           `ini:"msglist-scroll-offset" default:"0"`
	DialogPosition                string        `ini:"dialog-position" default:"center" parse:"ParseDialogPosition"`
	DialogWidth                   int           `ini:"dialog-width" default:"50" parse:"ParseDialogDimensions"`
	DialogHeight                  int           `ini:"dialog-height" default:"50" parse:"ParseDialogDimensions"`
	StyleSetDirs                  []string      `ini:"stylesets-dirs" delim:":"`
	StyleSetName                  string        `ini:"styleset-name" default:"default"`

	// customize border appearance
	BorderCharVertical   rune `ini:"border-char-vertical" default:"│" type:"rune"`
	BorderCharHorizontal rune `ini:"border-char-horizontal" default:"─" type:"rune"`

	SelectLast         bool `ini:"select-last-message" default:"false"`
	ReverseOrder       bool `ini:"reverse-msglist-order"`
	ReverseThreadOrder bool `ini:"reverse-thread-order"`
	SortThreadSiblings bool `ini:"sort-thread-siblings"`

	ThreadPrefixTip                string `ini:"thread-prefix-tip" default:">"`
	ThreadPrefixIndent             string `ini:"thread-prefix-indent" default:" "`
	ThreadPrefixStem               string `ini:"thread-prefix-stem" default:"│"`
	ThreadPrefixLimb               string `ini:"thread-prefix-limb" default:""`
	ThreadPrefixFolded             string `ini:"thread-prefix-folded" default:"+"`
	ThreadPrefixUnfolded           string `ini:"thread-prefix-unfolded" default:""`
	ThreadPrefixFirstChild         string `ini:"thread-prefix-first-child" default:""`
	ThreadPrefixHasSiblings        string `ini:"thread-prefix-has-siblings" default:"├─"`
	ThreadPrefixLone               string `ini:"thread-prefix-lone" default:""`
	ThreadPrefixOrphan             string `ini:"thread-prefix-orphan" default:""`
	ThreadPrefixLastSibling        string `ini:"thread-prefix-last-sibling" default:"└─"`
	ThreadPrefixDummy              string `ini:"thread-prefix-dummy" default:"┬─"`
	ThreadPrefixLastSiblingReverse string `ini:"thread-prefix-last-sibling-reverse" default:"┌─"`
	ThreadPrefixFirstChildReverse  string `ini:"thread-prefix-first-child-reverse" default:""`
	ThreadPrefixOrphanReverse      string `ini:"thread-prefix-orphan-reverse" default:""`
	ThreadPrefixDummyReverse       string `ini:"thread-prefix-dummy-reverse" default:"┴─"`

	// Tab Templates
	TabTitleAccount  *template.Template `ini:"tab-title-account" default:"{{.Account}}"`
	TabTitleComposer *template.Template `ini:"tab-title-composer" default:"{{if .To}}to:{{index (.To | shortmboxes) 0}} {{end}}{{.SubjectBase}}"`
	TabTitleViewer   *template.Template `ini:"tab-title-viewer" default:"{{.Subject}}"`
	// contains filtered or unexported fields
}

func (*UIConfig) ClearCache

func (ui *UIConfig) ClearCache()

func (*UIConfig) ForAccount

func (base *UIConfig) ForAccount(account string) *UIConfig

func (*UIConfig) ForFolder

func (base *UIConfig) ForFolder(folder string) *UIConfig

func (*UIConfig) GetComposedStyle

func (uiConfig *UIConfig) GetComposedStyle(base StyleObject,
	styles []StyleObject,
) vaxis.Style

func (*UIConfig) GetComposedStyleSelected

func (uiConfig *UIConfig) GetComposedStyleSelected(
	base StyleObject, styles []StyleObject,
) vaxis.Style

func (*UIConfig) GetStyle

func (uiConfig *UIConfig) GetStyle(so StyleObject) vaxis.Style

func (*UIConfig) GetStyleSelected

func (uiConfig *UIConfig) GetStyleSelected(so StyleObject) vaxis.Style

func (*UIConfig) GetUserStyle

func (uiConfig *UIConfig) GetUserStyle(name string) vaxis.Style

func (*UIConfig) LoadStyle

func (ui *UIConfig) LoadStyle() error

func (*UIConfig) MsgComposedStyle

func (uiConfig *UIConfig) MsgComposedStyle(
	base StyleObject, styles []StyleObject, h *mail.Header,
) vaxis.Style

func (*UIConfig) MsgComposedStyleSelected

func (uiConfig *UIConfig) MsgComposedStyleSelected(
	base StyleObject, styles []StyleObject, h *mail.Header,
) vaxis.Style

func (*UIConfig) ParseCompletionMinChars

func (*UIConfig) ParseCompletionMinChars(section *ini.Section, key *ini.Key) (int, error)

func (*UIConfig) ParseDialogDimensions

func (*UIConfig) ParseDialogDimensions(section *ini.Section, key *ini.Key) (int, error)

func (*UIConfig) ParseDialogPosition

func (*UIConfig) ParseDialogPosition(section *ini.Section, key *ini.Key) (string, error)

func (*UIConfig) ParseIndexColumns

func (*UIConfig) ParseIndexColumns(section *ini.Section, key *ini.Key) ([]*ColumnDef, error)

func (*UIConfig) ParseSplit

func (*UIConfig) ParseSplit(section *ini.Section, key *ini.Key) (p SplitParams, err error)

func (*UIConfig) StyleSetPath

func (uiConfig *UIConfig) StyleSetPath() string

type UiConfigContext

type UiConfigContext struct {
	ContextType uiContextType
	Regex       *regexp.Regexp
	UiConfig    *UIConfig
	Section     ini.Section
}

type ViewerConfig

type ViewerConfig struct {
	Pager          string     `ini:"pager" default:"less -Rc"`
	Alternatives   []string   `ini:"alternatives" default:"text/plain,text/html" delim:","`
	ShowHeaders    bool       `ini:"show-headers"`
	AlwaysShowMime bool       `ini:"always-show-mime"`
	MaxMimeHeight  int        `ini:"max-mime-height" default:"0"`
	ParseHttpLinks bool       `ini:"parse-http-links" default:"true"`
	HeaderLayout   [][]string `ini:"header-layout" parse:"ParseLayout" default:"From|To,Cc|Bcc,Date,Subject"`
	KeyPassthrough bool
}

func (*ViewerConfig) ParseLayout

func (v *ViewerConfig) ParseLayout(sec *ini.Section, key *ini.Key) ([][]string, error)

type Warning

type Warning struct {
	Title string
	Body  string
}

warning message related to configuration (deprecation, etc.)

Jump to

Keyboard shortcuts

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