wconfig

package
v0.10.4-beta.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigKey_AppClear                      = "app:*"
	ConfigKey_AppGlobalHotkey               = "app:globalhotkey"
	ConfigKey_AppDismissArchitectureWarning = "app:dismissarchitecturewarning"

	ConfigKey_AiClear         = "ai:*"
	ConfigKey_AiPreset        = "ai:preset"
	ConfigKey_AiApiType       = "ai:apitype"
	ConfigKey_AiBaseURL       = "ai:baseurl"
	ConfigKey_AiApiToken      = "ai:apitoken"
	ConfigKey_AiName          = "ai:name"
	ConfigKey_AiModel         = "ai:model"
	ConfigKey_AiOrgID         = "ai:orgid"
	ConfigKey_AIApiVersion    = "ai:apiversion"
	ConfigKey_AiMaxTokens     = "ai:maxtokens"
	ConfigKey_AiTimeoutMs     = "ai:timeoutms"
	ConfigKey_AiFontSize      = "ai:fontsize"
	ConfigKey_AiFixedFontSize = "ai:fixedfontsize"

	ConfigKey_TermClear          = "term:*"
	ConfigKey_TermFontSize       = "term:fontsize"
	ConfigKey_TermFontFamily     = "term:fontfamily"
	ConfigKey_TermTheme          = "term:theme"
	ConfigKey_TermDisableWebGl   = "term:disablewebgl"
	ConfigKey_TermLocalShellPath = "term:localshellpath"
	ConfigKey_TermLocalShellOpts = "term:localshellopts"
	ConfigKey_TermScrollback     = "term:scrollback"
	ConfigKey_TermCopyOnSelect   = "term:copyonselect"
	ConfigKey_TermTransparency   = "term:transparency"

	ConfigKey_EditorMinimapEnabled      = "editor:minimapenabled"
	ConfigKey_EditorStickyScrollEnabled = "editor:stickyscrollenabled"
	ConfigKey_EditorWordWrap            = "editor:wordwrap"
	ConfigKey_EditorFontSize            = "editor:fontsize"

	ConfigKey_WebClear               = "web:*"
	ConfigKey_WebOpenLinksInternally = "web:openlinksinternally"
	ConfigKey_WebDefaultUrl          = "web:defaulturl"
	ConfigKey_WebDefaultSearch       = "web:defaultsearch"

	ConfigKey_BlockHeaderClear        = "blockheader:*"
	ConfigKey_BlockHeaderShowBlockIds = "blockheader:showblockids"

	ConfigKey_AutoUpdateClear         = "autoupdate:*"
	ConfigKey_AutoUpdateEnabled       = "autoupdate:enabled"
	ConfigKey_AutoUpdateIntervalMs    = "autoupdate:intervalms"
	ConfigKey_AutoUpdateInstallOnQuit = "autoupdate:installonquit"
	ConfigKey_AutoUpdateChannel       = "autoupdate:channel"

	ConfigKey_MarkdownFontSize      = "markdown:fontsize"
	ConfigKey_MarkdownFixedFontSize = "markdown:fixedfontsize"

	ConfigKey_PreviewShowHiddenFiles = "preview:showhiddenfiles"

	ConfigKey_TabPreset = "tab:preset"

	ConfigKey_WidgetClear    = "widget:*"
	ConfigKey_WidgetShowHelp = "widget:showhelp"

	ConfigKey_WindowClear                         = "window:*"
	ConfigKey_WindowTransparent                   = "window:transparent"
	ConfigKey_WindowBlur                          = "window:blur"
	ConfigKey_WindowOpacity                       = "window:opacity"
	ConfigKey_WindowBgColor                       = "window:bgcolor"
	ConfigKey_WindowReducedMotion                 = "window:reducedmotion"
	ConfigKey_WindowTileGapSize                   = "window:tilegapsize"
	ConfigKey_WindowShowMenuBar                   = "window:showmenubar"
	ConfigKey_WindowNativeTitleBar                = "window:nativetitlebar"
	ConfigKey_WindowDisableHardwareAcceleration   = "window:disablehardwareacceleration"
	ConfigKey_WindowMaxTabCacheSize               = "window:maxtabcachesize"
	ConfigKey_WindowMagnifiedBlockOpacity         = "window:magnifiedblockopacity"
	ConfigKey_WindowMagnifiedBlockSize            = "window:magnifiedblocksize"
	ConfigKey_WindowMagnifiedBlockBlurPrimaryPx   = "window:magnifiedblockblurprimarypx"
	ConfigKey_WindowMagnifiedBlockBlurSecondaryPx = "window:magnifiedblockblursecondarypx"
	ConfigKey_WindowConfirmClose                  = "window:confirmclose"
	ConfigKey_WindowSaveLastWindow                = "window:savelastwindow"

	ConfigKey_TelemetryClear   = "telemetry:*"
	ConfigKey_TelemetryEnabled = "telemetry:enabled"

	ConfigKey_ConnClear               = "conn:*"
	ConfigKey_ConnAskBeforeWshInstall = "conn:askbeforewshinstall"
	ConfigKey_ConnWshEnabled          = "conn:wshenabled"
)
View Source
const AnySchema = `
{
  "type": "object",
  "additionalProperties": true
}
`
View Source
const ConnectionsFile = "connections.json"
View Source
const SettingsFile = "settings.json"

Variables

This section is empty.

Functions

func GetConfigSubdirs added in v0.9.0

func GetConfigSubdirs() []string

func SetBaseConfigValue

func SetBaseConfigValue(toMerge waveobj.MetaMapType) error

func SetConnectionsConfigValue added in v0.10.0

func SetConnectionsConfigValue(connName string, toMerge waveobj.MetaMapType) error

func SortFileNameDescend added in v0.9.0

func SortFileNameDescend(files []fs.DirEntry)

func WriteWaveHomeConfigFile

func WriteWaveHomeConfigFile(fileName string, m waveobj.MetaMapType) error

Types

type ConfigError

type ConfigError struct {
	File string `json:"file"`
	Err  string `json:"err"`
}

func ReadDefaultsConfigFile

func ReadDefaultsConfigFile(fileName string) (waveobj.MetaMapType, []ConfigError)

func ReadWaveHomeConfigFile

func ReadWaveHomeConfigFile(fileName string) (waveobj.MetaMapType, []ConfigError)

type FullConfigType

type FullConfigType struct {
	Settings       SettingsType                   `json:"settings" merge:"meta"`
	MimeTypes      map[string]MimeTypeConfigType  `json:"mimetypes"`
	DefaultWidgets map[string]WidgetConfigType    `json:"defaultwidgets"`
	Widgets        map[string]WidgetConfigType    `json:"widgets"`
	Presets        map[string]waveobj.MetaMapType `json:"presets"`
	TermThemes     map[string]TermThemeType       `json:"termthemes"`
	Connections    map[string]wshrpc.ConnKeywords `json:"connections"`
	ConfigErrors   []ConfigError                  `json:"configerrors" configfile:"-"`
}

func ReadFullConfig

func ReadFullConfig() FullConfigType

type MimeTypeConfigType

type MimeTypeConfigType struct {
	Icon  string `json:"icon"`
	Color string `json:"color"`
}

type SettingsType

type SettingsType struct {
	AppClear                      bool   `json:"app:*,omitempty"`
	AppGlobalHotkey               string `json:"app:globalhotkey,omitempty"`
	AppDismissArchitectureWarning bool   `json:"app:dismissarchitecturewarning,omitempty"`

	AiClear         bool    `json:"ai:*,omitempty"`
	AiPreset        string  `json:"ai:preset,omitempty"`
	AiApiType       string  `json:"ai:apitype,omitempty"`
	AiBaseURL       string  `json:"ai:baseurl,omitempty"`
	AiApiToken      string  `json:"ai:apitoken,omitempty"`
	AiName          string  `json:"ai:name,omitempty"`
	AiModel         string  `json:"ai:model,omitempty"`
	AiOrgID         string  `json:"ai:orgid,omitempty"`
	AIApiVersion    string  `json:"ai:apiversion,omitempty"`
	AiMaxTokens     float64 `json:"ai:maxtokens,omitempty"`
	AiTimeoutMs     float64 `json:"ai:timeoutms,omitempty"`
	AiFontSize      float64 `json:"ai:fontsize,omitempty"`
	AiFixedFontSize float64 `json:"ai:fixedfontsize,omitempty"`

	TermClear          bool     `json:"term:*,omitempty"`
	TermFontSize       float64  `json:"term:fontsize,omitempty"`
	TermFontFamily     string   `json:"term:fontfamily,omitempty"`
	TermTheme          string   `json:"term:theme,omitempty"`
	TermDisableWebGl   bool     `json:"term:disablewebgl,omitempty"`
	TermLocalShellPath string   `json:"term:localshellpath,omitempty"`
	TermLocalShellOpts []string `json:"term:localshellopts,omitempty"`
	TermScrollback     *int64   `json:"term:scrollback,omitempty"`
	TermCopyOnSelect   *bool    `json:"term:copyonselect,omitempty"`
	TermTransparency   *float64 `json:"term:transparency,omitempty"`

	EditorMinimapEnabled      bool    `json:"editor:minimapenabled,omitempty"`
	EditorStickyScrollEnabled bool    `json:"editor:stickyscrollenabled,omitempty"`
	EditorWordWrap            bool    `json:"editor:wordwrap,omitempty"`
	EditorFontSize            float64 `json:"editor:fontsize,omitempty"`

	WebClear               bool   `json:"web:*,omitempty"`
	WebOpenLinksInternally bool   `json:"web:openlinksinternally,omitempty"`
	WebDefaultUrl          string `json:"web:defaulturl,omitempty"`
	WebDefaultSearch       string `json:"web:defaultsearch,omitempty"`

	BlockHeaderClear        bool `json:"blockheader:*,omitempty"`
	BlockHeaderShowBlockIds bool `json:"blockheader:showblockids,omitempty"`

	AutoUpdateClear         bool    `json:"autoupdate:*,omitempty"`
	AutoUpdateEnabled       bool    `json:"autoupdate:enabled,omitempty"`
	AutoUpdateIntervalMs    float64 `json:"autoupdate:intervalms,omitempty"`
	AutoUpdateInstallOnQuit bool    `json:"autoupdate:installonquit,omitempty"`
	AutoUpdateChannel       string  `json:"autoupdate:channel,omitempty"`

	MarkdownFontSize      float64 `json:"markdown:fontsize,omitempty"`
	MarkdownFixedFontSize float64 `json:"markdown:fixedfontsize,omitempty"`

	PreviewShowHiddenFiles *bool `json:"preview:showhiddenfiles,omitempty"`

	TabPreset string `json:"tab:preset,omitempty"`

	WidgetClear    bool  `json:"widget:*,omitempty"`
	WidgetShowHelp *bool `json:"widget:showhelp,omitempty"`

	WindowClear                         bool     `json:"window:*,omitempty"`
	WindowTransparent                   bool     `json:"window:transparent,omitempty"`
	WindowBlur                          bool     `json:"window:blur,omitempty"`
	WindowOpacity                       *float64 `json:"window:opacity,omitempty"`
	WindowBgColor                       string   `json:"window:bgcolor,omitempty"`
	WindowReducedMotion                 bool     `json:"window:reducedmotion,omitempty"`
	WindowTileGapSize                   *int64   `json:"window:tilegapsize,omitempty"`
	WindowShowMenuBar                   bool     `json:"window:showmenubar,omitempty"`
	WindowNativeTitleBar                bool     `json:"window:nativetitlebar,omitempty"`
	WindowDisableHardwareAcceleration   bool     `json:"window:disablehardwareacceleration,omitempty"`
	WindowMaxTabCacheSize               int      `json:"window:maxtabcachesize,omitempty"`
	WindowMagnifiedBlockOpacity         *float64 `json:"window:magnifiedblockopacity,omitempty"`
	WindowMagnifiedBlockSize            *float64 `json:"window:magnifiedblocksize,omitempty"`
	WindowMagnifiedBlockBlurPrimaryPx   *int64   `json:"window:magnifiedblockblurprimarypx,omitempty"`
	WindowMagnifiedBlockBlurSecondaryPx *int64   `json:"window:magnifiedblockblursecondarypx,omitempty"`
	WindowConfirmClose                  bool     `json:"window:confirmclose,omitempty"`
	WindowSaveLastWindow                bool     `json:"window:savelastwindow,omitempty"`

	TelemetryClear   bool `json:"telemetry:*,omitempty"`
	TelemetryEnabled bool `json:"telemetry:enabled,omitempty"`

	ConnClear               bool `json:"conn:*,omitempty"`
	ConnAskBeforeWshInstall bool `json:"conn:askbeforewshinstall,omitempty"`
	ConnWshEnabled          bool `json:"conn:wshenabled,omitempty"`
}

type TermThemeType

type TermThemeType struct {
	DisplayName         string  `json:"display:name"`
	DisplayOrder        float64 `json:"display:order"`
	Black               string  `json:"black"`
	Red                 string  `json:"red"`
	Green               string  `json:"green"`
	Yellow              string  `json:"yellow"`
	Blue                string  `json:"blue"`
	Magenta             string  `json:"magenta"`
	Cyan                string  `json:"cyan"`
	White               string  `json:"white"`
	BrightBlack         string  `json:"brightBlack"`
	BrightRed           string  `json:"brightRed"`
	BrightGreen         string  `json:"brightGreen"`
	BrightYellow        string  `json:"brightYellow"`
	BrightBlue          string  `json:"brightBlue"`
	BrightMagenta       string  `json:"brightMagenta"`
	BrightCyan          string  `json:"brightCyan"`
	BrightWhite         string  `json:"brightWhite"`
	Gray                string  `json:"gray"`
	CmdText             string  `json:"cmdtext"`
	Foreground          string  `json:"foreground"`
	SelectionBackground string  `json:"selectionBackground"`
	Background          string  `json:"background"`
	Cursor              string  `json:"cursor"`
}

type Watcher

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

func GetWatcher

func GetWatcher() *Watcher

GetWatcher returns the singleton instance of the Watcher

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) GetFullConfig

func (w *Watcher) GetFullConfig() FullConfigType

func (*Watcher) Start

func (w *Watcher) Start()

type WatcherUpdate

type WatcherUpdate struct {
	FullConfig FullConfigType `json:"fullconfig"`
}

type WidgetConfigType

type WidgetConfigType struct {
	DisplayOrder float64          `json:"display:order,omitempty"`
	Icon         string           `json:"icon,omitempty"`
	Color        string           `json:"color,omitempty"`
	Label        string           `json:"label,omitempty"`
	Description  string           `json:"description,omitempty"`
	BlockDef     waveobj.BlockDef `json:"blockdef"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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