sysdep

package
v0.0.0-...-5f18fe2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SysEventShutdown = iota
	SysEventIpAddrChanged
)

Variables

View Source
var (
	ErrLockIsBusy = errors.New("Lock is busy")
)

Functions

func CreateDesktopShortcut

func CreateDesktopShortcut(
	outpath,
	exepath,
	args,
	iconpath,
	name,
	comment string,
	startup bool) error

Create desktop shortcut

Parameters are:

outpath   Output path
exepath   Path to executable file
args      Arguments
iconpath  Path to icon file
name      Program name
comment   Comment
startup   Startup or desktop shortcut

func FileLock

func FileLock(file *os.File, exclusive, wait bool) error

Lock the file

func FileUnlock

func FileUnlock(file *os.File) error

Unlock the file

func IconExt

func IconExt() string

Get icon file extension

func OpenURL

func OpenURL(url string) error

Open URL in a browser

func ProcAttrBackground

func ProcAttrBackground() *os.ProcAttr

Create os.ProcAttr to run process in background

func StdRedirect

func StdRedirect(stdin, stdout, stderr uintptr) error

Redirect stdin/stdout/stderr

func SysConfDir

func SysConfDir(program string) string

Get system configuration directory for the program

func UserConfDir

func UserConfDir(program string) string

Get user configuration directory for the program

func UserDesktopDir

func UserDesktopDir() string

Get user desktop directory

func UserDesktopFile

func UserDesktopFile(program, iconname string) string

Get user desktop file for the program

func UserHomeDir

func UserHomeDir() string

Get user home directory

func UserStartupDir

func UserStartupDir() string

Get user startup (autostart) directory

func UserStartupFile

func UserStartupFile(program, iconname string) string

Get user startup file for the program

Types

type SysEvent

type SysEvent int

System events

type SysEventNotifier

type SysEventNotifier struct {
	// contains filtered or unexported fields
}

System events notifier

func NewSysEventNotifier

func NewSysEventNotifier(callback func(SysEvent)) *SysEventNotifier

Create new SysEventNotifier

Jump to

Keyboard shortcuts

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