org.freedesktop.Accounts.User

org.freedesktop.Accounts.User

User interface

# Methods

    SetUserName(in's'name)
    SetRealName(in's'name)
    SetEmail(in's'email)
    SetLanguage(in's'language)
    SetXSession(in's'x_session)
    SetLocation(in's'location)
    SetHomeDirectory(in's'homedir)
    SetShell(in's'shell)
    SetIconFile(in's'filename)
    SetLocked(in'b'locked)
    SetAccountType(in'i'accountType)
    SetPasswordMode(in'i'mode)
    SetPassword(in's'password,
    in's'hint)
    SetAutomaticLogin(in'b'enabled)

## Signals

    Changed()

## Implemented Interfaces

Objects implementing org.freedesktop.Accounts.User also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties

## Properties

    'Uid'read't'
    'UserName'read's'
    'RealName'read's'
    'AccountType'read'i'
    'HomeDirectory'read's'
    'Shell'read's'
    'Email'read's'
    'Language'read's'
    'XSession'read's'
    'Location'read's'
    'LoginFrequency'read't'
    'LoginTime'read'x'
    'LoginHistory'read'a(xxa{sv})'
    'IconFile'read's'
    'Locked'read'b'
    'PasswordMode'read'i'
    'PasswordHint'read's'
    'AutomaticLogin'read'b'
    'SystemAccount'read'b'
    'LocalAccount'read'b'

## Description

## Details

### SetUserName ()

    SetUserName (in's'name)

Sets the users username. Note that it is usually not allowed to have multiple users with the same username.

`name`:

- The new username.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.user-administration: To change the username of any user

### SetRealName ()

    SetRealName (in's'name)

Sets the users real name.

`name`:

- The new name, typically in the form "Firstname Lastname".

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.change-own-user-data: To change his own name

- org.freedesktop.accounts.user-administration: To change the name of another user

### SetEmail ()

    SetEmail (in's'email)

Sets the users email address.

Note that setting an email address in the AccountsService is not the same as configuring a mail client. Mail clients might default to email address that is configured here, though.

`email`:

- The new email address.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.change-own-user-data: To change his own email address

- org.freedesktop.accounts.user-administration: To change the email address of another user

### SetLanguage ()

    SetLanguage (in's'language)

Sets the users language.

The expectation is that display managers will start the users session with this locale.

`language`:

- The new language, as a locale specification like "de_DE.UTF-8".

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.change-own-user-data: To change his own language

- org.freedesktop.accounts.user-administration: To change the language of another user

### SetXSession ()

    SetXSession (in's'x_session)

Sets the users x session.

The expectation is that display managers will log the user in to this specified session, if available.

`x_session`:

- The new xsession to start (e.g. "gnome")

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.change-own-user-data: To change his own language

- org.freedesktop.accounts.user-administration: To change the language of another user

### SetLocation ()

    SetLocation (in's'location)

Sets the users location.

`location`:

- The new location as a freeform string.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.change-own-user-data: To change his own location

- org.freedesktop.accounts.user-administration: To change the location of another user

### SetHomeDirectory ()

    SetHomeDirectory (in's'homedir)

Sets the users home directory.

Note that changing the users home directory moves all the content from the old location to the new one, and is potentially an expensive operation.

`homedir`:

- The new homedir as an absolute path.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.user-administration: To change the home directory of a user

### SetShell ()

    SetShell (in's'shell)

Sets the users shell.

Note that setting the shell to a non-allowed program may prevent the user from logging in.

`shell`:

- The new user shell.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.user-administration: To change the shell of a user

### SetIconFile ()

    SetIconFile (in's'filename)

Sets the users icon.

`filename`:

- The absolute filename of a png file to use as the users icon.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.change-own-user-data: To change his own icon

- org.freedesktop.accounts.user-administration: To change the icon of another user

### SetLocked ()

    SetLocked (in'b'locked)

Locks or unlocks a users account.

Locking an account prevents the user from logging in.

`locked`:

- Whether to lock or unlock the users account.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.user-administration: To lock or unlock user accounts

### SetAccountType ()

    SetAccountType (in'i'accountType)

Changes the users account type.

`accountType`:

- The new account type, encoded as an integer:

  - 0: Standard user

  - 1: Administrator

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.user-administration: To change an account type

### SetPasswordMode ()

    SetPasswordMode (in'i'mode)

Changes the users password mode.

Note that changing the password mode has the side-effect of unlocking the account.

`mode`:

- The new password mode, encoded as an integer:

  - 0: Regular password

  - 1: Password must be set at next login

  - 2: No password

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.user-administration: To change a users password mode

### SetPassword ()

    SetPassword (in's'password,
    in's'hint)

Sets a new password for this user.

Note that setting a password has the side-effect of unlocking the account.

`password`:

- The crypted password.

`hint`:

- The password hint.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.user-administration: To change the password of a user

### SetAutomaticLogin ()

    SetAutomaticLogin (in'b'enabled)

Enables or disables automatic login for a user.

Note that usually only one user can have automatic login enabled, so turning it on for a user will disable it for the previously configured autologin user.

`enabled`:

- Whether to enable automatic login for this user.

#### Errors

`org.freedesktop.Accounts.Error.PermissionDenied`:

- if the caller lacks the appropriate PolicyKit authorization

`org.freedesktop.Accounts.Error.Failed`:

- if the operation failed

#### Permissions

The caller needs one of the following PolicyKit authorizations:

- org.freedesktop.accounts.set-login-option: To change the login screen configuration

## Signal Details

### The Changed signal

    Changed ()

Emitted when the user is changed.

## Property Details

### The "Uid" property

    'Uid'read't'

The uid of the user.

### The "UserName" property

    'UserName'read's'

The username of the user.

### The "RealName" property

    'RealName'read's'

The users real name.

### The "AccountType" property

    'AccountType'read'i'

The users account type, encoded as an integer:

- 0: Standard user

- 1: Administrator

### The "HomeDirectory" property

    'HomeDirectory'read's'

The users home directory.

### The "Shell" property

    'Shell'read's'

The users shell.

### The "Email" property

    'Email'read's'

The email address.

### The "Language" property

    'Language'read's'

The users language, as a locale specification like "de_DE.UTF-8".

### The "XSession" property

    'XSession'read's'

The users x session.

### The "Location" property

    'Location'read's'

The users location.

### The "LoginFrequency" property

    'LoginFrequency'read't'

How often the user has logged in.

### The "LoginTime" property

    'LoginTime'read'x'

The last login time.

### The "LoginHistory" property

    'LoginHistory'read'a(xxa{sv})'

The login history for this user. Each entry in the array represents a login session. The first two members are the login time and logout time, as timestamps (seconds since the epoch). If the session is still running, the logout time is 0.

The a{sv} member is a dictionary containing additional information about the session. Possible members include 'type' (with values like ':0', 'tty0', 'pts/0' etc).

### The "IconFile" property

    'IconFile'read's'

The filename of a png file containing the users icon.

### The "Locked" property

    'Locked'read'b'

Whether the users account is locked.

### The "PasswordMode" property

    'PasswordMode'read'i'

The password mode for the user account, encoded as an integer:

- 0: Regular password

- 1: Password must be set at next login

- 2: No password

### The "PasswordHint" property

    'PasswordHint'read's'

The password hint for the user.

### The "AutomaticLogin" property

    'AutomaticLogin'read'b'

Whether automatic login is enabled for the user.

### The "SystemAccount" property

    'SystemAccount'read'b'

Whether this is a 'system' account, like 'root' or 'nobody'. System accounts should normally not appear in lists of users, and ListCachedUsers will not include such accounts.

### The "LocalAccount" property

    'LocalAccount'read'b'

Whether the user is a local account or not.