mime

package
v0.0.0-...-dddda54 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: GPL-3.0 Imports: 6 Imported by: 10

Documentation

Index

Constants

View Source
const (
	MimeTypeGtk    = "application/x-gtk-theme"
	MimeTypeIcon   = "application/x-icon-theme"
	MimeTypeCursor = "application/x-cursor-theme"

	MimeUserConfig = ".config/mimeapps.list"
)

Variables

This section is empty.

Functions

func GetAppList

func GetAppList(mime string) []string

Get app list of supported the 'mime' ret0: desktopId list

func GetDefaultApp

func GetDefaultApp(mime string, mustSupportURIs bool) (string, error)

Get default app for 'mime' gio.AppInfoGetDefaultForType can get default from ~/.config/mimeapps.list , /usr/share/applications/mimeinfo.cache , /usr/share/applications/mimeapps.list ret0: desktopId

func GetUserDefaultApp

func GetUserDefaultApp(ty string) string

get default from ~/.config/mimeapps.list

func Query

func Query(uri string) (string, error)

Query query file mime type

func SetDefaultApp

func SetDefaultApp(mime, desktopId string) error

Set 'mime' default app to 'desktopId'

desktopId: the basename of the desktop file

Types

This section is empty.

Jump to

Keyboard shortcuts

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