utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectPackageManager

func DetectPackageManager() (string, error)

Detect package manager

func GetBinPath

func GetBinPath() (string, error)

func GetDataFromMetadata

func GetDataFromMetadata(key string) (string, error)

Get metadata from metadata.json

func GetDevDest

func GetDevDest() (string, error)

Get development destination path

func InstallPackage

func InstallPackage(pm, binName string, pkgNames map[string]string) error

func InstallPlasmoidPreview

func InstallPlasmoidPreview(pm string) error

func InstallQmlformat

func InstallQmlformat(pm string) error

func IsInstalled

func IsInstalled() (bool, string, error)

Check if plasmoid is installed

func IsLinked

func IsLinked() bool

check if plasmoid is linked

func IsPackageInstalled

func IsPackageInstalled(name string) bool

Check if package is installed

func IsValidPlasmoid

func IsValidPlasmoid() bool

func LoadConfigRC

func LoadConfigRC() (types.Config, error)

func UpdateMetadata

func UpdateMetadata(key string, value interface{}, sectionOpt ...string) error

UpdateMetadata updates a key in the metadata.json file.

Parameters:

  • key: The key inside the section to update or create.
  • value: The new value to assign to the key.
  • section: The top-level section in metadata.json where the key is located. By default, this is "KPlugin", which is the standard location for Plasmoid metadata. If you're updating a key at the root level of the JSON, pass "." as the section.

Behavior:

  • If the section does not exist, it will be created automatically.
  • If the file cannot be read or parsed, a descriptive error will be returned.
  • The resulting JSON will be indented for readability.

Types

This section is empty.

Jump to

Keyboard shortcuts

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