Documentation
¶
Overview ¶
Package shell opens files, folders and URLs in the system's apps.
Index ¶
- Variables
- func OpenDownloads(ctx context.Context, h platform.Host, folder string) error
- func OpenFolder(ctx context.Context, h platform.Host, path string) error
- func OpenURL(ctx context.Context, h platform.Host, u string) error
- func OpenWith(ctx context.Context, h platform.Host, path, mime string) error
- func Reveal(path string) error
- func SaveToDownloads(ctx context.Context, path, mime, folder string) (string, error)
- func ShareFiles(ctx context.Context, h platform.Host, files []File, mime, title string) error
- func ShareText(ctx context.Context, h platform.Host, text, subject, title string) error
- type File
Constants ¶
This section is empty.
Variables ¶
ErrNoShareSheet is ShareText's answer on a desktop without a share sheet: the caller copies the text to the clipboard instead.
Functions ¶
func OpenDownloads ¶
OpenDownloads opens Downloads/<folder>, or Downloads.
func OpenFolder ¶
OpenFolder opens a folder in Explorer, Finder or the file manager.
func OpenWith ¶
OpenWith asks the XDG desktop portal's OpenURI to open the file, as Flatpak and Snap apps must and desktops otherwise do: its default app, or the portal's app chooser. Without a portal it runs xdg-open.
func Reveal ¶
Reveal asks the file manager to show path selected, through the freedesktop FileManager1 D-Bus interface, and falls back to opening its folder with xdg-open.
func SaveToDownloads ¶
SaveToDownloads copies the file into Downloads/<folder>.
func ShareFiles ¶
ShareFiles opens the share sheet for the first file, else shows it in the file manager.