settings

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: AGPL-3.0 Imports: 7 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,
	"unofficial": true, "standalone": true, "folder": true,
}

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

Functions

func DefaultPath

func DefaultPath() string

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

Types

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
	DetectUnofficial bool     `json:"detectUnofficial"` // recognise Steam emulators, cracks and 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, …, unofficial, 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

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

	// 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.

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 or unreadable).

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