config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

Types

type AlignmentWrapper

type AlignmentWrapper struct{ tview.Alignment }

func (*AlignmentWrapper) UnmarshalTOML

func (aw *AlignmentWrapper) UnmarshalTOML(v any) error

type BorderSetWrapper

type BorderSetWrapper struct{ tview.BorderSet }

func (*BorderSetWrapper) UnmarshalTOML

func (bw *BorderSetWrapper) UnmarshalTOML(val any) error

type BorderTheme

type BorderTheme struct {
	ThemeStyle
	Enabled bool   `toml:"enabled"`
	Padding [4]int `toml:"padding"`

	NormalSet BorderSetWrapper `toml:"normal_set"`
	ActiveSet BorderSetWrapper `toml:"active_set"`
}

type Config

type Config struct {
	Mouse  bool   `toml:"mouse"`
	Editor string `toml:"editor"`

	Status discord.Status `toml:"status"`

	Markdown            bool `toml:"markdown"`
	HideBlockedUsers    bool `toml:"hide_blocked_users"`
	ShowAttachmentLinks bool `toml:"show_attachment_links"`

	// Use 0 to disable
	AutocompleteLimit uint8 `toml:"autocomplete_limit"`
	MessagesLimit     uint8 `toml:"messages_limit"`

	Timestamps    Timestamps    `toml:"timestamps"`
	Notifications Notifications `toml:"notifications"`

	Keys  Keys  `toml:"keys"`
	Theme Theme `toml:"theme"`
}

func Load

func Load(path string) (*Config, error)

Load reads the configuration file and parses it.

type GuildsTreeKeys

type GuildsTreeKeys struct {
	NavigationKeys
	SelectCurrent string `toml:"select_current"`
	YankID        string `toml:"yank_id"`

	CollapseParentNode string `toml:"collapse_parent_node"`
	MoveToParentNode   string `toml:"move_to_parent_node"`
}

type GuildsTreeTheme

type GuildsTreeTheme struct {
	AutoExpandFolders bool   `toml:"auto_expand_folders"`
	Graphics          bool   `toml:"graphics"`
	GraphicsColor     string `toml:"graphics_color"`
}

type Keys

type Keys struct {
	FocusGuildsTree   string `toml:"focus_guilds_tree"`
	FocusMessagesList string `toml:"focus_messages_list"`
	FocusMessageInput string `toml:"focus_message_input"`
	FocusPrevious     string `toml:"focus_previous"`
	FocusNext         string `toml:"focus_next"`
	ToggleGuildsTree  string `toml:"toggle_guilds_tree"`

	GuildsTree   GuildsTreeKeys   `toml:"guilds_tree"`
	MessagesList MessagesListKeys `toml:"messages_list"`
	MessageInput MessageInputKeys `toml:"message_input"`
	MentionsList MentionsListKeys `toml:"mentions_list"`

	Logout string `toml:"logout"`
	Quit   string `toml:"quit"`
}

type MentionsListKeys

type MentionsListKeys struct {
	Up   string `toml:"up"`
	Down string `toml:"down"`
}

type MentionsListTheme

type MentionsListTheme struct {
	MinWidth  uint `toml:"min_width"`
	MaxHeight uint `toml:"max_height"`
}

type MessageInputKeys

type MessageInputKeys struct {
	Paste       string `toml:"paste"`
	Send        string `toml:"send"`
	Cancel      string `toml:"cancel"`
	TabComplete string `toml:"tab_complete"`

	OpenEditor     string `toml:"open_editor"`
	OpenFilePicker string `toml:"open_file_picker"`
}

type MessagesListKeys

type MessagesListKeys struct {
	NavigationKeys
	SelectReply  string `toml:"select_reply"`
	Reply        string `toml:"reply"`
	ReplyMention string `toml:"reply_mention"`

	Cancel        string `toml:"cancel"`
	Edit          string `toml:"edit"`
	Delete        string `toml:"delete"`
	DeleteConfirm string `toml:"delete_confirm"`
	Open          string `toml:"open"`

	YankContent string `toml:"yank_content"`
	YankURL     string `toml:"yank_url"`
	YankID      string `toml:"yank_id"`
}

type MessagesListTheme

type MessagesListTheme struct {
	ReplyIndicator     string       `toml:"reply_indicator"`
	ForwardedIndicator string       `toml:"forwarded_indicator"`
	AuthorStyle        StyleWrapper `toml:"author_style"`
	MentionStyle       StyleWrapper `toml:"mention_style"`
	EmojiStyle         StyleWrapper `toml:"emoji_style"`
	URLStyle           StyleWrapper `toml:"url_style"`
	AttachmentStyle    StyleWrapper `toml:"attachment_style"`
}
type NavigationKeys struct {
	SelectPrevious string `toml:"select_previous"`
	SelectNext     string `toml:"select_next"`
	SelectFirst    string `toml:"select_first"`
	SelectLast     string `toml:"select_last"`
}

type Notifications

type Notifications struct {
	Enabled  bool  `toml:"enabled"`
	Duration int   `toml:"duration"`
	Sound    Sound `toml:"sound"`
}

type Sound

type Sound struct {
	Enabled    bool `toml:"enabled"`
	OnlyOnPing bool `toml:"only_on_ping"`
}

type StyleWrapper

type StyleWrapper struct{ tcell.Style }

func NewStyleWrapper

func NewStyleWrapper(style tcell.Style) StyleWrapper

func (*StyleWrapper) UnmarshalTOML

func (sw *StyleWrapper) UnmarshalTOML(v any) error

type Theme

type Theme struct {
	Title        TitleTheme        `toml:"title"`
	Border       BorderTheme       `toml:"border"`
	GuildsTree   GuildsTreeTheme   `toml:"guilds_tree"`
	MessagesList MessagesListTheme `toml:"messages_list"`
	MentionsList MentionsListTheme `toml:"mentions_list"`
}

type ThemeStyle

type ThemeStyle struct {
	NormalStyle StyleWrapper `toml:"normal_style"`
	ActiveStyle StyleWrapper `toml:"active_style"`
}

type Timestamps

type Timestamps struct {
	Enabled bool   `toml:"enabled"`
	Format  string `toml:"format"`
}

type TitleTheme

type TitleTheme struct {
	ThemeStyle
	Alignment AlignmentWrapper `toml:"alignment"`
}

Jump to

Keyboard shortcuts

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