dock

package
v0.0.0-...-050b588 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package dock provides functions for manipulating the macOS dock

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileData

type FileData struct {
	URLString     string `plist:"_CFURLString"`
	URLStringType int    `plist:"_CFURLStringType"`
}

FileData is a tile-data file-data object

type PAItem

type PAItem struct {
	GUID     int      `plist:"GUID,omitempty"`
	TileType string   `plist:"tile-type"`
	TileData TileData `plist:"tile-data"`
}

PAItem is a dock plist persistent-apps item object

type POItem

type POItem struct {
	GUID     int        `plist:"GUID"`
	TileType string     `plist:"tile-type"`
	TileData POTileData `plist:"tile-data"`
}

POItem is a dock plist persistent-others item object

type POTileData

type POTileData struct {
	Arrangement       int      `plist:"arrangement"`
	DisplayAs         int      `plist:"displayas"`
	ShowAs            int      `plist:"showas"`
	FileData          FileData `plist:"file-data"`
	FileLabel         string   `plist:"file-label"`
	FileType          int      `plist:"file-type"`
	FileModDate       int64    `plist:"file-mod-date,omitempty"`
	IsBeta            bool     `plist:"is-beta,omitempty"`
	ParentModDate     int64    `plist:"parent-mod-date,omitempty"`
	PreferredItemSize int      `plist:"preferreditemsize,omitempty"`
	Book              []byte   `plist:"book,omitempty"`
	Directory         int      `plist:"directory,omitempty"`
}

POTileData is a persistent-others item title-data object

func (POTileData) GetPath

func (d POTileData) GetPath() string

type Plist

type Plist struct {
	PersistentApps              []PAItem `plist:"persistent-apps"`
	PersistentOthers            []POItem `plist:"persistent-others"`
	AutoHide                    bool     `plist:"autohide"`
	LargeSize                   any      `plist:"largesize,omitempty"`
	Loc                         string   `plist:"loc"`
	Magnification               bool     `plist:"magnification"`
	MinimizeToApplication       bool     `plist:"minimize-to-application"`
	LastMessagetraceStamp       float64  `plist:"last-messagetrace-stamp"`
	LastShowIndicatorTime       float64  `plist:"lastShowIndicatorTime"`
	ModCount                    int      `plist:"mod-count"`
	MruSpaces                   bool     `plist:"mru-spaces"`
	Orientation                 string   `plist:"orientation"`
	RecentApps                  []any    `plist:"recent-apps"`
	Region                      string   `plist:"region"`
	ShowRecents                 bool     `plist:"show-recents"`
	ShowAppExposeGestureEnabled bool     `plist:"showAppExposeGestureEnabled"`
	TileSize                    any      `plist:"tilesize,omitempty"`
	TrashFull                   bool     `plist:"trash-full"`
	Version                     int      `plist:"version"`
	WvousBlCorner               int      `plist:"wvous-bl-corner,omitempty"`
	WvousBlModifier             int      `plist:"wvous-bl-modifier,omitempty"`
	WvousTlCorner               int      `plist:"wvous-tl-corner,omitempty"`
	WvousTlModifier             int      `plist:"wvous-tl-modifier,omitempty"`
	WvousTrCorner               int      `plist:"wvous-tr-corner,omitempty"`
	WvousTrModifier             int      `plist:"wvous-tr-modifier,omitempty"`
}

Plist is a dock plist object

func LoadDockPlist

func LoadDockPlist(path ...string) (*Plist, error)

LoadDockPlist loads the dock plist into struct

func (*Plist) AddApp

func (p *Plist) AddApp(appPath string) error

AddApp adds an app to the dock plist

func (*Plist) AddOther

func (p *Plist) AddOther(other database.Folder) error

AddOther adds an other to the dock plist

func (*Plist) ApplySettings

func (p *Plist) ApplySettings(setting database.DockSettings) error

ApplySettings applies the dock settings to the plist

func (*Plist) AsJSON

func (p *Plist) AsJSON() ([]byte, error)

func (*Plist) Save

func (p *Plist) Save() error

Save saves the dock plist from struct

type TileData

type TileData struct {
	BundleIdentifier string   `plist:"bundle-identifier,omitempty"`
	Book             []byte   `plist:"book,omitempty"`
	DockExtra        bool     `plist:"dock-extra,omitempty"`
	FileData         FileData `plist:"file-data"`
	FileLabel        string   `plist:"file-label"`
	FileModDate      int64    `plist:"file-mod-date,omitempty"`
	FileType         int      `plist:"file-type"`
	IsBeta           bool     `plist:"is-beta,omitempty"`
	ParentModDate    int64    `plist:"parent-mod-date,omitempty"`
}

TileData is a item title-data object

func (TileData) GetPath

func (d TileData) GetPath() string

Jump to

Keyboard shortcuts

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