settings

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package settings stores Seaglass's preferences in %APPDATA%\Seaglass\settings.json.

Index

Constants

This section is empty.

Variables

View Source
var Sources = map[string]bool{
	"steam": true, "epic": true, "gog": true, "ea": true, "ubisoft": true, "battlenet": true, "xbox": true,
	"external": true, "standalone": true, "folder": true,
}

Sources are the libraries that can be hidden, as the interface groups games: by store, then external copies, standalone installs and folders.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath is %APPDATA%\Seaglass\settings.json.

Types

type Portable added in v1.8.0

type Portable struct {
	DetectExternal         bool     `json:"detectExternal"`
	ReviewUncertain        bool     `json:"reviewUncertain"`
	ShowNotInstalled       bool     `json:"showNotInstalled"`
	ShowOwned              bool     `json:"showOwned"`
	HiddenSources          []string `json:"hiddenSources"`
	Theme                  string   `json:"theme"`
	BigPictureLayout       string   `json:"bigPictureLayout"`
	Sounds                 bool     `json:"sounds"`
	Haptics                bool     `json:"haptics"`
	Lightbar               bool     `json:"lightbar"`
	PSButton               bool     `json:"psButton"`
	Glyphs                 string   `json:"glyphs"`
	CloseWhilePlaying      bool     `json:"closeWhilePlaying"`
	PadWhilePlaying        string   `json:"padWhilePlaying"`
	NoticeExternal         bool     `json:"noticeExternal"`
	SyncSavesBefore        bool     `json:"syncSavesBefore"`
	BackupSavesAfter       bool     `json:"backupSavesAfter"`
	SyncWait               int      `json:"syncWait"`
	Achievements           bool     `json:"achievements"`
	ShowHiddenAchievements bool     `json:"showHiddenAchievements"`
	AutoUpdate             bool     `json:"autoUpdate"`
}

Portable are the settings that go with a person to their other PCs. What depends on the PC stays: its game folders and stores, whether it starts in big picture (a TV, not a desk), whether it asks who's playing (a PC several people share), and the welcome.

type Settings

type Settings struct {
	// Library
	Folders          []string `json:"folders"`          // extra folders whose subfolders are games
	AutoFolders      bool     `json:"autoFolders"`      // also look in common game folders on every drive
	DetectExternal   bool     `json:"detectExternal"`   // recognise games on Steam API emulators and from repacks
	ReviewUncertain  bool     `json:"reviewUncertain"`  // keep low-confidence matches in New on this PC for a check
	ShowNotInstalled bool     `json:"showNotInstalled"` // list games that aren't installed (anymore)
	ShowOwned        bool     `json:"showOwned"`        // list games connected store accounts own but aren't installed
	OwnedGOG         bool     `json:"ownedGOG"`         // read GOG Galaxy's library for owned games
	HiddenSources    []string `json:"hiddenSources"`    // libraries whose games aren't shown (steam, epic, …, external, folder)

	// Appearance
	Theme            string `json:"theme"`            // system, dark, light (desktop mode)
	BigPictureLayout string `json:"bigPictureLayout"` // deck, console, orbit

	// Big picture and controller
	OpenBigPictureOnController bool   `json:"openBigPictureOnController"`
	StartInBigPicture          bool   `json:"startInBigPicture"`
	Sounds                     bool   `json:"sounds"`
	Haptics                    bool   `json:"haptics"`
	Lightbar                   bool   `json:"lightbar"`
	PSButton                   bool   `json:"psButton"`
	Glyphs                     string `json:"glyphs"` // auto, playstation, xbox

	// While playing
	CloseWhilePlaying bool   `json:"closeWhilePlaying"` // close the interface while a game runs (frees its memory)
	PadWhilePlaying   string `json:"padWhilePlaying"`   // listen (PS button opens the overlay), off (release the controller)
	NoticeExternal    bool   `json:"noticeExternal"`    // follow games started outside Seaglass (playtime, controller)

	// Saves, through Syncer
	SyncSavesBefore  bool `json:"syncSavesBefore"`  // sync a game's saves before it starts
	BackupSavesAfter bool `json:"backupSavesAfter"` // back its saves up after it exits
	SyncWait         int  `json:"syncWait"`         // seconds to wait for a sync before playing
	StartSyncer      bool `json:"startSyncer"`      // start Syncer (without its window) when it isn't running
	SyncProfile      bool `json:"syncProfile"`      // Syncer syncs playtime, achievements and settings between PCs
	SameSettings     bool `json:"sameSettings"`     // take the settings saved last on another PC (see Portable)
	AskWhoPlays      bool `json:"askWhoPlays"`      // with several Syncer accounts, ask who's playing before a game starts

	// Achievements
	Achievements           bool `json:"achievements"`           // show achievements (read from stores and emulator files)
	ShowHiddenAchievements bool `json:"showHiddenAchievements"` // show hidden achievements before they're unlocked (spoilers)

	// Updates
	AutoUpdate bool `json:"autoUpdate"` // check GitHub for new versions and install them on the next start or while idle in the tray

	// Welcomed: the first-start welcome was seen (or skipped).
	Welcomed bool `json:"welcomed"`
}

Settings are the user's preferences. New fields get their default when an older settings file doesn't have them.

func Defaults

func Defaults() Settings

Defaults are the settings on first start.

func (Settings) Portable added in v1.8.0

func (v Settings) Portable() Portable

Portable returns the settings that go with a person.

func (Settings) WithPortable added in v1.8.0

func (v Settings) WithPortable(b []byte) (Settings, error)

WithPortable returns v with another PC's portable settings, given as JSON. Settings the JSON doesn't have (an older Seaglass saved it) stay as they are.

type Store

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

Store loads and saves settings. Safe for concurrent use.

func Open

func Open(path string) *Store

Open reads the settings file (defaults when missing). A damaged file (cut short by a power cut) is set aside and the copy from the last good start is used, so the folders and choices aren't lost to defaults.

func (*Store) Get

func (s *Store) Get() Settings

Get returns the current settings.

func (*Store) Set

func (s *Store) Set(v Settings) (Settings, error)

Set validates, stores and saves new settings, returning what was saved.

Jump to

Keyboard shortcuts

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