appdir

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Example
os.RemoveAll("tstad")
d := must.Ret(New("tstad", "Test"))
must.Do(d.MkDirs(BinDir, ShareDir))
must.Do(pack.CopyFile(d.In(BinDir, "hw"), "appdir", nil))
must.Do(pack.CopyToDir(d.In(ShareDir), nil, "icon.png"))
must.Do(d.SetAppRun("hw"))
must.Do(d.SetIcon("icon.png"))
must.Do(d.WriteDesktop(Desktop{
	Categories: []string{DskCatUtility},
}))
fmt.Println("done")
Output:

done

Index

Examples

Constants

View Source
const (
	AppRunName  = "AppRun"
	DirIconName = ".DirIcon"
	DesktopExt  = ".desktop"

	Root     Path = "."
	BinDir   Path = "usr/bin"
	LibDIr   Path = "usr/lib"
	ShareDir Path = "usr/share"
)
View Source
const (
	DskTypeApplication = "Application"
	DskTypeLink        = "Link"
	DskTypeDirectory   = "Directory"
)
View Source
const (
	DskCatAudioVideo  = "AudioVideo"
	DskCatAudio       = "Audio"
	DskCatVideo       = "Video"
	DskCatDevelopment = "Development"
	DskCatEducation   = "Education"
	DskCatGame        = "Game"
	DskCatGraphics    = "Graphics"
	DskCatNetwork     = "Network"
	DskCatOffice      = "Office"
	DskCatScience     = "Science"
	DskCatSettings    = "Settings"
	DskCatSystem      = "System"
	DskCatUtility     = "Utility"
)

https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry

Variables

This section is empty.

Functions

This section is empty.

Types

type D

type D struct {
	Dir     string
	AppName string
	// contains filtered or unexported fields
}

func New

func New(dir string, app string) (D, error)

func (D) In

func (d D) In(p Path, name ...string) string

func (D) MkDirs

func (d D) MkDirs(dirs ...any) error

func (D) SetAppRun

func (d D) SetAppRun(inBinDir string) error

func (*D) SetIcon

func (d *D) SetIcon(inShareDir string) error

func (D) WriteDesktop

func (d D) WriteDesktop(dsk Desktop) error

type Desktop

type Desktop struct {
	Type       DesktopType
	Name       string
	Categories []string
	// contains filtered or unexported fields
}

func (*Desktop) Write

func (dsk *Desktop) Write(w io.Writer) error

type DesktopType

type DesktopType string

type Path

type Path string

Jump to

Keyboard shortcuts

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