settings

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package settings manages global and per-key plugin settings.

Index

Constants

View Source
const DefaultRefreshMinutes = 15

Variables

View Source
var RefreshPresets = []int{5, 10, 15, 30, 60}

RefreshPresets are the allowed refresh intervals in minutes.

Functions

func InvertFillEnabled

func InvertFillEnabled() bool

InvertFillEnabled returns the global invert-fill toggle.

func ResolveRefreshMs

func ResolveRefreshMs(ks KeySettings) int64

ResolveRefreshMs returns the effective refresh interval in ms for a key.

func Set

func Set(gs GlobalSettings)

Set replaces the global settings, normalising values.

func ShowGlyphsEnabled

func ShowGlyphsEnabled() bool

ShowGlyphsEnabled returns the global show-glyphs toggle.

func SkipUpdateCheckEnabled

func SkipUpdateCheckEnabled() bool

SkipUpdateCheckEnabled returns the skip-update-check toggle.

Types

type ClaudeProviderSettings

type ClaudeProviderSettings struct {
	Source       ProviderSource `json:"source,omitempty"`
	CookieHeader string         `json:"cookieHeader,omitempty"`
}

ClaudeProviderSettings holds Claude-specific auth config.

func ClaudeSettings

func ClaudeSettings() ClaudeProviderSettings

ClaudeSettings returns Claude provider settings with defaults.

type CursorProviderSettings

type CursorProviderSettings struct {
	CookieHeader string `json:"cookieHeader,omitempty"`
}

CursorProviderSettings holds Cursor-specific auth config.

func CursorSettings

func CursorSettings() CursorProviderSettings

CursorSettings returns Cursor provider settings.

type GlobalSettings

type GlobalSettings struct {
	DefaultRefreshMinutes *int                 `json:"defaultRefreshMinutes,omitempty"`
	DefaultValueSize      TextSize             `json:"defaultValueSize,omitempty"`
	DefaultSubvalueSize   TextSize             `json:"defaultSubvalueSize,omitempty"`
	InvertFill            bool                 `json:"invertFill,omitempty"`
	ShowGlyphs            *bool                `json:"showGlyphs,omitempty"`
	SkipUpdateCheck       bool                 `json:"skipUpdateCheck,omitempty"`
	Providers             *ProviderSettingsMap `json:"providers,omitempty"`
}

GlobalSettings are shared across every key and persisted by Stream Deck (survive plugin rebuilds, ride with user profiles).

func Get

func Get() GlobalSettings

Get returns the current global settings.

type KeySettings

type KeySettings struct {
	// Provider is now derived from action UUID; this field is
	// kept for backwards compat but ignored.
	ProviderID      string   `json:"providerId,omitempty"`
	MetricID        string   `json:"metricId,omitempty"`
	RefreshMinutes  *int     `json:"refreshMinutes,omitempty"`
	WarnBelow       *float64 `json:"warnBelow,omitempty"`
	CriticalBelow   *float64 `json:"criticalBelow,omitempty"`
	WarnColor       string   `json:"warnColor,omitempty"`
	CriticalColor   string   `json:"criticalColor,omitempty"`
	LabelOverride   string   `json:"labelOverride,omitempty"`
	HideLabel       bool     `json:"hideLabel,omitempty"`
	CaptionOverride string   `json:"captionOverride,omitempty"`
	FillColor       string   `json:"fillColor,omitempty"`
	BgColor         string   `json:"bgColor,omitempty"`
	TextColor       string   `json:"textColor,omitempty"`
	FillDirection   string   `json:"fillDirection,omitempty"`
	ValueSize       TextSize `json:"valueSize,omitempty"`
	SubvalueSize    TextSize `json:"subvalueSize,omitempty"`
	ShowBorder      *bool    `json:"showBorder,omitempty"`
	ShowGlyph       *bool    `json:"showGlyph,omitempty"`
	ShowResetTimer  *bool    `json:"showResetTimer,omitempty"`
	ShowRawCounts   *bool    `json:"showRawCounts,omitempty"`
}

KeySettings are per-button settings stored by Stream Deck.

type OllamaProviderSettings added in v0.3.0

type OllamaProviderSettings struct {
	CookieHeader string `json:"cookieHeader,omitempty"`
}

OllamaProviderSettings holds Ollama-specific auth config.

func OllamaSettings added in v0.3.0

func OllamaSettings() OllamaProviderSettings

OllamaSettings returns Ollama provider settings.

type ProviderSettingsMap

type ProviderSettingsMap struct {
	Claude *ClaudeProviderSettings `json:"claude,omitempty"`
	Cursor *CursorProviderSettings `json:"cursor,omitempty"`
	Ollama *OllamaProviderSettings `json:"ollama,omitempty"`
}

ProviderSettingsMap holds per-provider config.

type ProviderSource

type ProviderSource string
const (
	SourceOAuth  ProviderSource = "oauth"
	SourceCookie ProviderSource = "cookie"
	SourceBoth   ProviderSource = "both"
)

type TextSize

type TextSize string
const (
	TextSmall  TextSize = "small"
	TextMedium TextSize = "medium"
	TextLarge  TextSize = "large"
)

func DefaultSubvalueSz

func DefaultSubvalueSz() TextSize

DefaultSubvalueSz returns the global default subvalue text size.

func DefaultValueSz

func DefaultValueSz() TextSize

DefaultValueSz returns the global default value text size.

Jump to

Keyboard shortcuts

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