shortcut

package
v0.0.0-...-d3234e5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateAppID

func CalculateAppID(exe, name string) uint64

func CalculateBPMID

func CalculateBPMID(exe, name string) uint64

func DefaultShortcut

func DefaultShortcut(s *Shortcut)

DefaultShortcut sets the default settings of a shortcut

func Save

func Save(shortcuts *Shortcuts, file string) error

Save the given shortcuts file

Types

type Images

type Images struct {
	Portrait  string `json:"portrait"`
	Landscape string `json:"landscape"`
	Hero      string `json:"hero"`
	Icon      string `json:"icon"`
}

Images is a structure that holds the paths to grid images for a shortcut.

type Shortcut

type Shortcut struct {
	AllowDesktopConfig  int                    `json:"AllowDesktopConfig"`
	AllowOverlay        int                    `json:"AllowOverlay"`
	AppName             string                 `json:"AppName"`
	Devkit              int                    `json:"Devkit"`
	DevkitGameID        string                 `json:"DevkitGameID"`
	DevkitOverrideAppID int                    `json:"DevkitOverrideAppID"`
	Exe                 string                 `json:"Exe"`
	FlatpakAppID        string                 `json:"FlatpakAppID"`
	IsHidden            int                    `json:"IsHidden"`
	LastPlayTime        int                    `json:"LastPlayTime"`
	LaunchOptions       string                 `json:"LaunchOptions"`
	OpenVR              int                    `json:"OpenVR"`
	ShortcutPath        string                 `json:"ShortcutPath"`
	StartDir            string                 `json:"StartDir"`
	Appid               int64                  `json:"appid"`
	Icon                string                 `json:"icon"`
	Tags                map[string]interface{} `json:"tags"`
	Images              *Images                `json:"images,omitempty"`
}

Shortcut defines a single shortcut entry in the VDF file

func NewShortcut

func NewShortcut(name, exe string, settings ...ShortcutSetting) *Shortcut

NewShortcut will return a new Steam Shortcut

type ShortcutSetting

type ShortcutSetting func(s *Shortcut)

ShortcutSetting is a function that mutates a Shortcut

type Shortcuts

type Shortcuts struct {
	Shortcuts map[string]Shortcut `json:"shortcuts"`
}

func Load

func Load(file string) (*Shortcuts, error)

Load the given shortcuts file

func NewShortcuts

func NewShortcuts() *Shortcuts

func (*Shortcuts) Add

func (s *Shortcuts) Add(shortcut *Shortcut) error

Add will add the given shortcut

func (*Shortcuts) LookupByID

func (s *Shortcuts) LookupByID(appId int64) (*Shortcut, error)

LookupByID will return a shortcut by name

func (*Shortcuts) LookupByName

func (s *Shortcuts) LookupByName(name string) (*Shortcut, error)

LookupByName will return a shortcut by name

Jump to

Keyboard shortcuts

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