macutils

package module
v0.0.0-...-b686f30 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

README

This contains utilities used by the onsite kiosks used at Google I/O in 2018 and earlier (used at all I/O events hosted at Shorline).

You probably don't need this code.

Documentation

Index

Constants

View Source
const (
	KeyEject = 0x92 // TODO(samthor): doesn't seem to work
	KeyF12   = 0x6F
	KeyF13   = 0x69
)

Variables

View Source
var (
	// ErrNoSyscallStat is an internal error that a syscall is not available.
	ErrNoSyscallStat = errors.New("no syscall.Stat_t available")

	// ErrInvalidUser indicates that the user could not be determined.
	ErrInvalidUser = errors.New("couldn't get username")
)

Functions

func ListenForKey

func ListenForKey(key int) (chan int, error)

ListenForKey listens globally for the specified keycode.

Types

type Login

type Login struct {
	User user.User
	When time.Time
}

Login describes a logged-in user on macOS, and when they logged in.

func CurrentLogin

func CurrentLogin() (lu Login, err error)

CurrentLogin returns the current logged-in user on macOS.

type LoginWatcher

type LoginWatcher struct {
	Change chan Login // listen for logins and changems
	Errors chan error // listen for errors
	// contains filtered or unexported fields
}

LoginWatcher watches for login change events.

func SubscribeLogin

func SubscribeLogin() (*LoginWatcher, error)

SubscribeLogin subscribes to login change events and returns a LoginWatcher.

func (*LoginWatcher) Close

func (lw *LoginWatcher) Close()

Close stops watching for login changes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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