Documentation ¶
Overview ¶
Package database provides launchpad database functions
Index ¶
- Constants
- type App
- type AppFolder
- type Apps
- type Category
- type Config
- type DBInfo
- type Desktop
- type Dock
- type DockSettings
- type Folder
- type FolderDisplay
- type FolderPage
- type FolderSort
- type FolderView
- type Group
- type Item
- type LaunchPad
- func (lp *LaunchPad) AddRootsAndHoldingPages() error
- func (lp *LaunchPad) ApplyConfig(config Apps, groupID, rootParentID int) error
- func (lp *LaunchPad) ClearGroups() error
- func (lp *LaunchPad) DisableTriggers() error
- func (lp *LaunchPad) EnableTriggers() error
- func (lp *LaunchPad) FixOther() error
- func (lp *LaunchPad) FlattenApps() error
- func (lp *LaunchPad) GetMaxAppID() int
- func (lp *LaunchPad) GetMaxWidgetID() int
- func (lp *LaunchPad) GetMissing(apps *Apps, appType int) error
- func (lp *LaunchPad) TriggersDisabled() bool
- type Page
- type Widget
Constants ¶
const ( RootType FolderRootType PageType ApplicationType DownloadingAppType WidgetType )
Types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { ID int `gorm:"column:item_id;primary_key"` Title string `gorm:"column:title"` BundleID string `gorm:"column:bundleid"` StoreID string `gorm:"column:storeid;default:null"` CategoryID int `gorm:"column:category_id;default:null"` Category Category Moddate float64 `gorm:"column:moddate"` Bookmark []byte `gorm:"column:bookmark"` }
App CREATE TABLE apps (item_id INTEGER PRIMARY KEY, title VARCHAR, bundleid VARCHAR, storeid VARCHAR,category_id INTEGER, moddate REAL, bookmark BLOB)
type AppFolder ¶
type AppFolder struct { Name string `yaml:"folder" json:"folder,omitempty" mapstructure:"folder"` Pages []FolderPage `yaml:"pages,omitempty" json:"pages,omitempty"` }
AppFolder is a launchpad folder object
type Apps ¶
type Apps struct {
Pages []Page `yaml:"pages" json:"pages,omitempty"`
}
Apps is the launchpad apps config object
type Config ¶
type Config struct { Apps Apps `yaml:"apps" json:"apps,omitempty"` Widgets Apps `yaml:"widgets" json:"widgets,omitempty"` Dock Dock `yaml:"dock_items" json:"dock_items,omitempty" mapstructure:"dock_items"` Desktop Desktop `yaml:"desktop" json:"desktop,omitempty" mapstructure:"desktop"` }
Config is the Launchpad config
func LoadConfig ¶
LoadConfig loads the Launchpad config from the config file
func (Config) GetFolderContainingApp ¶
GetFolderContainingApp returns the folder name that contains the app
type Desktop ¶
type Desktop struct {
Image string `yaml:"image,omitempty" json:"image,omitempty"`
}
Desktop is the desktop object
type Dock ¶
type Dock struct { Apps []string `yaml:"apps,omitempty" json:"apps,omitempty"` Others []Folder `yaml:"others,omitempty" json:"others,omitempty"` Settings *DockSettings `yaml:"settings,omitempty" json:"settings,omitempty"` }
Dock is the launchpad dock config object
type DockSettings ¶
type DockSettings struct { AutoHide bool `yaml:"autohide" json:"autohide,omitempty"` LargeSize any `yaml:"largesize" json:"largesize,omitempty"` Magnification bool `yaml:"magnification" json:"magnification,omitempty"` MinimizeToApplication bool `yaml:"minimize-to-application" json:"minimize-to-application,omitempty"` MruSpaces bool `yaml:"mru-spaces" json:"mru-spaces,omitempty"` ShowRecents bool `yaml:"show-recents" json:"show-recents,omitempty"` TileSize any `yaml:"tilesize" json:"tilesize,omitempty"` }
DockSettings is the launchpad dock settings object
type Folder ¶
type Folder struct { Path string `yaml:"path,omitempty" json:"path,omitempty"` Display FolderDisplay `yaml:"display,omitempty" json:"display,omitempty"` View FolderView `yaml:"view,omitempty" json:"view,omitempty"` Sort FolderSort `yaml:"sort,omitempty" json:"sort,omitempty"` }
Folder is a launchpad folder object
type FolderDisplay ¶
type FolderDisplay int
type FolderPage ¶
type FolderPage struct { Number int `yaml:"number,omitempty" json:"number"` Items []string `yaml:"items,omitempty" json:"items,omitempty"` }
FolderPage is a launchpad folder page object
type FolderSort ¶
type FolderSort int
type FolderView ¶
type FolderView int
type Group ¶
type Group struct { ID int `gorm:"column:item_id;primary_key"` CategoryID int `gorm:"column:category_id;default:null"` Title string `gorm:"column:title;default:null"` }
Group CREATE TABLE groups (item_id INTEGER PRIMARY KEY, category_id INTEGER, title VARCHAR)
type Item ¶
type Item struct { ID int `gorm:"column:rowid;primary_key"` App App `gorm:"ForeignKey:ID"` Widget Widget `gorm:"ForeignKey:ID"` UUID string `gorm:"column:uuid"` Flags int `gorm:"column:flags;default:null"` Type int `gorm:"column:type"` Group Group `gorm:"ForeignKey:ID"` ParentID int `gorm:"not null;column:parent_id"` Ordering int `gorm:"column:ordering"` }
Item - CREATE TABLE items (rowid INTEGER PRIMARY KEY ASC, uuid VARCHAR, flags INTEGER, type INTEGER, parent_id INTEGER NOT NULL, ordering INTEGER)
type LaunchPad ¶
type LaunchPad struct { DB *gorm.DB File string Folder string Config Config // contains filtered or unexported fields }
LaunchPad is a LaunchPad struct
func (*LaunchPad) AddRootsAndHoldingPages ¶
AddRootsAndHoldingPages adds back in the RootPage and HoldingPage defaults
func (*LaunchPad) ApplyConfig ¶
func (*LaunchPad) ClearGroups ¶
ClearGroups clears out items related to groups
func (*LaunchPad) DisableTriggers ¶
DisableTriggers disables item update triggers
func (*LaunchPad) EnableTriggers ¶
EnableTriggers enables item update triggers
func (*LaunchPad) FlattenApps ¶
FlattenApps sets all the apps to the root page
func (*LaunchPad) GetMaxAppID ¶
GetMaxAppID returns the maximum App ItemID
func (*LaunchPad) GetMaxWidgetID ¶
GetMaxWidgetID returns the maximum Widget ItemID deprecated
func (*LaunchPad) GetMissing ¶
GetMissing returns a list of the rest of the apps not in the config
func (*LaunchPad) TriggersDisabled ¶
TriggersDisabled returns true if triggers are disabled
type Page ¶
type Page struct { Number int `yaml:"number" json:"number"` Items []any `yaml:"items,omitempty" json:"items,omitempty"` }
Page is a launchpad page object
type Widget ¶
type Widget struct { ID int `gorm:"column:item_id;primary_key"` Title string `gorm:"column:title"` BundleID string `gorm:"column:bundleid"` StoreID string `gorm:"column:storeid;default:null"` CategoryID int `gorm:"column:category_id;default:null"` Category Category Moddate float64 `gorm:"column:moddate"` Bookmark []byte `gorm:"column:bookmark"` }
Widget - CREATE TABLE widgets (item_id INTEGER PRIMARY KEY, title VARCHAR, bundleid VARCHAR, storeid VARCHAR,category_id INTEGER, moddate REAL, bookmark BLOB)