config

package
v0.0.0-...-33d7cd8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDefault = ConfigTOML{
	General: GeneralTOML{
		Editor:              sp("TUT_USE_INTERNAL"),
		Confirmation:        bt,
		MouseSupport:        bf,
		DateFormat:          sp("2006-01-02 15:04"),
		DateTodayFormat:     sp("15:04"),
		DateRelative:        ip(-1),
		QuoteReply:          bf,
		MaxWidth:            ip(0),
		ShortHints:          bf,
		ShowFilterPhrase:    bt,
		ShowIcons:           bt,
		ShowHelp:            bt,
		RedrawUI:            bt,
		StickToTop:          bf,
		ShowBoostedUser:     bf,
		DynamicTimelineName: bt,
		CommandsInNewPane:   bt,
		ListPlacement:       sp("left"),
		ListSplit:           sp("row"),
		ListProportion:      ip(1),
		ContentProportion:   ip(2),
		TerminalTitle:       ip(0),
		LeaderKey:           sp(""),
		LeaderTimeout:       ip64(1000),
		NotificationsToHide: &[]string{},
		Timelines: &[]TimelineTOML{
			{
				Name:        sp("Home"),
				Type:        sp("home"),
				HideBoosts:  bf,
				HideReplies: bf,
			},
			{
				Name: sp("Notifications"),
				Type: sp("notifications"),
				Keys: &[]string{"n", "N"},
			},
		},
	},
	Style: StyleTOML{
		Theme:                          sp("none"),
		XrdbPrefix:                     sp("guess"),
		Background:                     sp("#272822"),
		Text:                           sp("#f8f8f2"),
		Subtle:                         sp("#808080"),
		WarningText:                    sp("#f92672"),
		TextSpecial1:                   sp("#ae81ff"),
		TextSpecial2:                   sp("#a6e22e"),
		TopBarBackground:               sp("#f92672"),
		TopBarText:                     sp("#f8f8f2"),
		StatusBarBackground:            sp("#f92672"),
		StatusBarText:                  sp("#f8f8f2"),
		StatusBarViewBackground:        sp("#ae81ff"),
		StatusBarViewText:              sp("#f8f8f2"),
		CommandText:                    sp("#f8f8f2"),
		ListSelectedBackground:         sp("#f92672"),
		ListSelectedText:               sp("#f8f8f2"),
		ListSelectedInactiveBackground: sp("#ae81ff"),
		ListSelectedInactiveText:       sp("#f8f8f2"),
		ControlsText:                   sp("#f8f8f2"),
		ControlsHighlight:              sp("#a6e22e"),
		AutocompleteBackground:         sp("#272822"),
		AutocompleteText:               sp("#f8f8f2"),
		AutocompleteSelectedBackground: sp("#ae81ff"),
		AutocompleteSelectedText:       sp("#f8f8f2"),
		ButtonColorOne:                 sp("#f92672"),
		ButtonColorTwo:                 sp("#272822"),
		TimelineNameBackground:         sp("#272822"),
		TimelineNameText:               sp("#808080"),
	},
	Media: MediaTOML{
		DeleteTmpFiles: bt,
		Image: &ViewerTOML{
			Program:  sp("TUT_OS_DEFAULT"),
			Args:     sp(""),
			Terminal: bf,
			Single:   bt,
			Reverse:  bf,
		},
		Video: &ViewerTOML{
			Program:  sp("TUT_OS_DEFAULT"),
			Args:     sp(""),
			Terminal: bf,
			Single:   bt,
			Reverse:  bf,
		},
		Audio: &ViewerTOML{
			Program:  sp("TUT_OS_DEFAULT"),
			Args:     sp(""),
			Terminal: bf,
			Single:   bt,
			Reverse:  bf,
		},
		Link: &ViewerTOML{
			Program:  sp("TUT_OS_DEFAULT"),
			Args:     sp(""),
			Terminal: bf,
			Single:   bt,
			Reverse:  bf,
		},
	},
	NotificationConfig: NotificationsTOML{
		Followers: bf,
		Favorite:  bf,
		Mention:   bf,
		Update:    bf,
		Boost:     bf,
		Poll:      bf,
		Posts:     bf,
	},
	Input: InputTOML{
		GlobalDown: &KeyHintTOML{
			Keys:        &[]string{"j", "J"},
			SpecialKeys: &[]string{"Down"},
		},
		GlobalUp: &KeyHintTOML{
			Keys:        &[]string{"k", "K"},
			SpecialKeys: &[]string{"Up"},
		},
		GlobalEnter: &KeyHintTOML{
			SpecialKeys: &[]string{"Enter"},
		},
		GlobalBack: &KeyHintTOML{
			Hint:        sp("[Esc]"),
			SpecialKeys: &[]string{"Esc"},
		},
		GlobalExit: &KeyHintTOML{
			Hint: sp("[Q]uit"),
			Keys: &[]string{"q", "Q"},
		},
		MainHome: &KeyHintTOML{
			Hint:        sp(""),
			Keys:        &[]string{"g"},
			SpecialKeys: &[]string{"Home"},
		},
		MainEnd: &KeyHintTOML{
			Hint:        sp(""),
			Keys:        &[]string{"G"},
			SpecialKeys: &[]string{"End"},
		},
		MainPrevFeed: &KeyHintTOML{
			Hint:        sp(""),
			Keys:        &[]string{"h", "H"},
			SpecialKeys: &[]string{"Left"},
		},
		MainNextFeed: &KeyHintTOML{
			Hint:        sp(""),
			Keys:        &[]string{"l", "L"},
			SpecialKeys: &[]string{"Right"},
		},
		MainPrevPane: &KeyHintTOML{
			Hint:        sp(""),
			SpecialKeys: &[]string{"Backtab"},
		},
		MainNextPane: &KeyHintTOML{
			Hint:        sp(""),
			SpecialKeys: &[]string{"Tab"},
		},
		MainCompose: &KeyHintTOML{
			Hint: sp(""),
			Keys: &[]string{"c", "C"},
		},
		MainNextAccount: &KeyHintTOML{
			Hint:        sp(""),
			SpecialKeys: &[]string{"Ctrl-N"},
		},
		MainPrevAccount: &KeyHintTOML{
			Hint:        sp(""),
			SpecialKeys: &[]string{"Ctrl-P"},
		},
		StatusAvatar: &KeyHintTOML{
			Hint: sp("[A]vatar"),
			Keys: &[]string{"a", "A"},
		},
		StatusBoost: &KeyHintTOML{
			Hint:    sp("[B]oost"),
			HintAlt: sp("Un[B]oost"),
			Keys:    &[]string{"b", "B"},
		},
		StatusEdit: &KeyHintTOML{
			Hint: sp("[E]dit"),
			Keys: &[]string{"e", "E"},
		},
		StatusDelete: &KeyHintTOML{
			Hint: sp("[D]elete"),
			Keys: &[]string{"d", "D"},
		},
		StatusFavorite: &KeyHintTOML{
			Hint:    sp("[F]avorite"),
			HintAlt: sp("Un[F]avorite"),
			Keys:    &[]string{"f", "F"},
		},
		StatusMedia: &KeyHintTOML{
			Hint: sp("[M]edia"),
			Keys: &[]string{"m", "M"},
		},
		StatusLinks: &KeyHintTOML{
			Hint: sp("[O]pen"),
			Keys: &[]string{"o", "O"},
		},
		StatusPoll: &KeyHintTOML{
			Hint: sp("[P]oll"),
			Keys: &[]string{"p", "P"},
		},
		StatusReply: &KeyHintTOML{
			Hint: sp("[R]eply"),
			Keys: &[]string{"r", "R"},
		},
		StatusBookmark: &KeyHintTOML{
			Hint:    sp("[S]ave"),
			HintAlt: sp("Un[S]ave"),
			Keys:    &[]string{"s", "S"},
		},
		StatusThread: &KeyHintTOML{
			Hint: sp("[T]hread"),
			Keys: &[]string{"t", "T"},
		},
		StatusUser: &KeyHintTOML{
			Hint: sp("[U]ser"),
			Keys: &[]string{"u", "U"},
		},
		StatusViewFocus: &KeyHintTOML{
			Hint: sp("[V]iew"),
			Keys: &[]string{"v", "V"},
		},
		StatusYank: &KeyHintTOML{
			Hint: sp("[Y]ank"),
			Keys: &[]string{"y", "Y"},
		},
		StatusToggleCW: &KeyHintTOML{
			Hint: sp("Press [Z] to toggle cw"),
			Keys: &[]string{"z", "Z"},
		},
		StatusShowFiltered: &KeyHintTOML{
			Hint: sp("Press [Z] to view filtered toot"),
			Keys: &[]string{"z", "Z"},
		},
		UserAvatar: &KeyHintTOML{
			Hint: sp("[A]vatar"),
			Keys: &[]string{"a", "A"},
		},
		UserBlock: &KeyHintTOML{
			Hint:    sp("[B]lock"),
			HintAlt: sp("Un[B]lock"),
			Keys:    &[]string{"b", "B"},
		},
		UserFollow: &KeyHintTOML{
			Hint:    sp("[F]ollow"),
			HintAlt: sp("Un[F]ollow"),
			Keys:    &[]string{"f", "F"},
		},
		UserFollowRequestDecide: &KeyHintTOML{
			Hint:    sp("Follow [R]equest"),
			HintAlt: sp("Follow [R]equest"),
			Keys:    &[]string{"r", "R"},
		},
		UserMute: &KeyHintTOML{
			Hint:    sp("[M]ute"),
			HintAlt: sp("Un[M]ute"),
			Keys:    &[]string{"m", "M"},
		},
		UserLinks: &KeyHintTOML{
			Hint: sp("[O]pen"),
			Keys: &[]string{"o", "O"},
		},
		UserUser: &KeyHintTOML{
			Hint: sp("[U]ser"),
			Keys: &[]string{"u", "U"},
		},
		UserViewFocus: &KeyHintTOML{
			Hint: sp("[V]iew"),
			Keys: &[]string{"v", "V"},
		},
		UserYank: &KeyHintTOML{
			Hint: sp("[Y]ank"),
			Keys: &[]string{"y", "Y"},
		},
		ListOpenFeed: &KeyHintTOML{
			Hint: sp("[O]pen"),
			Keys: &[]string{"o", "O"},
		},
		ListUserList: &KeyHintTOML{
			Hint: sp("[U]sers"),
			Keys: &[]string{"u", "U"},
		},
		ListUserAdd: &KeyHintTOML{
			Hint: sp("[A]dd"),
			Keys: &[]string{"a", "A"},
		},
		ListUserDelete: &KeyHintTOML{
			Hint: sp("[D]elete"),
			Keys: &[]string{"d", "D"},
		},
		LinkOpen: &KeyHintTOML{
			Hint: sp("[O]pen"),
			Keys: &[]string{"o", "O"},
		},
		LinkYank: &KeyHintTOML{
			Hint: sp("[Y]ank"),
			Keys: &[]string{"y", "Y"},
		},
		TagOpenFeed: &KeyHintTOML{
			Hint: sp("[O]pen"),
			Keys: &[]string{"o", "O"},
		},
		TagFollow: &KeyHintTOML{
			Hint:    sp("[F]ollow"),
			HintAlt: sp("Un[F]ollow"),
			Keys:    &[]string{"f", "F"},
		},
		ComposeEditCW: &KeyHintTOML{
			Hint: sp("[C]W text"),
			Keys: &[]string{"c", "C"},
		},
		ComposeEditText: &KeyHintTOML{
			Hint: sp("[E]dit text"),
			Keys: &[]string{"e", "E"},
		},
		ComposeIncludeQuote: &KeyHintTOML{
			Hint: sp("[I]nclude quote"),
			Keys: &[]string{"i", "I"},
		},
		ComposeMediaFocus: &KeyHintTOML{
			Hint: sp("[M]edia"),
			Keys: &[]string{"m", "M"},
		},
		ComposePost: &KeyHintTOML{
			Hint: sp("[P]ost"),
			Keys: &[]string{"p", "P"},
		},
		ComposeToggleContentWarning: &KeyHintTOML{
			Hint: sp("[T]oggle CW"),
			Keys: &[]string{"t", "T"},
		},
		ComposeVisibility: &KeyHintTOML{
			Hint: sp("[V]isibility"),
			Keys: &[]string{"v", "V"},
		},
		ComposeLanguage: &KeyHintTOML{
			Hint: sp("[L]ang"),
			Keys: &[]string{"l", "L"},
		},
		ComposePoll: &KeyHintTOML{
			Hint: sp("P[O]ll"),
			Keys: &[]string{"o", "O"},
		},
		MediaDelete: &KeyHintTOML{
			Hint: sp("[D]elete"),
			Keys: &[]string{"d", "D"},
		},
		MediaEditDesc: &KeyHintTOML{
			Hint: sp("[E]dit desc"),
			Keys: &[]string{"e", "E"},
		},
		MediaAdd: &KeyHintTOML{
			Hint: sp("[A]dd"),
			Keys: &[]string{"a", "A"},
		},
		VoteVote: &KeyHintTOML{
			Hint: sp("[V]ote"),
			Keys: &[]string{"v", "V"},
		},
		VoteSelect: &KeyHintTOML{
			Hint:        sp("[Enter] to select"),
			Keys:        &[]string{" "},
			SpecialKeys: &[]string{"Enter"},
		},
		PollAdd: &KeyHintTOML{
			Hint: sp("[A]dd"),
			Keys: &[]string{"a", "A"},
		},
		PollEdit: &KeyHintTOML{
			Hint: sp("[E]dit"),
			Keys: &[]string{"e", "E"},
		},
		PollDelete: &KeyHintTOML{
			Hint: sp("[D]elete"),
			Keys: &[]string{"d", "D"},
		},
		PollMultiToggle: &KeyHintTOML{
			Hint: sp("Toggle [M]ultiple"),
			Keys: &[]string{"m", "M"},
		},
		PollExpiration: &KeyHintTOML{
			Hint: sp("E[X]pires"),
			Keys: &[]string{"x", "X"},
		},
		PreferenceName: &KeyHintTOML{
			Hint: sp("[N]ame"),
			Keys: &[]string{"n", "N"},
		},
		PreferenceVisibility: &KeyHintTOML{
			Hint: sp("[V]isibility"),
			Keys: &[]string{"v", "V"},
		},
		PreferenceBio: &KeyHintTOML{
			Hint: sp("[B]io"),
			Keys: &[]string{"b", "B"},
		},
		PreferenceSave: &KeyHintTOML{
			Hint: sp("[S]ave"),
			Keys: &[]string{"s", "S"},
		},
		PreferenceFields: &KeyHintTOML{
			Hint: sp("[F]ields"),
			Keys: &[]string{"f", "F"},
		},
		PreferenceFieldsAdd: &KeyHintTOML{
			Hint: sp("[A]dd"),
			Keys: &[]string{"a", "A"},
		},
		PreferenceFieldsEdit: &KeyHintTOML{
			Hint: sp("[E]dit"),
			Keys: &[]string{"e", "E"},
		},
		PreferenceFieldsDelete: &KeyHintTOML{
			Hint: sp("[D]elete"),
			Keys: &[]string{"d", "D"},
		},
		EditorExit: &KeyHintTOML{
			Hint:        sp("[Esc] when done"),
			SpecialKeys: &[]string{"Esc"},
		},
	},
}

Functions

func ColorFromKey

func ColorFromKey(c *Config, k Key, first bool) (string, int)

func ColorKey

func ColorKey(c *Config, pre, key, end string) string

func ColorMark

func ColorMark(color tcell.Color) string

func CreateDefaultConfig

func CreateDefaultConfig(filepath string) error

func NilDefaultBool

func NilDefaultBool(x *bool, def *bool) bool

func NilDefaultInt

func NilDefaultInt(x *int, def *int) int

func NilDefaultInt64

func NilDefaultInt64(x *int64, def *int64) int64

func NilDefaultString

func NilDefaultString(x *string, def *string) string

func SublteText

func SublteText(c *Config, text string) string

func TextFlags

func TextFlags(s string) string

Types

type Config

type Config struct {
	General            General
	Style              Style
	Media              Media
	OpenPattern        OpenPattern
	OpenCustom         OpenCustom
	NotificationConfig Notification
	Templates          Templates
	Input              Input
}

func Load

func Load(cnfPath string, cnfDir string) *Config

type ConfigTOML

type ConfigTOML struct {
	General            GeneralTOML       `toml:"general"`
	Style              StyleTOML         `toml:"style"`
	Media              MediaTOML         `toml:"media"`
	OpenPattern        OpenPatternTOML   `toml:"open-pattern"`
	OpenCustom         OpenCustomTOML    `toml:"open-custom"`
	NotificationConfig NotificationsTOML `toml:"desktop-notification"`
	Input              InputTOML         `toml:"input"`
}

type Custom

type Custom struct {
	Index    int
	Name     string
	Program  string
	Args     []string
	Terminal bool
	Key      Key
}

type CustomTOML

type CustomTOML struct {
	Program     *string   `toml:"program"`
	Args        *string   `toml:"args"`
	Terminal    *bool     `toml:"terminal"`
	Hint        *string   `toml:"hint"`
	Keys        *[]string `toml:"keys"`
	SpecialKeys *[]string `toml:"special-keys"`
}

type FeedType

type FeedType uint
const (
	Favorites FeedType = iota
	Favorited
	Boosts
	Followers
	Following
	FollowRequests
	Blocking
	Muting
	History
	InvalidFeed
	Notifications
	Saved
	Tag
	Tags
	Thread
	TimelineFederated
	TimelineHome
	TimelineHomeSpecial
	TimelineLocal
	Mentions
	Conversations
	User
	UserList
	Lists
	List
	ListUsersIn
	ListUsersAdd
)

type General

type General struct {
	Editor              string
	UseInternalEditor   bool
	Confirmation        bool
	MouseSupport        bool
	DateTodayFormat     string
	DateFormat          string
	DateRelative        int
	MaxWidth            int
	QuoteReply          bool
	ShortHints          bool
	ShowFilterPhrase    bool
	ListPlacement       ListPlacement
	ListSplit           ListSplit
	ListProportion      int
	ContentProportion   int
	TerminalTitle       int
	ShowIcons           bool
	ShowHelp            bool
	RedrawUI            bool
	LeaderKey           rune
	LeaderTimeout       int64
	LeaderActions       []LeaderAction
	Timelines           []*Timeline
	StickToTop          bool
	NotificationsToHide []NotificationToHide
	ShowBoostedUser     bool
	DynamicTimelineName bool
	CommandsInNewPane   bool
}

type GeneralTOML

type GeneralTOML struct {
	Editor              *string             `toml:"editor"`
	Confirmation        *bool               `toml:"confirmation"`
	MouseSupport        *bool               `toml:"mouse-support"`
	DateFormat          *string             `toml:"date-format"`
	DateTodayFormat     *string             `toml:"date-today-format"`
	DateRelative        *int                `toml:"date-relative"`
	MaxWidth            *int                `toml:"max-width"`
	QuoteReply          *bool               `toml:"quote-reply"`
	ShortHints          *bool               `toml:"short-hints"`
	ShowFilterPhrase    *bool               `toml:"show-filter-phrase"`
	ListPlacement       *string             `toml:"list-placement"`
	ListSplit           *string             `toml:"list-split"`
	ListProportion      *int                `toml:"list-proportion"`
	ContentProportion   *int                `toml:"content-proportion"`
	TerminalTitle       *int                `toml:"terminal-title"`
	ShowIcons           *bool               `toml:"show-icons"`
	ShowHelp            *bool               `toml:"show-help"`
	RedrawUI            *bool               `toml:"redraw-ui"`
	LeaderKey           *string             `toml:"leader-key"`
	LeaderTimeout       *int64              `toml:"leader-timeout"`
	Timelines           *[]TimelineTOML     `toml:"timelines"`
	LeaderActions       *[]LeaderActionTOML `toml:"leader-actions"`
	StickToTop          *bool               `toml:"stick-to-top"`
	NotificationsToHide *[]string           `toml:"notifications-to-hide"`
	ShowBoostedUser     *bool               `toml:"show-boosted-user"`
	DynamicTimelineName *bool               `toml:"dynamic-timeline-name"`
	CommandsInNewPane   *bool               `toml:"commands-in-new-pane"`
}

type Input

type Input struct {
	GlobalDown  Key
	GlobalUp    Key
	GlobalEnter Key
	GlobalBack  Key
	GlobalExit  Key

	MainHome        Key
	MainEnd         Key
	MainPrevFeed    Key
	MainNextFeed    Key
	MainPrevPane    Key
	MainNextPane    Key
	MainCompose     Key
	MainNextAccount Key
	MainPrevAccount Key

	StatusAvatar       Key
	StatusBoost        Key
	StatusDelete       Key
	StatusEdit         Key
	StatusFavorite     Key
	StatusMedia        Key
	StatusLinks        Key
	StatusPoll         Key
	StatusReply        Key
	StatusBookmark     Key
	StatusThread       Key
	StatusUser         Key
	StatusViewFocus    Key
	StatusYank         Key
	StatusToggleCW     Key
	StatusShowFiltered Key

	UserAvatar              Key
	UserBlock               Key
	UserFollow              Key
	UserFollowRequestDecide Key
	UserMute                Key
	UserLinks               Key
	UserUser                Key
	UserViewFocus           Key
	UserYank                Key

	ListOpenFeed   Key
	ListUserList   Key
	ListUserAdd    Key
	ListUserDelete Key

	TagOpenFeed Key
	TagFollow   Key

	LinkOpen Key
	LinkYank Key

	ComposeEditCW               Key
	ComposeEditText             Key
	ComposeIncludeQuote         Key
	ComposeMediaFocus           Key
	ComposePost                 Key
	ComposeToggleContentWarning Key
	ComposeVisibility           Key
	ComposeLanguage             Key
	ComposePoll                 Key

	MediaDelete   Key
	MediaEditDesc Key
	MediaAdd      Key

	VoteVote   Key
	VoteSelect Key

	PollAdd         Key
	PollEdit        Key
	PollDelete      Key
	PollMultiToggle Key
	PollExpiration  Key

	PreferenceName         Key
	PreferenceVisibility   Key
	PreferenceBio          Key
	PreferenceSave         Key
	PreferenceFields       Key
	PreferenceFieldsAdd    Key
	PreferenceFieldsEdit   Key
	PreferenceFieldsDelete Key

	EditorExit Key
}

type InputTOML

type InputTOML struct {
	GlobalDown  *KeyHintTOML `toml:"global-down"`
	GlobalUp    *KeyHintTOML `toml:"global-up"`
	GlobalEnter *KeyHintTOML `toml:"global-enter"`
	GlobalBack  *KeyHintTOML `toml:"global-back"`
	GlobalExit  *KeyHintTOML `toml:"global-exit"`

	MainHome        *KeyHintTOML `toml:"main-home"`
	MainEnd         *KeyHintTOML `toml:"main-end"`
	MainPrevFeed    *KeyHintTOML `toml:"main-prev-feed"`
	MainNextFeed    *KeyHintTOML `toml:"main-next-feed"`
	MainPrevPane    *KeyHintTOML `toml:"main-prev-pane"`
	MainNextPane    *KeyHintTOML `toml:"main-next-pane"`
	MainCompose     *KeyHintTOML `toml:"main-compose"`
	MainNextAccount *KeyHintTOML `toml:"main-next-account"`
	MainPrevAccount *KeyHintTOML `toml:"main-prev-account"`

	StatusAvatar       *KeyHintTOML `toml:"status-avatar"`
	StatusBoost        *KeyHintTOML `toml:"status-boost"`
	StatusDelete       *KeyHintTOML `toml:"status-delete"`
	StatusEdit         *KeyHintTOML `toml:"status-edit"`
	StatusFavorite     *KeyHintTOML `toml:"status-favorite"`
	StatusMedia        *KeyHintTOML `toml:"status-media"`
	StatusLinks        *KeyHintTOML `toml:"status-links"`
	StatusPoll         *KeyHintTOML `toml:"status-poll"`
	StatusReply        *KeyHintTOML `toml:"status-reply"`
	StatusBookmark     *KeyHintTOML `toml:"status-bookmark"`
	StatusThread       *KeyHintTOML `toml:"status-thread"`
	StatusUser         *KeyHintTOML `toml:"status-user"`
	StatusViewFocus    *KeyHintTOML `toml:"status-view-focus"`
	StatusYank         *KeyHintTOML `toml:"status-yank"`
	StatusToggleCW     *KeyHintTOML `toml:"status-toggle-cw"`
	StatusShowFiltered *KeyHintTOML `toml:"status-show-filtered"`

	UserAvatar              *KeyHintTOML `toml:"user-avatar"`
	UserBlock               *KeyHintTOML `toml:"user-block"`
	UserFollow              *KeyHintTOML `toml:"user-follow"`
	UserFollowRequestDecide *KeyHintTOML `toml:"user-follow-request-decide"`
	UserMute                *KeyHintTOML `toml:"user-mute"`
	UserLinks               *KeyHintTOML `toml:"user-links"`
	UserUser                *KeyHintTOML `toml:"user-user"`
	UserViewFocus           *KeyHintTOML `toml:"user-view-focus"`
	UserYank                *KeyHintTOML `toml:"user-yank"`

	ListOpenFeed   *KeyHintTOML `toml:"list-open-feed"`
	ListUserList   *KeyHintTOML `toml:"list-user-list"`
	ListUserAdd    *KeyHintTOML `toml:"list-user-add"`
	ListUserDelete *KeyHintTOML `toml:"list-user-delete"`

	TagOpenFeed *KeyHintTOML `toml:"tag-open-feed"`
	TagFollow   *KeyHintTOML `toml:"tag-follow"`

	LinkOpen *KeyHintTOML `toml:"link-open"`
	LinkYank *KeyHintTOML `toml:"link-yank"`

	ComposeEditCW               *KeyHintTOML `toml:"compose-edit-cw"`
	ComposeEditText             *KeyHintTOML `toml:"compose-edit-text"`
	ComposeIncludeQuote         *KeyHintTOML `toml:"compose-include-quote"`
	ComposeMediaFocus           *KeyHintTOML `toml:"compose-media-focus"`
	ComposePost                 *KeyHintTOML `toml:"compose-post"`
	ComposeToggleContentWarning *KeyHintTOML `toml:"compose-toggle-content-warning"`
	ComposeVisibility           *KeyHintTOML `toml:"compose-visibility"`
	ComposeLanguage             *KeyHintTOML `toml:"compose-language"`
	ComposePoll                 *KeyHintTOML `toml:"compose-poll"`

	MediaDelete   *KeyHintTOML `toml:"media-delete"`
	MediaEditDesc *KeyHintTOML `toml:"media-edit-desc"`
	MediaAdd      *KeyHintTOML `toml:"media-add"`

	VoteVote   *KeyHintTOML `toml:"vote-vote"`
	VoteSelect *KeyHintTOML `toml:"vote-select"`

	PollAdd         *KeyHintTOML `toml:"poll-add"`
	PollEdit        *KeyHintTOML `toml:"poll-edit"`
	PollDelete      *KeyHintTOML `toml:"poll-delete"`
	PollMultiToggle *KeyHintTOML `toml:"poll-multi-toggle"`
	PollExpiration  *KeyHintTOML `toml:"poll-expiration"`

	PreferenceName         *KeyHintTOML `toml:"preference-name"`
	PreferenceVisibility   *KeyHintTOML `toml:"preference-visibility"`
	PreferenceBio          *KeyHintTOML `toml:"preference-bio"`
	PreferenceSave         *KeyHintTOML `toml:"preference-save"`
	PreferenceFields       *KeyHintTOML `toml:"preference-fields"`
	PreferenceFieldsAdd    *KeyHintTOML `toml:"preference-fields-add"`
	PreferenceFieldsEdit   *KeyHintTOML `toml:"preference-fields-edit"`
	PreferenceFieldsDelete *KeyHintTOML `toml:"preference-fields-delete"`

	EditorExit *KeyHintTOML `toml:"editor-exit"`
}

type Key

type Key struct {
	Hint  [][]string
	Runes []rune
	Keys  []tcell.Key
}

func NewKey

func NewKey(hint string, hintAlt string, keys []string, special []string) (Key, error)

func (Key) Match

func (k Key) Match(kb tcell.Key, rb rune) bool

type KeyHintTOML

type KeyHintTOML struct {
	Hint        *string   `toml:"hint"`
	HintAlt     *string   `toml:"hint-alt"`
	Keys        *[]string `toml:"keys"`
	SpecialKeys *[]string `toml:"special-keys"`
}

type LeaderAction

type LeaderAction struct {
	Command   LeaderCommand
	Subaction string
	Shortcut  string
}

type LeaderActionTOML

type LeaderActionTOML struct {
	Type     *string `toml:"type"`
	Data     *string `toml:"data"`
	Shortcut *string `toml:"shortcut"`
}

type LeaderCommand

type LeaderCommand uint
const (
	LeaderNone LeaderCommand = iota
	LeaderClearNotifications
	LeaderCompose
	LeaderEdit
	LeaderBlocking
	LeaderFavorited
	LeaderBoosts
	LeaderFavorites
	LeaderFollowing
	LeaderFollowers
	LeaderTags
	LeaderListPlacement
	LeaderListSplit
	LeaderMuting
	LeaderPreferences
	LeaderProfile
	LeaderProportions
	LeaderMentions
	LeaderRefetch
	LeaderStickToTop
	LeaderHistory
	LeaderLoadNewer
	LeaderPane
	LeaderClosePane
	LeaderMovePaneLeft
	LeaderMovePaneRight
	LeaderMovePaneHome
	LeaderMovePaneEnd
)

type ListPlacement

type ListPlacement uint
const (
	ListPlacementTop ListPlacement = iota
	ListPlacementBottom
	ListPlacementLeft
	ListPlacementRight
)

type ListSplit

type ListSplit uint
const (
	ListRow ListSplit = iota
	ListColumn
)

type Media

type Media struct {
	DeleteTmpFiles bool
	ImageViewer    string
	ImageArgs      []string
	ImageTerminal  bool
	ImageSingle    bool
	ImageReverse   bool
	VideoViewer    string
	VideoArgs      []string
	VideoTerminal  bool
	VideoSingle    bool
	VideoReverse   bool
	AudioViewer    string
	AudioArgs      []string
	AudioTerminal  bool
	AudioSingle    bool
	AudioReverse   bool
	LinkViewer     string
	LinkArgs       []string
	LinkTerminal   bool
}

type MediaTOML

type MediaTOML struct {
	DeleteTmpFiles *bool       `toml:"delete-temp-files"`
	Image          *ViewerTOML `toml:"image"`
	Video          *ViewerTOML `toml:"video"`
	Audio          *ViewerTOML `toml:"audio"`
	Link           *ViewerTOML `toml:"link"`
}

type Notification

type Notification struct {
	NotificationFollower bool
	NotificationFavorite bool
	NotificationMention  bool
	NotificationUpdate   bool
	NotificationBoost    bool
	NotificationPoll     bool
	NotificationPost     bool
}

type NotificationToHide

type NotificationToHide string
const (
	HideMention       NotificationToHide = "mention"
	HideStatus        NotificationToHide = "status"
	HideBoost         NotificationToHide = "reblog"
	HideFollow        NotificationToHide = "follow"
	HideFollowRequest NotificationToHide = "follow_request"
	HideFavorite      NotificationToHide = "favourite"
	HidePoll          NotificationToHide = "poll"
	HideEdited        NotificationToHide = "update"
)

type NotificationType

type NotificationType uint
const (
	NotificationFollower NotificationType = iota
	NotificationFavorite
	NotificationMention
	NotificationUpdate
	NotificationBoost
	NotificationPoll
	NotificationPost
)

type NotificationsTOML

type NotificationsTOML struct {
	Followers *bool `toml:"followers"`
	Favorite  *bool `toml:"favorite"`
	Mention   *bool `toml:"mention"`
	Update    *bool `toml:"update"`
	Boost     *bool `toml:"boost"`
	Poll      *bool `toml:"poll"`
	Posts     *bool `toml:"posts"`
}

type OnTimelineCreationClosed

type OnTimelineCreationClosed uint
const (
	TimelineCreationClosedNewPane OnTimelineCreationClosed = iota
	TimelineCreationClosedCurrentPane
)

type OnTimelineFocus

type OnTimelineFocus uint
const (
	TimelineFocusPane OnTimelineFocus = iota
	TimelineFocusTimeline
)

type OpenCustom

type OpenCustom struct {
	OpenCustoms []Custom
}

type OpenCustomTOML

type OpenCustomTOML struct {
	Programs *[]CustomTOML `toml:"programs"`
}

type OpenPattern

type OpenPattern struct {
	Patterns []Pattern
}

type OpenPatternTOML

type OpenPatternTOML struct {
	Patterns *[]PatternTOML `toml:"patterns"`
}

type Pattern

type Pattern struct {
	Compiled glob.Glob
	Program  string
	Args     []string
	Terminal bool
}

type PatternTOML

type PatternTOML struct {
	Matching *string `toml:"matching"`
	Program  *string `toml:"program"`
	Args     *string `toml:"args"`
	Terminal *bool   `toml:"terminal"`
}

type Style

type Style struct {
	Theme string

	Background tcell.Color
	Text       tcell.Color

	Subtle      tcell.Color
	WarningText tcell.Color

	TextSpecial1 tcell.Color
	TextSpecial2 tcell.Color

	TopBarBackground tcell.Color
	TopBarText       tcell.Color

	StatusBarBackground tcell.Color
	StatusBarText       tcell.Color

	StatusBarViewBackground tcell.Color
	StatusBarViewText       tcell.Color

	ListSelectedBackground tcell.Color
	ListSelectedText       tcell.Color

	ListSelectedInactiveBackground tcell.Color
	ListSelectedInactiveText       tcell.Color

	ControlsText      tcell.Color
	ControlsHighlight tcell.Color

	AutocompleteBackground tcell.Color
	AutocompleteText       tcell.Color

	AutocompleteSelectedBackground tcell.Color
	AutocompleteSelectedText       tcell.Color

	ButtonColorOne tcell.Color
	ButtonColorTwo tcell.Color

	TimelineNameBackground tcell.Color
	TimelineNameText       tcell.Color

	IconColor tcell.Color

	CommandText tcell.Color
}

type StyleTOML

type StyleTOML struct {
	Theme *string `toml:"theme"`

	XrdbPrefix *string `toml:"xrdb-prefix"`

	Background *string `toml:"background"`
	Text       *string `toml:"text"`

	Subtle      *string `toml:"subtle"`
	WarningText *string `toml:"warning-text"`

	TextSpecial1 *string `toml:"text-special-one"`
	TextSpecial2 *string `toml:"text-special-two"`

	TopBarBackground *string `toml:"top-bar-background"`
	TopBarText       *string `toml:"top-bar-text"`

	StatusBarBackground *string `toml:"status-bar-background"`
	StatusBarText       *string `toml:"status-bar-text"`

	StatusBarViewBackground *string `toml:"status-bar-view-background"`
	StatusBarViewText       *string `toml:"status-bar-view-text"`

	ListSelectedBackground *string `toml:"list-selected-background"`
	ListSelectedText       *string `toml:"list-selected-text"`

	ListSelectedInactiveBackground *string `toml:"list-selected-inactive-background"`
	ListSelectedInactiveText       *string `toml:"list-selected-inactive-text"`

	ControlsText      *string `toml:"controls-text"`
	ControlsHighlight *string `toml:"controls-highlight"`

	AutocompleteBackground *string `toml:"autocomplete-background"`
	AutocompleteText       *string `toml:"autocomplete-text"`

	AutocompleteSelectedBackground *string `toml:"autocomplete-selected-background"`
	AutocompleteSelectedText       *string `toml:"autocomplete-selected-text"`

	ButtonColorOne *string `toml:"button-color-one"`
	ButtonColorTwo *string `toml:"button-color-two"`

	TimelineNameBackground *string `toml:"timeline-name-background"`
	TimelineNameText       *string `toml:"timeline-name-text"`

	IconColor *string `toml:"icon-color"`

	CommandText *string `toml:"command-text"`
}

type Templates

type Templates struct {
	Toot *template.Template
	User *template.Template
	Help *template.Template
}

type Timeline

type Timeline struct {
	ID          uint
	FeedType    FeedType
	Subaction   string
	Name        string
	Key         Key
	Shortcut    string
	HideBoosts  bool
	HideReplies bool

	Closed           bool
	OnFocus          OnTimelineFocus
	OnCreationClosed OnTimelineCreationClosed
}

func NewTimeline

func NewTimeline(tl Timeline) *Timeline

type TimelineTOML

type TimelineTOML struct {
	Name        *string   `toml:"name"`
	Type        *string   `toml:"type"`
	Data        *string   `toml:"data"`
	Keys        *[]string `toml:"keys"`
	SpecialKeys *[]string `toml:"special-keys"`
	Shortcut    *string   `toml:"shortcut"`
	HideBoosts  *bool     `toml:"hide-boosts"`
	HideReplies *bool     `toml:"hide-replies"`

	Closed           *bool   `toml:"closed"`
	OnCreationClosed *string `toml:"on-creation-closed"`
	OnFocus          *string `toml:"on-focus"`
}

type ViewerTOML

type ViewerTOML struct {
	Program  *string `toml:"program"`
	Args     *string `toml:"args"`
	Terminal *bool   `toml:"terminal"`
	Single   *bool   `toml:"single"`
	Reverse  *bool   `toml:"reverse"`
}

type XrdbColors

type XrdbColors map[string]map[string]string

func GetXrdbColors

func GetXrdbColors() (XrdbColors, error)

Jump to

Keyboard shortcuts

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