useraccount

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package useraccount describes a user account the way the desktop shows it: login name, real name, home, and avatar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAvatar

func FindAvatar(name, home string) string

FindAvatar is the first readable avatar for a login: the AccountsService icon, then ~/.face.

Types

type Account

type Account struct {
	// Name is the login name; RealName the GECOS full name, else Name.
	Name, RealName string
	Home           string
	// Avatar is a readable avatar path, "" when none.
	Avatar string
}

Account is one user account.

func Current

func Current() (Account, error)

Current is the account the process runs as, from its passwd entry by uid, so an empty or spoofed $USER changes nothing. An account the passwd file does not list (userdb, LDAP) falls back to what the environment says, with a warning.

Jump to

Keyboard shortcuts

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